Skip to content

Commit 376073b

Browse files
authored
Merge branch 'main' into onboard-to-librarian
2 parents 6933ac6 + 2f8826d commit 376073b

File tree

5 files changed

+31
-1
lines changed

5 files changed

+31
-1
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44

55
[1]: https://pypi.org/project/google-auth/#history
66

7+
## [2.42.0](https://github.com/googleapis/google-auth-library-python/compare/v2.41.1...v2.42.0) (2025-10-24)
8+
9+
10+
### Features
11+
12+
* Add trust boundary support for external accounts. ([#1809](https://github.com/googleapis/google-auth-library-python/issues/1809)) ([36ecb1d](https://github.com/googleapis/google-auth-library-python/commit/36ecb1d65883477d27faf9c2281fc289659b9903))
13+
14+
15+
### Bug Fixes
16+
17+
* Read scopes from ADC json for impersoanted cred ([#1820](https://github.com/googleapis/google-auth-library-python/issues/1820)) ([62c0fc8](https://github.com/googleapis/google-auth-library-python/commit/62c0fc82a3625542381f85c698595446fc99ddae))
18+
719
## [2.41.1](https://github.com/googleapis/google-auth-library-python/compare/v2.41.0...v2.41.1) (2025-09-30)
820

921

google/auth/impersonated_credentials.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ def from_impersonated_service_account_info(cls, info, scopes=None):
526526
target_principal = impersonation_url[start_index + 1 : end_index]
527527
delegates = info.get("delegates")
528528
quota_project_id = info.get("quota_project_id")
529+
scopes = scopes or info.get("scopes")
529530
trust_boundary = info.get("trust_boundary")
530531

531532
return cls(

google/auth/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "2.41.1"
15+
__version__ = "2.42.0"

system_tests/secrets.tar.enc

0 Bytes
Binary file not shown.

tests/test_impersonated_credentials.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,23 @@ def test_from_impersonated_service_account_info_with_invalid_impersonation_url(
213213
)
214214
assert excinfo.match(r"Cannot extract target principal from")
215215

216+
def test_from_impersonated_service_account_info_with_scopes(self):
217+
info = copy.deepcopy(IMPERSONATED_SERVICE_ACCOUNT_AUTHORIZED_USER_SOURCE_INFO)
218+
info["scopes"] = ["scope1", "scope2"]
219+
credentials = impersonated_credentials.Credentials.from_impersonated_service_account_info(
220+
info
221+
)
222+
assert credentials._target_scopes == ["scope1", "scope2"]
223+
224+
def test_from_impersonated_service_account_info_with_scopes_param(self):
225+
info = copy.deepcopy(IMPERSONATED_SERVICE_ACCOUNT_AUTHORIZED_USER_SOURCE_INFO)
226+
info["scopes"] = ["scope_from_info_1", "scope_from_info_2"]
227+
scopes_param = ["scope_from_param_1", "scope_from_param_2"]
228+
credentials = impersonated_credentials.Credentials.from_impersonated_service_account_info(
229+
info, scopes=scopes_param
230+
)
231+
assert credentials._target_scopes == scopes_param
232+
216233
def test_get_cred_info(self):
217234
credentials = self.make_credentials()
218235
assert not credentials.get_cred_info()

0 commit comments

Comments
 (0)