move M365 creds rotation logic to code
This commit is contained in:
parent
6d2027d6c2
commit
3d1fa661bf
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@ -177,8 +177,8 @@ jobs:
|
|||||||
# run the tests
|
# run the tests
|
||||||
- name: Integration Tests
|
- name: Integration Tests
|
||||||
env:
|
env:
|
||||||
AZURE_CLIENT_ID: ${{ secrets[env.AZURE_CLIENT_ID_NAME] }}
|
AZURE_CLIENT_ID: ${{ secrets[CLIENT_ID] }},${{ secrets[CLIENT_ID_2] }},${{ secrets[CLIENT_ID_3] }},${{ secrets[CLIENT_ID_4] }}
|
||||||
AZURE_CLIENT_SECRET: ${{ secrets[env.AZURE_CLIENT_SECRET_NAME] }}
|
AZURE_CLIENT_SECRET: ${{ secrets[CLIENT_SECRET] }},${{ secrets[CLIENT_SECRET_2] }},${{ secrets[CLIENT_SECRET_3] }},${{ secrets[CLIENT_SECRET_4] }}
|
||||||
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
||||||
CORSO_CI_TESTS: true
|
CORSO_CI_TESTS: true
|
||||||
CORSO_M365_TEST_USER_ID: ${{ vars.CORSO_M365_TEST_USER_ID }}
|
CORSO_M365_TEST_USER_ID: ${{ vars.CORSO_M365_TEST_USER_ID }}
|
||||||
@ -259,8 +259,8 @@ jobs:
|
|||||||
# run the tests
|
# run the tests
|
||||||
- name: Retention Tests
|
- name: Retention Tests
|
||||||
env:
|
env:
|
||||||
AZURE_CLIENT_ID: ${{ secrets[env.AZURE_CLIENT_ID_NAME] }}
|
AZURE_CLIENT_ID: ${{ secrets[CLIENT_ID] }},${{ secrets[CLIENT_ID_2] }},${{ secrets[CLIENT_ID_3] }},${{ secrets[CLIENT_ID_4] }}
|
||||||
AZURE_CLIENT_SECRET: ${{ secrets[env.AZURE_CLIENT_SECRET_NAME] }}
|
AZURE_CLIENT_SECRET: ${{ secrets[CLIENT_SECRET] }},${{ secrets[CLIENT_SECRET_2] }},${{ secrets[CLIENT_SECRET_3] }},${{ secrets[CLIENT_SECRET_4] }}
|
||||||
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
||||||
CORSO_RETENTION_TESTS: true
|
CORSO_RETENTION_TESTS: true
|
||||||
CORSO_M365_TEST_USER_ID: ${{ vars.CORSO_M365_TEST_USER_ID }}
|
CORSO_M365_TEST_USER_ID: ${{ vars.CORSO_M365_TEST_USER_ID }}
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
package credentials
|
package credentials
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
)
|
)
|
||||||
@ -25,6 +27,18 @@ func GetM365() M365 {
|
|||||||
AzureClientID := os.Getenv(AzureClientID)
|
AzureClientID := os.Getenv(AzureClientID)
|
||||||
AzureClientSecret := os.Getenv(AzureClientSecret)
|
AzureClientSecret := os.Getenv(AzureClientSecret)
|
||||||
|
|
||||||
|
randomNumber := rand.Intn(4) + 1
|
||||||
|
|
||||||
|
if strings.Contains(AzureClientID, ",") {
|
||||||
|
AzureClientIDs := strings.Split(AzureClientID, ",")
|
||||||
|
AzureClientID = AzureClientIDs[randomNumber]
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.Contains(AzureClientID, ",") {
|
||||||
|
AzureClientSecrets := strings.Split(AzureClientSecret, ",")
|
||||||
|
AzureClientSecret = AzureClientSecrets[randomNumber]
|
||||||
|
}
|
||||||
|
|
||||||
return M365{
|
return M365{
|
||||||
AzureClientID: AzureClientID,
|
AzureClientID: AzureClientID,
|
||||||
AzureClientSecret: AzureClientSecret,
|
AzureClientSecret: AzureClientSecret,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user