-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
This file contains 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
…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
…cope bit information
…rom implementation to the spec.
… the implementation where tests would hang because of unaccounted for null exceptions
…es check for OAuthNukleus as well.
…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
jfallows
requested changes
Jun 4, 2019
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthNukleus.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthNukleus.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthNukleus.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/stream/OAuthProxyFactory.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/stream/OAuthProxyFactoryBuilder.java
Outdated
Show resolved
Hide resolved
src/test/java/org/reaktivity/nukleus/oauth/internal/control/ControllerIT.java
Outdated
Show resolved
Hide resolved
src/test/java/org/reaktivity/nukleus/oauth/internal/streams/StreamsIT.java
Outdated
Show resolved
Hide resolved
src/test/java/org/reaktivity/nukleus/oauth/internal/streams/StreamsIT.java
Outdated
Show resolved
Hide resolved
…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.
…ealm, should NOT have been adding a reaklm
…uilds correctly as well.
jfallows
requested changes
Jun 6, 2019
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthNukleus.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/stream/OAuthProxyFactoryBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/stream/OAuthProxyFactoryBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
…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().
jfallows
requested changes
Jun 6, 2019
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/test/java/org/reaktivity/nukleus/oauth/internal/OAuthRealmsTest.java
Outdated
Show resolved
Hide resolved
…way scope bit shifting works. fixed tests as well
…OAuthRealmsTest, newSignedSignature(), to create a new signed signature for testing RESOLVE
jfallows
requested changes
Jun 7, 2019
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
…plied change to use this::assignScopeBit in computeIfAbsent
jfallows
requested changes
Jun 7, 2019
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/stream/OAuthProxyFactoryBuilder.java
Outdated
Show resolved
Hide resolved
src/test/java/org/reaktivity/nukleus/oauth/internal/OAuthRealmsTest.java
Outdated
Show resolved
Hide resolved
…se. fixed imports to be alphabetical
…se. fixed imports to be alphabetical
… 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
jfallows
requested changes
Jun 10, 2019
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.
Suggestions to remove need for IllegalStateException
in error case.
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
jfallows
requested changes
Jun 10, 2019
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
… will now just make authorization be 0 and instead asserts that if condition rather than throwing the error.
jfallows
requested changes
Jun 10, 2019
src/main/java/org/reaktivity/nukleus/oauth/internal/OAuthRealms.java
Outdated
Show resolved
Hide resolved
…::newOAuthRealm` to `OAuthRealm::new` and removed `newOAuthRealm` method.
jfallows
previously approved these changes
Jun 11, 2019
jfallows
approved these changes
Jun 11, 2019
This was referenced Jun 11, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.