mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-29 18:31:38 +00:00
GCP cleanup (#1602)
This commit is contained in:
@@ -911,6 +911,12 @@ gam oauth|oauth2 refresh
|
|||||||
|
|
||||||
gam <UserTypeEntity> check serviceaccount [scope|scopes <APIScopeURLList>]
|
gam <UserTypeEntity> check serviceaccount [scope|scopes <APIScopeURLList>]
|
||||||
|
|
||||||
|
gam yubikey [resetpiv]
|
||||||
|
gam rotate sakey yubikey yubikey_pin yubikey_slot AUTHENTICATION yubikeypin <String> yubikeyserialnumber <String>
|
||||||
|
|
||||||
|
gam create [gcpserviceaccount|signjwtserviceaccount]
|
||||||
|
gam enable apis [auto|manual]
|
||||||
|
|
||||||
gam whatis <EmailItem>
|
gam whatis <EmailItem>
|
||||||
|
|
||||||
<ResoldCustomerAttribute> ::=
|
<ResoldCustomerAttribute> ::=
|
||||||
|
|||||||
@@ -7170,17 +7170,26 @@ def getGAMProjectFile(filepath):
|
|||||||
|
|
||||||
|
|
||||||
def enable_apis():
|
def enable_apis():
|
||||||
|
a_or_m = None
|
||||||
|
i = 3
|
||||||
|
while i < len(sys.argv):
|
||||||
|
myarg = sys.argv[i].lower()
|
||||||
|
if myarg in ['auto', 'manual']:
|
||||||
|
a_or_m = myarg[0]
|
||||||
|
i += 1
|
||||||
|
else:
|
||||||
|
controlflow.invalid_argument_exit(sys.argv[i],
|
||||||
|
'gam enable apis')
|
||||||
GAMProjectAPIs = getGAMProjectFile('project-apis.txt').splitlines()
|
GAMProjectAPIs = getGAMProjectFile('project-apis.txt').splitlines()
|
||||||
try:
|
try:
|
||||||
_, projectId = google.auth.default()
|
_, projectId = google.auth.default()
|
||||||
except google.auth.exceptions.DefaultCredentialsError as e:
|
except google.auth.exceptions.DefaultCredentialsError as e:
|
||||||
projectId = input('Please enter your project ID: ')
|
projectId = input('Please enter your project ID: ')
|
||||||
while True:
|
while a_or_m not in ['a', 'm']:
|
||||||
a_or_m = input('Do you want to enable projects [a]utomatically or [m]anually? (a/m): ').strip().lower()
|
a_or_m = input('Do you want to enable projects [a]utomatically or [m]anually? (a/m): ').strip().lower()
|
||||||
if a_or_m in ['a', 'm']:
|
if a_or_m in ['a', 'm']:
|
||||||
break
|
break
|
||||||
else:
|
print('Please enter A or M....')
|
||||||
print('Please enter A or M....')
|
|
||||||
if a_or_m == 'a':
|
if a_or_m == 'a':
|
||||||
login_hint = _getValidateLoginHint()
|
login_hint = _getValidateLoginHint()
|
||||||
_, httpObj = getCRMService(login_hint)
|
_, httpObj = getCRMService(login_hint)
|
||||||
@@ -7883,6 +7892,9 @@ def doShowServiceAccountKeys():
|
|||||||
|
|
||||||
|
|
||||||
def create_signjwt_serviceaccount():
|
def create_signjwt_serviceaccount():
|
||||||
|
i = 3
|
||||||
|
if i < len(sys.argv):
|
||||||
|
controlflow.invalid_argument_exit(sys.argv[i], f'gam create {sys.argv[2]}')
|
||||||
_checkForExistingProjectFiles()
|
_checkForExistingProjectFiles()
|
||||||
sa_info = {
|
sa_info = {
|
||||||
'type': 'service_account',
|
'type': 'service_account',
|
||||||
@@ -11625,7 +11637,7 @@ def ProcessGAMCommand(args):
|
|||||||
gapi_chat.create_message()
|
gapi_chat.create_message()
|
||||||
elif argument in ['caalevel']:
|
elif argument in ['caalevel']:
|
||||||
gapi_caa.create_access_level()
|
gapi_caa.create_access_level()
|
||||||
elif argument in ['signjwtserviceaccount']:
|
elif argument in ['gcpserviceaccount', 'signjwtserviceaccount']:
|
||||||
create_signjwt_serviceaccount()
|
create_signjwt_serviceaccount()
|
||||||
else:
|
else:
|
||||||
controlflow.invalid_argument_exit(argument, 'gam create')
|
controlflow.invalid_argument_exit(argument, 'gam create')
|
||||||
|
|||||||
Reference in New Issue
Block a user