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

Enforce scope claim as authorization bitmask #21

Merged
merged 33 commits into from
Jun 11, 2019

Conversation

dknoma
Copy link
Contributor

@dknoma dknoma commented May 30, 2019

No description provided.

dknoma added 7 commits May 24, 2019 17:06
…o ToLongBiFunction to accomodate for a String scopes parameter in resolve. TODO: actually do something with the scopes string. (it is not necessary to auto-resolve a previously unseen scope)
…resent during resolve. if scope bit exists, grabs that bit and | it to the realmBit. else assigns the bit THEN grab and | it to the realmBit. fixed test for it as well to have correct expectedAuthorization
… status code to test for, and if resolve should ignore excess scopes or if that's taken care of beforehand
@jfallows jfallows changed the title For Review Enforce scope claim as authorization bitmask May 31, 2019
dknoma added 7 commits May 31, 2019 10:02
… the implementation where tests would hang because of unaccounted for null exceptions
…gnize 281474976710663 vs. 0x0001_000000000007L. with.roles script passes on its own, but when grouped with the route and stream scripts it fails
…cope authorization bits are set, route is set up correctly and authorization seems to be correctly required now
dknoma added 7 commits June 4, 2019 10:28
…ver commented code. changed resolveRealm from ToLongBiFunction to ToLongFunction<JsonWebSignature>. Renamed variables and parameters to be more specific.
…an outdated version of lookup() that use different parameters in its signature. keeping old method for now, will need to change.
…ctly call RESOLVE first before executing their scripts allowing the oauth realms to be correctly added. all StreamIT tests are passing.
…use the new lookup() method that uses JsonWebSignature as its lone parameter.
dknoma added 2 commits June 6, 2019 10:58
…msTest to use resolve() instead of add() now. StreamIT tests now use the correct format for route/resolve tests.
…et/supplybits and used built-in getOrDefault() and computeIfAbsent() in lookup() and resolve() respectively. better checks if there are too many scopes and reduces redundancy of checking if a scope has its bit set and doing computeIfAbsent().
dknoma added 2 commits June 6, 2019 16:55
…way scope bit shifting works. fixed tests as well
…OAuthRealmsTest, newSignedSignature(), to create a new signed signature for testing RESOLVE
…plied change to use this::assignScopeBit in computeIfAbsent
dknoma added 4 commits June 7, 2019 13:45
… too.many.realms tests. too many realms or scopes trying to be resolved will end up with NO_AUTHORIZATION (0) due to IllegalStateExceptions. Maybe want to change this later
… too.many.realms tests. too many realms or scopes trying to be resolved will end up with NO_AUTHORIZATION (0) due to IllegalStateExceptions. Maybe want to change this later
Copy link
Contributor

@jfallows jfallows left a comment

Choose a reason for hiding this comment

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

Suggestions to remove need for IllegalStateException in error case.

… will now just make authorization be 0 and instead asserts that if condition rather than throwing the error.
…::newOAuthRealm` to `OAuthRealm::new` and removed `newOAuthRealm` method.
jfallows
jfallows previously approved these changes Jun 11, 2019
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