Skip to content

Commit

Permalink
generic method for loading MS SP credentials from environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Rovnanik on WS committed Oct 1, 2024
1 parent a604beb commit b9af41d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions framework/src/main/groovy/ars/rockycube/GenericUtilities.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,19 @@ class GenericUtilities {
}
return js
}

/**
* Load credentials from System environment
* @return
*/
public static HashMap loadSharepointCredentialsFromEnv() {
def tid = System.getenv('RS_MS_TENANT_ID')
def cid = System.getenv('RS_MS_CLIENT_ID')
def cs = System.getenv('RS_MS_CLIENT_SECRET')

if (tid && cid && cs){
return [tenantId: tid, clientId: cid, clientSecret: cs]
}
return [:]
}
}

0 comments on commit b9af41d

Please sign in to comment.