-
-
Notifications
You must be signed in to change notification settings - Fork 963
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(saml): resolving conflicts with master
Signed-off-by: sebferrer <[email protected]> Co-authored-by: ThibaultHerard <[email protected]>
- Loading branch information
Showing
6 changed files
with
38 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import ( | |
|
||
"github.com/beevik/etree" | ||
"github.com/crewjam/saml" | ||
"github.com/ory/kratos/identity" | ||
|
||
dsig "github.com/russellhaering/goxmldsig" | ||
"gotest.tools/assert" | ||
|
@@ -56,9 +57,6 @@ func TestHappyPath(t *testing.T) { | |
// We send the request to Kratos | ||
strategy.HandleCallback(resp, req, ps) | ||
|
||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), 0, 1000) | ||
_ = ids | ||
|
||
// This is the Happy Path, the HTTP response code should be 302 (Found status) | ||
assert.Check(t, !strings.Contains(resp.HeaderMap["Location"][0], "error")) | ||
} | ||
|
@@ -498,7 +496,7 @@ func TestAddXMLCommentsInSAMLAttributes(t *testing.T) { | |
strategy.HandleCallback(resp, req, ps) | ||
|
||
// Get all identities | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), 0, 1000) | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), identity.ExpandEverything, 0, 1000) | ||
traitsMap := make(map[string]interface{}) | ||
json.Unmarshal(ids[0].Traits, &traitsMap) | ||
|
||
|
@@ -682,7 +680,7 @@ func TestXSW3AssertionWrap1(t *testing.T) { | |
strategy.HandleCallback(resp, req, ps) | ||
|
||
// Get all identities | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), 0, 1000) | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), identity.ExpandEverything, 0, 1000) | ||
|
||
// We have to check that there is either an error or an identity created without the modified attribute | ||
assert.Check(t, strings.Contains(resp.HeaderMap["Location"][0], "error") || strings.Contains(string(ids[0].Traits), "[email protected]")) | ||
|
@@ -744,7 +742,7 @@ func TestXSW4AssertionWrap2(t *testing.T) { | |
strategy.HandleCallback(resp, req, ps) | ||
|
||
// Get all identities | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), 0, 1000) | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), identity.ExpandEverything, 0, 1000) | ||
|
||
// We have to check that there is either an error or an identity created without the modified attribute | ||
assert.Check(t, strings.Contains(resp.HeaderMap["Location"][0], "error") || strings.Contains(string(ids[0].Traits), "[email protected]")) | ||
|
@@ -806,7 +804,7 @@ func TestXSW5AssertionWrap3(t *testing.T) { | |
strategy.HandleCallback(resp, req, ps) | ||
|
||
// Get all identities | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), 0, 1000) | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), identity.ExpandEverything, 0, 1000) | ||
|
||
// We have to check that there is either an error or an identity created without the modified attribute | ||
assert.Check(t, strings.Contains(resp.HeaderMap["Location"][0], "error") || strings.Contains(string(ids[0].Traits), "[email protected]")) | ||
|
@@ -868,7 +866,7 @@ func TestXSW6AssertionWrap4(t *testing.T) { | |
strategy.HandleCallback(resp, req, ps) | ||
|
||
// Get all identities | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), 0, 1000) | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), identity.ExpandEverything, 0, 1000) | ||
|
||
// We have to check that there is either an error or an identity created without the modified attribute | ||
assert.Check(t, strings.Contains(resp.HeaderMap["Location"][0], "error") || strings.Contains(string(ids[0].Traits), "[email protected]")) | ||
|
@@ -930,7 +928,7 @@ func TestXSW7AssertionWrap5(t *testing.T) { | |
strategy.HandleCallback(resp, req, ps) | ||
|
||
// Get all identities | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), 0, 1000) | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), identity.ExpandEverything, 0, 1000) | ||
|
||
// We have to check that there is either an error or an identity created without the modified attribute | ||
assert.Check(t, strings.Contains(resp.HeaderMap["Location"][0], "error") || strings.Contains(string(ids[0].Traits), "[email protected]")) | ||
|
@@ -990,7 +988,7 @@ func TestXSW8AssertionWrap6(t *testing.T) { | |
strategy.HandleCallback(resp, req, ps) | ||
|
||
// Get all identities | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), 0, 1000) | ||
ids, _ := strategy.D().PrivilegedIdentityPool().ListIdentities(context.Background(), identity.ExpandEverything, 0, 1000) | ||
|
||
// We have to check that there is either an error or an identity created without the modified attribute | ||
assert.Check(t, strings.Contains(resp.HeaderMap["Location"][0], "error") || strings.Contains(string(ids[0].Traits), "[email protected]")) | ||
|