Skip to content

Commit 48c5f38

Browse files
authored
fix: deprecate credentials_file (#2454)
1 parent e6d3b0c commit 48c5f38

File tree

42 files changed

+174
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+174
-108
lines changed

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/base.py.j2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ class {{ service.name }}Transport(abc.ABC):
8989
credentials identify the application to the service; if none
9090
are specified, the client will attempt to ascertain the
9191
credentials from the environment.
92-
credentials_file (Optional[str]): A file with credentials that can
92+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
9393
be loaded with :func:`google.auth.load_credentials_from_file`.
94-
This argument is mutually exclusive with credentials.
94+
This argument is mutually exclusive with credentials. This argument will be
95+
removed in the next major version of this library.
9596
scopes (Optional[Sequence[str]]): A list of scopes.
9697
quota_project_id (Optional[str]): An optional project to use for billing
9798
and quota.

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc.py.j2

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
135135
are specified, the client will attempt to ascertain the
136136
credentials from the environment.
137137
This argument is ignored if a ``channel`` instance is provided.
138-
credentials_file (Optional[str]): A file with credentials that can
138+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
139139
be loaded with :func:`google.auth.load_credentials_from_file`.
140140
This argument is ignored if a ``channel`` instance is provided.
141+
This argument will be removed in the next major version of this library.
141142
scopes (Optional(Sequence[str])): A list of scopes. This argument is
142143
ignored if a ``channel`` instance is provided.
143144
channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]):
@@ -270,9 +271,10 @@ class {{ service.name }}GrpcTransport({{ service.name }}Transport):
270271
credentials identify this application to the service. If
271272
none are specified, the client will attempt to ascertain
272273
the credentials from the environment.
273-
credentials_file (Optional[str]): A file with credentials that can
274+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
274275
be loaded with :func:`google.auth.load_credentials_from_file`.
275-
This argument is mutually exclusive with credentials.
276+
This argument is mutually exclusive with credentials. This argument will be
277+
removed in the next major version of this library.
276278
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
277279
service. These are only used when credentials are not specified and
278280
are passed to :func:`google.auth.default`.

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/grpc_asyncio.py.j2

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ class {{ service.grpc_asyncio_transport_name }}({{ service.name }}Transport):
132132
credentials identify this application to the service. If
133133
none are specified, the client will attempt to ascertain
134134
the credentials from the environment.
135-
credentials_file (Optional[str]): A file with credentials that can
136-
be loaded with :func:`google.auth.load_credentials_from_file`.
135+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
136+
be loaded with :func:`google.auth.load_credentials_from_file`. This argument will be
137+
removed in the next major version of this library.
137138
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
138139
service. These are only used when credentials are not specified and
139140
are passed to :func:`google.auth.default`.
@@ -182,9 +183,10 @@ class {{ service.grpc_asyncio_transport_name }}({{ service.name }}Transport):
182183
are specified, the client will attempt to ascertain the
183184
credentials from the environment.
184185
This argument is ignored if a ``channel`` instance is provided.
185-
credentials_file (Optional[str]): A file with credentials that can
186+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
186187
be loaded with :func:`google.auth.load_credentials_from_file`.
187188
This argument is ignored if a ``channel`` instance is provided.
189+
This argument will be removed in the next major version of this library.
188190
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
189191
service. These are only used when credentials are not specified and
190192
are passed to :func:`google.auth.default`.

gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ class {{service.name}}RestTransport(_Base{{ service.name }}RestTransport):
114114
are specified, the client will attempt to ascertain the
115115
credentials from the environment.
116116

117-
credentials_file (Optional[str]): A file with credentials that can
117+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
118118
be loaded with :func:`google.auth.load_credentials_from_file`.
119-
This argument is ignored if ``channel`` is provided.
119+
This argument is ignored if ``channel`` is provided. This argument will be
120+
removed in the next major version of this library.
120121
scopes (Optional(Sequence[str])): A list of scopes. This argument is
121122
ignored if ``channel`` is provided.
122123
client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ def __init__(
6969
credentials identify the application to the service; if none
7070
are specified, the client will attempt to ascertain the
7171
credentials from the environment.
72-
credentials_file (Optional[str]): A file with credentials that can
72+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
7373
be loaded with :func:`google.auth.load_credentials_from_file`.
74-
This argument is mutually exclusive with credentials.
74+
This argument is mutually exclusive with credentials. This argument will be
75+
removed in the next major version of this library.
7576
scopes (Optional[Sequence[str]]): A list of scopes.
7677
quota_project_id (Optional[str]): An optional project to use for billing
7778
and quota.

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/grpc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ def __init__(self, *,
144144
are specified, the client will attempt to ascertain the
145145
credentials from the environment.
146146
This argument is ignored if a ``channel`` instance is provided.
147-
credentials_file (Optional[str]): A file with credentials that can
147+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
148148
be loaded with :func:`google.auth.load_credentials_from_file`.
149149
This argument is ignored if a ``channel`` instance is provided.
150+
This argument will be removed in the next major version of this library.
150151
scopes (Optional(Sequence[str])): A list of scopes. This argument is
151152
ignored if a ``channel`` instance is provided.
152153
channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]):
@@ -276,9 +277,10 @@ def create_channel(cls,
276277
credentials identify this application to the service. If
277278
none are specified, the client will attempt to ascertain
278279
the credentials from the environment.
279-
credentials_file (Optional[str]): A file with credentials that can
280+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
280281
be loaded with :func:`google.auth.load_credentials_from_file`.
281-
This argument is mutually exclusive with credentials.
282+
This argument is mutually exclusive with credentials. This argument will be
283+
removed in the next major version of this library.
282284
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
283285
service. These are only used when credentials are not specified and
284286
are passed to :func:`google.auth.default`.

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/grpc_asyncio.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ def create_channel(cls,
140140
credentials identify this application to the service. If
141141
none are specified, the client will attempt to ascertain
142142
the credentials from the environment.
143-
credentials_file (Optional[str]): A file with credentials that can
144-
be loaded with :func:`google.auth.load_credentials_from_file`.
143+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
144+
be loaded with :func:`google.auth.load_credentials_from_file`. This argument will be
145+
removed in the next major version of this library.
145146
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
146147
service. These are only used when credentials are not specified and
147148
are passed to :func:`google.auth.default`.
@@ -190,9 +191,10 @@ def __init__(self, *,
190191
are specified, the client will attempt to ascertain the
191192
credentials from the environment.
192193
This argument is ignored if a ``channel`` instance is provided.
193-
credentials_file (Optional[str]): A file with credentials that can
194+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
194195
be loaded with :func:`google.auth.load_credentials_from_file`.
195196
This argument is ignored if a ``channel`` instance is provided.
197+
This argument will be removed in the next major version of this library.
196198
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
197199
service. These are only used when credentials are not specified and
198200
are passed to :func:`google.auth.default`.

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/rest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,9 +1103,10 @@ def __init__(self, *,
11031103
are specified, the client will attempt to ascertain the
11041104
credentials from the environment.
11051105
1106-
credentials_file (Optional[str]): A file with credentials that can
1106+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
11071107
be loaded with :func:`google.auth.load_credentials_from_file`.
1108-
This argument is ignored if ``channel`` is provided.
1108+
This argument is ignored if ``channel`` is provided. This argument will be
1109+
removed in the next major version of this library.
11091110
scopes (Optional(Sequence[str])): A list of scopes. This argument is
11101111
ignored if ``channel`` is provided.
11111112
client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client

tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/transports/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ def __init__(
6666
credentials identify the application to the service; if none
6767
are specified, the client will attempt to ascertain the
6868
credentials from the environment.
69-
credentials_file (Optional[str]): A file with credentials that can
69+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
7070
be loaded with :func:`google.auth.load_credentials_from_file`.
71-
This argument is mutually exclusive with credentials.
71+
This argument is mutually exclusive with credentials. This argument will be
72+
removed in the next major version of this library.
7273
scopes (Optional[Sequence[str]]): A list of scopes.
7374
quota_project_id (Optional[str]): An optional project to use for billing
7475
and quota.

tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/transports/grpc.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,10 @@ def __init__(self, *,
150150
are specified, the client will attempt to ascertain the
151151
credentials from the environment.
152152
This argument is ignored if a ``channel`` instance is provided.
153-
credentials_file (Optional[str]): A file with credentials that can
153+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
154154
be loaded with :func:`google.auth.load_credentials_from_file`.
155155
This argument is ignored if a ``channel`` instance is provided.
156+
This argument will be removed in the next major version of this library.
156157
scopes (Optional(Sequence[str])): A list of scopes. This argument is
157158
ignored if a ``channel`` instance is provided.
158159
channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]):
@@ -281,9 +282,10 @@ def create_channel(cls,
281282
credentials identify this application to the service. If
282283
none are specified, the client will attempt to ascertain
283284
the credentials from the environment.
284-
credentials_file (Optional[str]): A file with credentials that can
285+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
285286
be loaded with :func:`google.auth.load_credentials_from_file`.
286-
This argument is mutually exclusive with credentials.
287+
This argument is mutually exclusive with credentials. This argument will be
288+
removed in the next major version of this library.
287289
scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
288290
service. These are only used when credentials are not specified and
289291
are passed to :func:`google.auth.default`.

0 commit comments

Comments
 (0)