-
Notifications
You must be signed in to change notification settings - Fork 191
sso_proxy: reduce direct calls to ValidateGroup() and clean up logic #275
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
Open
Jusshersmith
wants to merge
16
commits into
main
Choose a base branch
from
jusshersmith-session-expiry-validations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b27f1f8
sso_*:clean up some validation calls
Jusshersmith 0ae7ffd
sso: fix and add tests
Jusshersmith 8e49702
proxy: small comment change
Jusshersmith 6b9497e
metric change
Jusshersmith fcef7d3
changes from review:
Jusshersmith 461036b
extra validator rename fixes
Jusshersmith 54d03fb
quick test to test upstream verification through session state
Jusshersmith 1b7d6d3
changes following review
Jusshersmith d69ebed
extra logging
Jusshersmith 1e8a5f4
change error to allow for graceful introduction of this session change
Jusshersmith 161e37c
change log level
Jusshersmith 5684a89
some small formatting changes
Jusshersmith 5041e5a
removed overengineered formatting logic
Jusshersmith b13dfde
missing word in comment
Jusshersmith 2ab3891
re-word comment
Jusshersmith e27db33
add missing return
Jusshersmith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,20 +55,29 @@ func TestSessionStateExpirations(t *testing.T) { | |
LifetimeDeadline: time.Now().Add(-1 * time.Hour), | ||
RefreshDeadline: time.Now().Add(-1 * time.Hour), | ||
ValidDeadline: time.Now().Add(-1 * time.Minute), | ||
GracePeriodStart: time.Now().Add(-2 * time.Minute), | ||
|
||
Email: "[email protected]", | ||
User: "user", | ||
} | ||
|
||
if !session.LifetimePeriodExpired() { | ||
t.Errorf("expcted lifetime period to be expired") | ||
t.Errorf("expected lifetime period to be expired") | ||
} | ||
|
||
if !session.RefreshPeriodExpired() { | ||
t.Errorf("expcted lifetime period to be expired") | ||
t.Errorf("expected lifetime period to be expired") | ||
} | ||
|
||
if !session.ValidationPeriodExpired() { | ||
t.Errorf("expcted lifetime period to be expired") | ||
t.Errorf("expected lifetime period to be expired") | ||
} | ||
|
||
if session.IsWithinGracePeriod(1 * time.Minute) { | ||
t.Errorf("expected session to be outside of grace period") | ||
} | ||
|
||
if !session.IsWithinGracePeriod(3 * time.Minute) { | ||
t.Errorf("expected session to be inside of grace period") | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...al/pkg/options/email_address_validator.go → ...pkg/validators/email_address_validator.go
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package options | ||
package validators | ||
|
||
import ( | ||
"errors" | ||
|
2 changes: 1 addition & 1 deletion
2
...g/options/email_address_validator_test.go → ...alidators/email_address_validator_test.go
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package options | ||
package validators | ||
|
||
import ( | ||
"testing" | ||
|
2 changes: 1 addition & 1 deletion
2
...nal/pkg/options/email_domain_validator.go → .../pkg/validators/email_domain_validator.go
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package options | ||
package validators | ||
|
||
import ( | ||
"errors" | ||
|
2 changes: 1 addition & 1 deletion
2
...kg/options/email_domain_validator_test.go → ...validators/email_domain_validator_test.go
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package options | ||
package validators | ||
|
||
import ( | ||
"testing" | ||
|
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.