-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to model generation for MultiValueEnum's #317
Update to model generation for MultiValueEnum's #317
Conversation
Especially OAuthGrantType in question
self.pkce_required = config["pkceRequired"]\ | ||
if "pkceRequired" in config else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removals in this file were done when running yarn build
against the spec
SAML_2_BEARER = "urn:ietf:params:oauth:grant-type:saml2-bearer", "URN:IETF:PARAMS:OAUTH:GRANT-TYPE:SAML2-BEARER" | ||
DEVICE_CODE = "urn:ietf:params:oauth:grant-type:device_code", "URN:IETF:PARAMS:OAUTH:GRANT-TYPE:DEVICE_CODE" | ||
TOKEN_EXCHANGE = "urn:ietf:params:oauth:grant-type:token-exchange", "URN:IETF:PARAMS:OAUTH:GRANT-TYPE:TOKEN-EXCHANGE" | ||
INTERACTION_CODE = "interaction_code", "INTERACTION_CODE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newly added OAuthGrantType
s
@@ -31,4 +31,3 @@ class OpenIdConnectApplicationIssuerMode( | |||
|
|||
CUSTOM_URL = "CUSTOM_URL", "custom_url" | |||
ORG_URL = "ORG_URL", "org_url" | |||
DYNAMIC = "DYNAMIC", "dynamic" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed during yarn build
const URN_GRANT_TYPES = ['device_code', 'saml2_bearer', 'token_exchange']; | ||
const URN_PREFIX = 'urn:ietf:params:oauth:grant-type:'; | ||
const URN_SUFFIXES = { | ||
'device_code': 'device_code', | ||
'saml2_bearer': 'saml2-bearer', | ||
'token_exchange': 'token-exchange' | ||
}; | ||
|
||
// Determines if OAuthGrantType needs prefix | ||
function isUrnGrantType(grantType) { | ||
return URN_GRANT_TYPES.includes(grantType); | ||
} | ||
|
||
// Prefixes openAPI spec enum with OAuthGrantType urn prefix | ||
function prefixUrnGrantType(grantType) { | ||
return URN_PREFIX + URN_SUFFIXES[grantType]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helper functions used to determine if a grant type needs the urn prefix (urn:ietf:params:oauth:grant-type:
) and if so, to prefix it onto the actual enum value
version "2.11.1" | ||
resolved "https://registry.yarnpkg.com/@okta/openapi/-/openapi-2.11.1.tgz#49e9738fbd68520b7a2deaf74d63f67e41a3e924" | ||
integrity sha512-FdDTwscwULg94nGFAhlncLpKr+46nfkjWe2npe9+Th8xaMcnRYtymsUMI8wXNMrOxOJ9+lxTplnfJVl1n4i/Cw== | ||
"@apidevtools/[email protected]": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left yarn.lock
changes in as it seemed the yarn build
ran consistently faster with them
Especially OAuthGrantType in question
….com:okta/okta-sdk-python into jabro-okta-531005-update-oauthgranttype-enum
Problem:
Python SDK does not have the urn:ietf:params:oauth:grant-type:saml2-bearer OAuthGrantType here that the customer cannot create such an OAuth2 Client using the Python SDK.
This PR updates the model generation within
model.py.hbs
to handle these cases after updates to the openAPI spec here: okta/okta-management-openapi-spec#148Generated code in OAuthGrantType now looks like this with newly added types:
JIRA: OKTA-531005
Intended to Resolve: #298