-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: fix tests, add role attribute path / role mapping to oidc server tests Signed-off-by: Mark Phelps <[email protected]> * chore: authz middleware tests Signed-off-by: Mark Phelps <[email protected]> * chore: fix audit tests Signed-off-by: Mark Phelps <[email protected]> * chore: proto regen Signed-off-by: Mark Phelps <[email protected]> * chore: try to fix marshal audit events behaviour Signed-off-by: Mark Phelps <[email protected]> * chore: fix failing test Signed-off-by: Mark Phelps <[email protected]> --------- Signed-off-by: Mark Phelps <[email protected]>
- Loading branch information
1 parent
f4e8290
commit ab1b48a
Showing
24 changed files
with
307 additions
and
81 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,7 @@ func Test_Server_ImplicitFlow(t *testing.T) { | |
CustomClaims: map[string]interface{}{ | ||
"email": "[email protected]", | ||
"name": "Mark Phelps", | ||
"roles": []string{"admin"}, | ||
}, | ||
}, | ||
"george": { | ||
|
@@ -76,6 +77,7 @@ func Test_Server_ImplicitFlow(t *testing.T) { | |
CustomClaims: map[string]interface{}{ | ||
"email": "[email protected]", | ||
"name": "George MacRorie", | ||
"roles": []string{"editor"}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -107,10 +109,11 @@ func Test_Server_ImplicitFlow(t *testing.T) { | |
Method: config.AuthenticationMethodOIDCConfig{ | ||
Providers: map[string]config.AuthenticationMethodOIDCProvider{ | ||
"google": { | ||
IssuerURL: tp.Addr(), | ||
ClientID: id, | ||
ClientSecret: secret, | ||
RedirectAddress: clientAddress, | ||
IssuerURL: tp.Addr(), | ||
ClientID: id, | ||
ClientSecret: secret, | ||
RedirectAddress: clientAddress, | ||
RoleAttributePath: "contains(roles[*], 'admin') && 'admin' || contains(roles[*], 'editor') && 'editor' || 'viewer'", | ||
}, | ||
}, | ||
}, | ||
|
@@ -167,6 +170,7 @@ func Test_Server_PKCE(t *testing.T) { | |
CustomClaims: map[string]interface{}{ | ||
"email": "[email protected]", | ||
"name": "Mark Phelps", | ||
"roles": []string{"admin"}, | ||
}, | ||
}, | ||
"george": { | ||
|
@@ -178,6 +182,7 @@ func Test_Server_PKCE(t *testing.T) { | |
CustomClaims: map[string]interface{}{ | ||
"email": "[email protected]", | ||
"name": "George MacRorie", | ||
"roles": []string{"editor"}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -210,11 +215,12 @@ func Test_Server_PKCE(t *testing.T) { | |
Method: config.AuthenticationMethodOIDCConfig{ | ||
Providers: map[string]config.AuthenticationMethodOIDCProvider{ | ||
"google": { | ||
IssuerURL: tp.Addr(), | ||
ClientID: id, | ||
ClientSecret: secret, | ||
RedirectAddress: clientAddress, | ||
UsePKCE: true, | ||
IssuerURL: tp.Addr(), | ||
ClientID: id, | ||
ClientSecret: secret, | ||
RedirectAddress: clientAddress, | ||
UsePKCE: true, | ||
RoleAttributePath: "contains(roles[*], 'admin') && 'admin' || contains(roles[*], 'editor') && 'editor' || 'viewer'", | ||
}, | ||
}, | ||
}, | ||
|
@@ -345,6 +351,7 @@ func testOIDCFlow(t *testing.T, ctx context.Context, tpAddr, clientAddress strin | |
"io.flipt.auth.oidc.email": "[email protected]", | ||
"io.flipt.auth.oidc.name": "Mark Phelps", | ||
"io.flipt.auth.oidc.sub": "mark", | ||
"io.flipt.auth.role": "admin", | ||
}, response.Authentication.Metadata) | ||
|
||
// ensure expiry is set | ||
|
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
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
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
Oops, something went wrong.