Skip to content

Commit

Permalink
fix(VPCInstanceAuthenticator): use correct version string
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Adams <[email protected]>
  • Loading branch information
padamstx committed Jan 9, 2023
1 parent a86cdab commit 93729a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8

# Copyright 2021 IBM All Rights Reserved.
# Copyright 2021, 2023 IBM All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -52,7 +52,7 @@ class VPCInstanceTokenManager(JWTTokenManager):
url (str, optional): The VPC Instance Metadata Service's base endpoint URL.
"""

METADATA_SERVICE_VERSION = '2021-09-20'
METADATA_SERVICE_VERSION = '2022-03-01'
DEFAULT_IMS_ENDPOINT = 'http://169.254.169.254'
TOKEN_NAME = 'access_token'

Expand Down
8 changes: 4 additions & 4 deletions test/test_vpc_instance_token_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_retrieve_instance_identity_token(caplog):
assert responses.calls[0].request.headers['Content-Type'] == 'application/json'
assert responses.calls[0].request.headers['Accept'] == 'application/json'
assert responses.calls[0].request.headers['Metadata-Flavor'] == 'ibm'
assert responses.calls[0].request.params['version'] == '2021-09-20'
assert responses.calls[0].request.params['version'] == '2022-03-01'
assert responses.calls[0].request.body == '{"expires_in": 300}'
assert ii_token == TEST_TOKEN
# Check the logs.
Expand Down Expand Up @@ -145,7 +145,7 @@ def mock_retrieve_instance_identity_token():
assert responses.calls[0].request.headers['Accept'] == 'application/json'
assert responses.calls[0].request.headers['Authorization'] == 'Bearer ' + TEST_TOKEN
assert responses.calls[0].request.body == '{"trusted_profile": {"crn": "crn:iam-profile:123"}}'
assert responses.calls[0].request.params['version'] == '2021-09-20'
assert responses.calls[0].request.params['version'] == '2022-03-01'
# Check the logs.
# pylint: disable=line-too-long
assert (
Expand Down Expand Up @@ -183,7 +183,7 @@ def mock_retrieve_instance_identity_token():
assert responses.calls[0].request.headers['Accept'] == 'application/json'
assert responses.calls[0].request.headers['Authorization'] == 'Bearer ' + TEST_TOKEN
assert responses.calls[0].request.body == '{"trusted_profile": {"id": "iam-id-123"}}'
assert responses.calls[0].request.params['version'] == '2021-09-20'
assert responses.calls[0].request.params['version'] == '2022-03-01'
# Check the logs.
# pylint: disable=line-too-long
assert (
Expand Down Expand Up @@ -219,7 +219,7 @@ def mock_retrieve_instance_identity_token():
assert responses.calls[0].request.headers['Accept'] == 'application/json'
assert responses.calls[0].request.headers['Authorization'] == 'Bearer ' + TEST_TOKEN
assert responses.calls[0].request.body is None
assert responses.calls[0].request.params['version'] == '2021-09-20'
assert responses.calls[0].request.params['version'] == '2022-03-01'
# Check the logs.
# pylint: disable=line-too-long
assert (
Expand Down

0 comments on commit 93729a3

Please sign in to comment.