Skip to content

chore: token policies persisted in DB#967

Open
Stellatsuu wants to merge 11 commits into
DIRACGrid:mainfrom
Stellatsuu:token-policies
Open

chore: token policies persisted in DB#967
Stellatsuu wants to merge 11 commits into
DIRACGrid:mainfrom
Stellatsuu:token-policies

Conversation

@Stellatsuu

@Stellatsuu Stellatsuu commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Closes: #524

Changes:

  • Moved the dirac_policies from TokenPayload to RefreshTokensPayload and AccessTokenPayload.
    Later, this should be removed from RefreshTokensPayload.

  • RefreshTokens now has a policies column.
    Manual updates to the already existing DBTable is needed: ALTER TABLE RefreshTokens ADD COLUMN Policies JSON. It should add NULL by default for existing values.

  • Policies are added from all_access_policies in the exchange_token function if no policies were found in the DB (e.g, new RefreshToken). Otherwise, they are taken from the DB to create a new AccessTokenPayload.

  • mint_token function doesn't need to enrich the token anymore since the payloads already have the policies inside them, from exchange_token function.

  • enrich_token function now takes only the AccessTokenPayload and returns one dict with the policies values.

@Stellatsuu Stellatsuu requested review from aldbr and chaen July 2, 2026 11:45
@Stellatsuu Stellatsuu self-assigned this Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extra token information coming from policies are not persisted in the refreshtoken DB

1 participant