Skip to content

Commit 4c96416

Browse files
feat: [google-cloud-dataproc] Added support for the AuthenticationConfig field to Dataproc serverless workload configurations, allowing specification of the user workload identity as either the end user or a service account (#13549)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 729645002 Source-Link: googleapis/googleapis@d4da473 Source-Link: googleapis/googleapis-gen@74d5a52 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLy5Pd2xCb3QueWFtbCIsImgiOiI3NGQ1YTUyOTc1YTZmODAzMDQyMDk0ZTk1YzRmMGE0MjI2ZmE2NjY0In0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 8097512 commit 4c96416

File tree

10 files changed

+66
-3
lines changed

10 files changed

+66
-3
lines changed

packages/google-cloud-dataproc/google/cloud/dataproc/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
TerminateSessionRequest,
194194
)
195195
from google.cloud.dataproc_v1.types.shared import (
196+
AuthenticationConfig,
196197
AutotuningConfig,
197198
Component,
198199
EnvironmentConfig,
@@ -365,6 +366,7 @@
365366
"Session",
366367
"SparkConnectConfig",
367368
"TerminateSessionRequest",
369+
"AuthenticationConfig",
368370
"AutotuningConfig",
369371
"EnvironmentConfig",
370372
"ExecutionConfig",

packages/google-cloud-dataproc/google/cloud/dataproc/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "5.17.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dataproc/google/cloud/dataproc_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173
TerminateSessionRequest,
174174
)
175175
from .types.shared import (
176+
AuthenticationConfig,
176177
AutotuningConfig,
177178
Component,
178179
EnvironmentConfig,
@@ -226,6 +227,7 @@
226227
"SessionTemplateControllerAsyncClient",
227228
"WorkflowTemplateServiceAsyncClient",
228229
"AcceleratorConfig",
230+
"AuthenticationConfig",
229231
"AutoscalingConfig",
230232
"AutoscalingPolicy",
231233
"AutoscalingPolicyServiceClient",

packages/google-cloud-dataproc/google/cloud/dataproc_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "5.17.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-dataproc/google/cloud/dataproc_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
TerminateSessionRequest,
143143
)
144144
from .shared import (
145+
AuthenticationConfig,
145146
AutotuningConfig,
146147
Component,
147148
EnvironmentConfig,
@@ -298,6 +299,7 @@
298299
"Session",
299300
"SparkConnectConfig",
300301
"TerminateSessionRequest",
302+
"AuthenticationConfig",
301303
"AutotuningConfig",
302304
"EnvironmentConfig",
303305
"ExecutionConfig",

packages/google-cloud-dataproc/google/cloud/dataproc_v1/types/shared.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"KubernetesSoftwareConfig",
4040
"GkeNodePoolTarget",
4141
"GkeNodePoolConfig",
42+
"AuthenticationConfig",
4243
"AutotuningConfig",
4344
"RepositoryConfig",
4445
"PyPiRepositoryConfig",
@@ -270,6 +271,13 @@ class ExecutionConfig(proto.Message):
270271
project-level, per-location staging and temporary buckets.
271272
**This field requires a Cloud Storage bucket name, not a
272273
``gs://...`` URI to a Cloud Storage bucket.**
274+
authentication_config (google.cloud.dataproc_v1.types.AuthenticationConfig):
275+
Optional. Authentication configuration used
276+
to set the default identity for the workload
277+
execution. The config specifies the type of
278+
identity (service account or user) that will be
279+
used by workloads to access resources on the
280+
project(s).
273281
"""
274282

275283
service_account: str = proto.Field(
@@ -308,6 +316,11 @@ class ExecutionConfig(proto.Message):
308316
proto.STRING,
309317
number=10,
310318
)
319+
authentication_config: "AuthenticationConfig" = proto.Field(
320+
proto.MESSAGE,
321+
number=11,
322+
message="AuthenticationConfig",
323+
)
311324

312325

313326
class SparkHistoryServerConfig(proto.Message):
@@ -888,6 +901,46 @@ class GkeNodePoolAutoscalingConfig(proto.Message):
888901
)
889902

890903

904+
class AuthenticationConfig(proto.Message):
905+
r"""Authentication configuration for a workload is used to set
906+
the default identity for the workload execution.
907+
The config specifies the type of identity (service account or
908+
user) that will be used by workloads to access resources on the
909+
project(s).
910+
911+
Attributes:
912+
user_workload_authentication_type (google.cloud.dataproc_v1.types.AuthenticationConfig.AuthenticationType):
913+
Optional. Authentication type for the user
914+
workload running in containers.
915+
"""
916+
917+
class AuthenticationType(proto.Enum):
918+
r"""Authentication types for workload execution.
919+
920+
Values:
921+
AUTHENTICATION_TYPE_UNSPECIFIED (0):
922+
If AuthenticationType is unspecified then
923+
END_USER_CREDENTIALS is used for 3.0 and newer runtimes, and
924+
SERVICE_ACCOUNT is used for older runtimes.
925+
SERVICE_ACCOUNT (1):
926+
Use service account credentials for
927+
authenticating to other services.
928+
END_USER_CREDENTIALS (2):
929+
Use OAuth credentials associated with the
930+
workload creator/user for authenticating to
931+
other services.
932+
"""
933+
AUTHENTICATION_TYPE_UNSPECIFIED = 0
934+
SERVICE_ACCOUNT = 1
935+
END_USER_CREDENTIALS = 2
936+
937+
user_workload_authentication_type: AuthenticationType = proto.Field(
938+
proto.ENUM,
939+
number=1,
940+
enum=AuthenticationType,
941+
)
942+
943+
891944
class AutotuningConfig(proto.Message):
892945
r"""Autotuning configuration of the workload.
893946

packages/google-cloud-dataproc/samples/generated_samples/snippet_metadata_google.cloud.dataproc.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-dataproc",
11-
"version": "5.17.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-dataproc/tests/unit/gapic/dataproc_v1/test_batch_controller.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3906,6 +3906,7 @@ def test_create_batch_rest_call_success(request_type):
39063906
"idle_ttl": {"seconds": 751, "nanos": 543},
39073907
"ttl": {},
39083908
"staging_bucket": "staging_bucket_value",
3909+
"authentication_config": {"user_workload_authentication_type": 1},
39093910
},
39103911
"peripherals_config": {
39113912
"metastore_service": "metastore_service_value",

packages/google-cloud-dataproc/tests/unit/gapic/dataproc_v1/test_session_controller.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4512,6 +4512,7 @@ def test_create_session_rest_call_success(request_type):
45124512
"idle_ttl": {"seconds": 751, "nanos": 543},
45134513
"ttl": {},
45144514
"staging_bucket": "staging_bucket_value",
4515+
"authentication_config": {"user_workload_authentication_type": 1},
45154516
},
45164517
"peripherals_config": {
45174518
"metastore_service": "metastore_service_value",

packages/google-cloud-dataproc/tests/unit/gapic/dataproc_v1/test_session_template_controller.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4607,6 +4607,7 @@ def test_create_session_template_rest_call_success(request_type):
46074607
"idle_ttl": {"seconds": 751, "nanos": 543},
46084608
"ttl": {},
46094609
"staging_bucket": "staging_bucket_value",
4610+
"authentication_config": {"user_workload_authentication_type": 1},
46104611
},
46114612
"peripherals_config": {
46124613
"metastore_service": "metastore_service_value",
@@ -4861,6 +4862,7 @@ def test_update_session_template_rest_call_success(request_type):
48614862
"idle_ttl": {"seconds": 751, "nanos": 543},
48624863
"ttl": {},
48634864
"staging_bucket": "staging_bucket_value",
4865+
"authentication_config": {"user_workload_authentication_type": 1},
48644866
},
48654867
"peripherals_config": {
48664868
"metastore_service": "metastore_service_value",

0 commit comments

Comments
 (0)