You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Policies were added by mint_token after insert_token (in DB) from exchange_token was called, so they were never added to the DB, only to the JWT. RefreshTokens DB was also missing a Policy column.
Changes:
RefreshTokens now has a policies column (updates to the DB tablecolumns might be needed)
Policies are now added before inserting the token in the DB in the exchange_token function.
mint_token function doesn't need to enrich the token anymore since the payloads already have the policies inside them, from exchange_token function.
Is it normal that none of the policies (WMSAccessPolicy, SandboxAccessPolicy, LollygagAccessPolicy and MyPilotsAccessPolicy) implements this function?:
"""Add content to access or refresh payload when issuing a token.
Content can be whatever is desired inside the access or refresh payload.
:param access_payload: access token payload
:param refresh_payload: refresh token payload
:returns: extra content for both payload
"""
return {}, {}
The only one having it is AlwaysAllowAccessPolicy, used for the tests. Even by adding the policies to the DB, they would only be empty dicts without this function implemented no?
Since all the work for adding policies to token is done here:
Is it normal that none of the policies (WMSAccessPolicy, SandboxAccessPolicy, LollygagAccessPolicy and MyPilotsAccessPolicy) implements this function?:
Yes, this is there as something that we know we will need but that we don't yet have a use for.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #524
Issue found:
Policies were added by
mint_tokenafterinsert_token(in DB) fromexchange_tokenwas called, so they were never added to the DB, only to the JWT.RefreshTokensDB was also missing a Policy column.Changes:
RefreshTokensnow has apoliciescolumn (updates to the DB tablecolumns might be needed)exchange_tokenfunction.mint_tokenfunction doesn't need to enrich the token anymore since the payloads already have the policies inside them, fromexchange_tokenfunction.enrich_tokenfunction (?). I'm not sure if they are really unnecessary -> see about the lack of usage ofenrich_token, : fix: added policies to RefreshToken DB #950 (comment)Results:
RefreshTokentable: