Skip to content
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 TokenConfig and add JWT models #2

Merged
merged 13 commits into from
Nov 19, 2024

Conversation

NeonDaniel
Copy link
Member

@NeonDaniel NeonDaniel commented Nov 4, 2024

Description

Add BaseModel for JWT and HanaToken (to use for auth and refresh)
Update TokenConfig model to reflect expected database schema
Refactor AccessRoles values to allow for more in-between values
Add methods to read/dump PermissionsConfig to JWT-compatible role strings

Issues

Relates to NeonGeckoCom/neon-hana#33

Other Notes

This includes a breaking change to TokenConfig which has yet to be implemented anywhere; this change establishes the configuration that will be written to user databases

This includes a potentially breaking change to AccessRoles. If used as documented, this change will not affect behavior

Update TokenConfig model to reflect expected database schema
Refactor AccessRoles values to allow for more in-between values
Add methods to read/dump PermissionsConfig to JWT-compatible role strings
…omment

Update unit test to account for token config change
@NeonDaniel NeonDaniel requested a review from mikejgray November 7, 2024 00:07
@NeonDaniel NeonDaniel marked this pull request as ready for review November 7, 2024 00:07
@NeonDaniel NeonDaniel marked this pull request as draft November 12, 2024 01:01
@NeonDaniel
Copy link
Member Author

After some integration testing, having separate TokenConfig and HanaToken models is adding complexity when both objects are essentially representing the same information.

@NeonDaniel NeonDaniel marked this pull request as ready for review November 12, 2024 17:27
ADMIN = 6
# 7-8 Reserved for "restricted owners"
OWNER = 9
# 10 Reserved for "unlimited access"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 seems like a fairly small number, might want to consider something larger like 50 or 100 for "unlimited access". Food for thought, since you haven't defined it here it's not necessarily relevant for this PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was considering that too.. My main concern is that a very large range could make troubleshooting permissions more complicated, though restricting it to enumerated values does obviate that for the most part

@NeonDaniel NeonDaniel merged commit c3bc013 into dev Nov 19, 2024
6 checks passed
@NeonDaniel NeonDaniel deleted the FEAT_JWTModelAndTokenConfigUpdates branch November 19, 2024 20:59
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.

2 participants