mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
name_only argument for ssoprofile
This commit is contained in:
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
@@ -696,17 +696,18 @@ jobs:
|
|||||||
$gam user $gam_user delete shareddrive "${driveid}" nukefromorbit
|
$gam user $gam_user delete shareddrive "${driveid}" nukefromorbit
|
||||||
echo "printer model count:"
|
echo "printer model count:"
|
||||||
$gam print printermodels | wc -l
|
$gam print printermodels | wc -l
|
||||||
$gam create inboundssoprofile name "El Goog ${newbase}" loginurl https://www.google.com logouturl https://www.google.com changepasswordurl https://www.google.com entityid ElGoog
|
ssoprofile=$($gam create inboundssoprofile name "El Goog ${newbase}" loginurl https://www.google.com logouturl https://www.google.com changepasswordurl https://www.google.com entityid ElGoog name_only)
|
||||||
$gam create inboundssocredential profile "El Goog ${newbase}" generate_key
|
$gam create inboundssocredential profile "id:~~${ssoprofile}~~" generate_key
|
||||||
$gam create inboundssoassignment profile "El Goog ${newbase}" orgunit "${newou}" mode SAML_SSO
|
$gam create inboundssoassignment profile "id:~~${ssoprofile}~~" orgunit "${newou}" mode SAML_SSO
|
||||||
$gam delete ou "${newou}"
|
$gam delete ou "${newou}"
|
||||||
|
$gam delete inboundssoprofile "id:~~${ssoprofile}~~"
|
||||||
#$gam print printers
|
#$gam print printers
|
||||||
#$gam create printer displayname "${newbase}" uri ipp://localhost:631 driverless description "made by $(gam_user)" ou /
|
#$gam create printer displayname "${newbase}" uri ipp://localhost:631 driverless description "made by $(gam_user)" ou /
|
||||||
#export CUSTOMER_ID="C01wfv983"
|
export CUSTOMER_ID="C01wfv983"
|
||||||
#export GA_DOMAIN="pdl.jaylee.us"
|
export GA_DOMAIN="pdl.jaylee.us"
|
||||||
#touch $gampath/enabledasa.txt
|
touch $gampath/enabledasa.txt
|
||||||
#echo "using delegated admin service account"
|
echo "using delegated admin service account"
|
||||||
#$gam print users
|
$gam print users
|
||||||
|
|
||||||
- name: Archive production artifacts
|
- name: Archive production artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ def build():
|
|||||||
|
|
||||||
'''parse cmd for profile create/update'''
|
'''parse cmd for profile create/update'''
|
||||||
def parse_profile(body, i):
|
def parse_profile(body, i):
|
||||||
|
name_only = False
|
||||||
while i < len(sys.argv):
|
while i < len(sys.argv):
|
||||||
myarg = sys.argv[i].lower().replace('_', '')
|
myarg = sys.argv[i].lower().replace('_', '')
|
||||||
if myarg == 'name':
|
if myarg == 'name':
|
||||||
@@ -48,6 +49,9 @@ def parse_profile(body, i):
|
|||||||
elif myarg == 'entityid':
|
elif myarg == 'entityid':
|
||||||
body.setdefault('idpConfig', {})['entityId'] = sys.argv[i+1]
|
body.setdefault('idpConfig', {})['entityId'] = sys.argv[i+1]
|
||||||
i += 2
|
i += 2
|
||||||
|
elif myarg == 'nameonly':
|
||||||
|
name_only = True
|
||||||
|
i += 1
|
||||||
elif myarg == 'loginurl':
|
elif myarg == 'loginurl':
|
||||||
body.setdefault('idpConfig', {})['singleSignOnServiceUri'] = sys.argv[i+1]
|
body.setdefault('idpConfig', {})['singleSignOnServiceUri'] = sys.argv[i+1]
|
||||||
i += 2
|
i += 2
|
||||||
@@ -59,7 +63,7 @@ def parse_profile(body, i):
|
|||||||
i += 2
|
i += 2
|
||||||
else:
|
else:
|
||||||
controlflow.invalid_argument_exit(myarg, 'gam create/update inboundssoprofile')
|
controlflow.invalid_argument_exit(myarg, 'gam create/update inboundssoprofile')
|
||||||
return body
|
return (name_only, body)
|
||||||
|
|
||||||
|
|
||||||
'''convert profile nice names to unique ID'''
|
'''convert profile nice names to unique ID'''
|
||||||
@@ -135,8 +139,11 @@ def create_profile():
|
|||||||
'customer': get_sso_customer(),
|
'customer': get_sso_customer(),
|
||||||
'displayName': 'SSO Profile'
|
'displayName': 'SSO Profile'
|
||||||
}
|
}
|
||||||
body = parse_profile(body, 3)
|
name_only, body = parse_profile(body, 3)
|
||||||
result = gapi.call(ci.inboundSamlSsoProfiles(), 'create', body=body)
|
result = gapi.call(ci.inboundSamlSsoProfiles(), 'create', body=body)
|
||||||
|
if name_only:
|
||||||
|
print(result['response']['name'])
|
||||||
|
else:
|
||||||
display.print_json(result)
|
display.print_json(result)
|
||||||
|
|
||||||
|
|
||||||
@@ -184,13 +191,16 @@ def update_profile():
|
|||||||
ci = build()
|
ci = build()
|
||||||
name = profile_displayname_to_name(sys.argv[3], ci)
|
name = profile_displayname_to_name(sys.argv[3], ci)
|
||||||
body = {}
|
body = {}
|
||||||
body = parse_profile(body, 4)
|
name_only, body = parse_profile(body, 4)
|
||||||
updateMask = ','.join(body.keys())
|
updateMask = ','.join(body.keys())
|
||||||
result = gapi.call(ci.inboundSamlSsoProfiles(),
|
result = gapi.call(ci.inboundSamlSsoProfiles(),
|
||||||
'patch',
|
'patch',
|
||||||
name=name,
|
name=name,
|
||||||
updateMask=updateMask,
|
updateMask=updateMask,
|
||||||
body=body)
|
body=body)
|
||||||
|
if name_only:
|
||||||
|
print(result['response']['name'])
|
||||||
|
else:
|
||||||
display.print_json(result)
|
display.print_json(result)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user