-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: SCIM integration v1 readiness (#2846)
<!-- Feel free to delete comments as you fill this in --> <!-- summary of changes --> - Added missing fields - Renamed fields to match docs - Migrated to Context functions - Added acceptance tests - Fixed handling empty comments in SDK - changed UNSET to SET with empty value ## Test Plan <!-- detail ways in which this PR has been tested or needs to be tested --> * [x] acceptance tests ## References <!-- issues documentation links, etc --> https://docs.snowflake.com/en/sql-reference/sql/create-security-integration-scim
- Loading branch information
1 parent
5df6d3d
commit 269df6b
Showing
35 changed files
with
900 additions
and
316 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
resource "snowflake_scim_integration" "aad" { | ||
name = "AAD_PROVISIONING" | ||
network_policy = "AAD_NETWORK_POLICY" | ||
provisioner_role = "AAD_PROVISIONER" | ||
scim_client = "AZURE" | ||
} | ||
# basic resource | ||
resource "snowflake_scim_integration" "test" { | ||
name = "test" | ||
enabled = true | ||
scim_client = "GENERIC" | ||
sync_password = true | ||
} | ||
# resource with all fields set | ||
resource "snowflake_scim_integration" "test" { | ||
name = "test" | ||
enabled = true | ||
scim_client = "GENERIC" | ||
sync_password = true | ||
network_policy = "network_policy_test" | ||
run_as_role = "GENERIC_SCIM_PROVISIONER" | ||
comment = "foo" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package helpers | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestMatchAllStringsInOrderNonOverlapping(t *testing.T) { | ||
testCases := map[string]struct { | ||
parts []string | ||
text string | ||
wantMatch bool | ||
}{ | ||
"empty parts and text": { | ||
parts: []string{}, | ||
text: "", | ||
wantMatch: true, | ||
}, | ||
"empty parts": { | ||
parts: []string{}, | ||
text: "xyz", | ||
wantMatch: true, | ||
}, | ||
"empty text": { | ||
parts: []string{"a", "b"}, | ||
text: "", | ||
}, | ||
"matching non empty": { | ||
parts: []string{"a", "b"}, | ||
text: "xyaxyb", | ||
wantMatch: true, | ||
}, | ||
"partial matching": { | ||
parts: []string{"a", "b"}, | ||
text: "axyz", | ||
}, | ||
"not matching": { | ||
parts: []string{"a", "b"}, | ||
text: "xyz", | ||
}, | ||
"wrong order": { | ||
parts: []string{"a", "b"}, | ||
text: "ba", | ||
}, | ||
"overlapping match": { | ||
parts: []string{"abb", "bba"}, | ||
text: "abba", | ||
}, | ||
} | ||
|
||
for name, tc := range testCases { | ||
t.Run(name, func(t *testing.T) { | ||
regex := MatchAllStringsInOrderNonOverlapping(tc.parts) | ||
require.Equal(t, tc.wantMatch, regex.Match([]byte(tc.text))) | ||
}) | ||
} | ||
} |
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
Oops, something went wrong.