-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44a1ed6
commit cbf6160
Showing
8 changed files
with
2,441 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
gooddata-sdk/gooddata_sdk/catalog/organization/entity_model/jwk.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# (C) 2022 GoodData Corporation | ||
from __future__ import annotations | ||
|
||
from typing import List, Optional, Type | ||
|
||
import attr | ||
|
||
from gooddata_api_client.model.json_api_jwk_in import JsonApiJwkIn | ||
from gooddata_api_client.model.json_api_jwk_in_attributes import JsonApiJwkInAttributes | ||
from gooddata_api_client.model.json_api_jwk_in_attributes_content import JsonApiJwkInAttributesContent | ||
from gooddata_api_client.model.json_api_jwk_in_document import JsonApiJwkInDocument | ||
from gooddata_sdk.catalog.base import Base | ||
|
||
|
||
@attr.s(auto_attribs=True, kw_only=True) | ||
class CatalogJwkDocument(Base): | ||
data: CatalogJwk | ||
|
||
@staticmethod | ||
def client_class() -> Type[JsonApiJwkInDocument]: | ||
return JsonApiJwkInDocument | ||
|
||
|
||
@attr.s(auto_attribs=True, kw_only=True) | ||
class CatalogJwk(Base): | ||
id: str | ||
attributes: Optional[CatalogJwkAttributes] = None | ||
|
||
@staticmethod | ||
def client_class() -> Type[JsonApiJwkIn]: | ||
return JsonApiJwkIn | ||
|
||
@classmethod | ||
def init( | ||
cls, | ||
jwk_id: str, | ||
rsa_spec: Optional[CatalogRsaSpecification] = None, | ||
) -> CatalogJwk: | ||
return cls(id=jwk_id, attributes=CatalogJwkAttributes(content=rsa_spec)) | ||
|
||
|
||
@attr.s(auto_attribs=True, kw_only=True) | ||
class CatalogJwkAttributes(Base): | ||
content: Optional[CatalogRsaSpecification] = None | ||
|
||
@staticmethod | ||
def client_class() -> Type[JsonApiJwkInAttributes]: | ||
return JsonApiJwkInAttributes | ||
|
||
|
||
@attr.s(auto_attribs=True, kw_only=True) | ||
class CatalogRsaSpecification(Base): | ||
alg: str | ||
e: str | ||
kid: str | ||
kty: str | ||
n: str | ||
use: str | ||
x5c: List[str] | ||
x5t: str | ||
|
||
@staticmethod | ||
def client_class() -> Type[JsonApiJwkInAttributesContent]: | ||
return JsonApiJwkInAttributesContent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.