feat: add auth support for GCP access tokens (#574)

Introduce choice "accesstoken" for auth_kind for modules
Introduce optional access_token string param that falls back to
  GCP_ACCESS_TOKEN env var
This commit is contained in:
Shlomo Shuck 2023-06-10 14:20:57 -04:00 committed by GitHub
commit 203961b045
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
173 changed files with 1181 additions and 13 deletions

View file

@ -554,7 +554,7 @@ options:
type: str
stack_type:
description:
- The IP stack type of the cluster, possible values: (STACK_TYPE_UNSPECIFIED, IPV4, IPV4_IPV6)
- 'The IP stack type of the cluster, possible values: (STACK_TYPE_UNSPECIFIED, IPV4, IPV4_IPV6)'
required: false
type: str
initial_cluster_version:
@ -633,7 +633,7 @@ options:
required: false
type: dict
suboptions:
datapath_provider:
datapath_provider:
description:
- The datapath provider selects the implementation of the Kubernetes networking model for service resolution and network policy enforcement.
required: false
@ -691,6 +691,7 @@ options:
- application
- machineaccount
- serviceaccount
- accesstoken
service_account_contents:
description:
- The contents of a Service Account JSON file, either in a dictionary or as a
@ -705,6 +706,10 @@ options:
- An optional service account email address if machineaccount is selected and
the user does not wish to use the default email.
type: str
access_token:
description:
- An OAuth2 access token if credential type is accesstoken.
type: str
scopes:
description:
- Array of scopes to be used
@ -1264,7 +1269,7 @@ ipAllocationPolicy:
type: str
stackType:
description:
- The IP stack type of the cluster, possible values: (STACK_TYPE_UNSPECIFIED, IPV4, IPV4_IPV6)
- 'The IP stack type of the cluster, possible values: (STACK_TYPE_UNSPECIFIED, IPV4, IPV4_IPV6)'
type: str
returned: success
endpoint:
@ -1588,7 +1593,14 @@ def main():
binary_authorization=dict(type='dict', options=dict(enabled=dict(type='bool'))),
release_channel=dict(type='dict', options=dict(channel=dict(type='str'))),
shielded_nodes=dict(type='dict', options=dict(enabled=dict(type='bool'))),
network_config=dict(type='dict', options=dict(enable_intra_node_visibility=dict(type='bool'), default_snat_status=dict(type='bool'), datapath_provider=dict(type='str'))),
network_config=dict(
type='dict',
options=dict(
enable_intra_node_visibility=dict(type='bool'),
default_snat_status=dict(type='bool'),
datapath_provider=dict(type='str'),
),
),
enable_kubernetes_alpha=dict(type='bool'),
location=dict(required=True, type='str', aliases=['zone']),
kubectl_path=dict(type='str'),
@ -2438,14 +2450,18 @@ class ClusterNetworkconfig(object):
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{u'enableIntraNodeVisibility': self.request.get('enable_intra_node_visibility'), u'defaultSnatStatus': self.request.get('default_snat_status'), u'datapathProvider': self.request.get('datapath_provider')}
)
return remove_nones_from_dict({
u'enableIntraNodeVisibility': self.request.get('enable_intra_node_visibility'),
u'defaultSnatStatus': self.request.get('default_snat_status'),
u'datapathProvider': self.request.get('datapath_provider'),
})
def from_response(self):
return remove_nones_from_dict(
{u'enableIntraNodeVisibility': self.request.get(u'enableIntraNodeVisibility'), u'defaultSnatStatus': self.request.get(u'defaultSnatStatus'), u'datapathProvider': self.request.get('datapath_provider') }
)
return remove_nones_from_dict({
u'enableIntraNodeVisibility': self.request.get(u'enableIntraNodeVisibility'),
u'defaultSnatStatus': self.request.get(u'defaultSnatStatus'),
u'datapathProvider': self.request.get('datapath_provider'),
})
if __name__ == '__main__':