Skip to content

Commit 4dd28f7

Browse files
Merge branch 'develop' into 'update-v2'
2 parents 5ea3829 + fc86f8b commit 4dd28f7

File tree

5 files changed

+138
-3
lines changed

5 files changed

+138
-3
lines changed

.changes/1.27.90.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[
2+
{
3+
"category": "``codeartifact login``",
4+
"description": "Prevent AWS CodeArtifact login command from hanging unexpectedly.",
5+
"type": "bugfix"
6+
},
7+
{
8+
"category": "``appintegrations``",
9+
"description": "Adds FileConfiguration to Amazon AppIntegrations CreateDataIntegration supporting scheduled downloading of third party files into Amazon Connect from sources such as Microsoft SharePoint.",
10+
"type": "api-change"
11+
},
12+
{
13+
"category": "``lakeformation``",
14+
"description": "This release updates the documentation regarding Get/Update DataCellsFilter",
15+
"type": "api-change"
16+
},
17+
{
18+
"category": "``s3control``",
19+
"description": "Added support for cross-account Multi-Region Access Points. Added support for S3 Replication for S3 on Outposts.",
20+
"type": "api-change"
21+
},
22+
{
23+
"category": "``tnb``",
24+
"description": "This release adds tagging support to the following Network Instance APIs : Instantiate, Update, Terminate.",
25+
"type": "api-change"
26+
},
27+
{
28+
"category": "``wisdom``",
29+
"description": "This release extends Wisdom CreateKnowledgeBase API to support SharePoint connector type by removing the @required trait for objectField",
30+
"type": "api-change"
31+
}
32+
]

.changes/1.27.91.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[
2+
{
3+
"category": "``application-autoscaling``",
4+
"description": "Application Auto Scaling customers can now use mathematical functions to customize the metric used with Target Tracking policies within the policy configuration itself, saving the cost and effort of publishing the customizations as a separate metric.",
5+
"type": "api-change"
6+
},
7+
{
8+
"category": "``dataexchange``",
9+
"description": "This release enables data providers to license direct access to S3 objects encrypted with Customer Managed Keys (CMK) in AWS KMS through AWS Data Exchange. Subscribers can use these keys to decrypt, then use the encrypted S3 objects shared with them, without creating or managing copies.",
10+
"type": "api-change"
11+
},
12+
{
13+
"category": "``directconnect``",
14+
"description": "describe-direct-connect-gateway-associations includes a new status, updating, indicating that the association is currently in-process of updating.",
15+
"type": "api-change"
16+
},
17+
{
18+
"category": "``ec2``",
19+
"description": "This release adds a new DnsOptions key (PrivateDnsOnlyForInboundResolverEndpoint) to CreateVpcEndpoint and ModifyVpcEndpoint APIs.",
20+
"type": "api-change"
21+
},
22+
{
23+
"category": "``iam``",
24+
"description": "Documentation only updates to correct customer-reported issues",
25+
"type": "api-change"
26+
},
27+
{
28+
"category": "``keyspaces``",
29+
"description": "Adding support for client-side timestamps",
30+
"type": "api-change"
31+
}
32+
]

CHANGELOG.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5024,6 +5024,28 @@ CHANGELOG
50245024
* feature:wizard: Added support for AWS CLI Wizards. See `#3752 <https://github.com/aws/aws-cli/issues/3752>`__.
50255025

50265026

5027+
1.27.91
5028+
=======
5029+
5030+
* api-change:``application-autoscaling``: Application Auto Scaling customers can now use mathematical functions to customize the metric used with Target Tracking policies within the policy configuration itself, saving the cost and effort of publishing the customizations as a separate metric.
5031+
* api-change:``dataexchange``: This release enables data providers to license direct access to S3 objects encrypted with Customer Managed Keys (CMK) in AWS KMS through AWS Data Exchange. Subscribers can use these keys to decrypt, then use the encrypted S3 objects shared with them, without creating or managing copies.
5032+
* api-change:``directconnect``: describe-direct-connect-gateway-associations includes a new status, updating, indicating that the association is currently in-process of updating.
5033+
* api-change:``ec2``: This release adds a new DnsOptions key (PrivateDnsOnlyForInboundResolverEndpoint) to CreateVpcEndpoint and ModifyVpcEndpoint APIs.
5034+
* api-change:``iam``: Documentation only updates to correct customer-reported issues
5035+
* api-change:``keyspaces``: Adding support for client-side timestamps
5036+
5037+
5038+
1.27.90
5039+
=======
5040+
5041+
* bugfix:``codeartifact login``: Prevent AWS CodeArtifact login command from hanging unexpectedly.
5042+
* api-change:``appintegrations``: Adds FileConfiguration to Amazon AppIntegrations CreateDataIntegration supporting scheduled downloading of third party files into Amazon Connect from sources such as Microsoft SharePoint.
5043+
* api-change:``lakeformation``: This release updates the documentation regarding Get/Update DataCellsFilter
5044+
* api-change:``s3control``: Added support for cross-account Multi-Region Access Points. Added support for S3 Replication for S3 on Outposts.
5045+
* api-change:``tnb``: This release adds tagging support to the following Network Instance APIs : Instantiate, Update, Terminate.
5046+
* api-change:``wisdom``: This release extends Wisdom CreateKnowledgeBase API to support SharePoint connector type by removing the @required trait for objectField
5047+
5048+
50275049
1.27.89
50285050
=======
50295051

awscli/customizations/codeartifact/login.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class NuGetBaseLogin(BaseLogin):
124124
_SOURCE_UPDATED_MESSAGE = 'Updated source %s in the NuGet.Config\n'
125125
# Example line the below regex should match:
126126
# 1. nuget.org [Enabled]
127-
_SOURCE_REGEX = re.compile(r'^\d+\.\s+(?P<source_name>.*)\s+\[.*\]')
127+
_SOURCE_REGEX = re.compile(r'^\d+\.\s(?P<source_name>.+)\s\[.*\]')
128128

129129
def login(self, dry_run=False):
130130
try:
@@ -205,7 +205,7 @@ def _get_source_to_url_dict(self):
205205
for i in range(len(lines)):
206206
result = self._SOURCE_REGEX.match(lines[i].strip())
207207
if result:
208-
source_to_url_dict[result["source_name"]] = \
208+
source_to_url_dict[result["source_name"].strip()] = \
209209
lines[i + 1].strip()
210210

211211
return source_to_url_dict

tests/unit/customizations/codeartifact/test_adapter_login.py

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import errno
22
import os
3+
import signal
34
import subprocess
45

56
from datetime import datetime
@@ -9,7 +10,7 @@
910
from configparser import RawConfigParser
1011
from urllib.parse import urlsplit
1112

12-
from awscli.testutils import unittest, mock, FileCreator
13+
from awscli.testutils import unittest, mock, FileCreator, skip_if_windows
1314
from awscli.customizations.codeartifact.login import (
1415
BaseLogin, NuGetLogin, DotNetLogin, NpmLogin, PipLogin, TwineLogin,
1516
get_relative_expiration_time
@@ -67,6 +68,10 @@ def test_run_commands_unhandled_error(self):
6768
self.test_subject._run_commands(tool, ['echo', tool])
6869

6970

71+
def handle_timeout(signum, frame, test_name):
72+
raise TimeoutError(f"{test_name} timed out!!")
73+
74+
7075
class TestNuGetLogin(unittest.TestCase):
7176
_NUGET_INDEX_URL_FMT = NuGetLogin._NUGET_INDEX_URL_FMT
7277
_NUGET_SOURCES_LIST_RESPONSE = b"""\
@@ -76,6 +81,8 @@ class TestNuGetLogin(unittest.TestCase):
7681
2. Ab[.d7 $#!], [Disabled]
7782
https://source2.com/index.json"""
7883

84+
_NUGET_SOURCES_LIST_RESPONSE_BACKTRACKING = b'1.' + b' ' * 10000 + b'a'
85+
7986
_NUGET_SOURCES_LIST_RESPONSE_WITH_SPACE = b"""\
8087
Registered Sources:
8188
@@ -234,6 +241,21 @@ def test_login_nuget_not_installed(self):
234241
'nuget was not found. Please verify installation.'):
235242
self.test_subject.login()
236243

244+
@skip_if_windows("Windows does not support signal.SIGALRM.")
245+
def test_login_nuget_sources_listed_with_backtracking(self):
246+
self.subprocess_utils.check_output.return_value = \
247+
self._NUGET_SOURCES_LIST_RESPONSE_BACKTRACKING
248+
signal.signal(
249+
signal.SIGALRM,
250+
lambda signum, frame: handle_timeout(signum, frame, self.id()))
251+
signal.alarm(10)
252+
self.test_subject.login()
253+
signal.alarm(0)
254+
self.subprocess_utils.check_output.assert_any_call(
255+
self.list_operation_command,
256+
stderr=self.subprocess_utils.PIPE
257+
)
258+
237259

238260
class TestDotNetLogin(unittest.TestCase):
239261
_NUGET_INDEX_URL_FMT = NuGetLogin._NUGET_INDEX_URL_FMT
@@ -244,6 +266,8 @@ class TestDotNetLogin(unittest.TestCase):
244266
2. Ab[.d7 $#!], [Disabled]
245267
https://source2.com/index.json"""
246268

269+
_NUGET_SOURCES_LIST_RESPONSE_BACKTRACKING = b'1.' + b' ' * 10000 + b'a'
270+
247271
_NUGET_SOURCES_LIST_RESPONSE_WITH_EXTRA_NON_LIST_TEXT = b"""\
248272
Welcome to dotnet 2.0!
249273
@@ -388,6 +412,31 @@ def test_login_sources_listed_with_extra_non_list_text_dry_run(self):
388412
stderr=self.subprocess_utils.PIPE
389413
)
390414

415+
416+
@skip_if_windows("Windows does not support signal.SIGALRM.")
417+
@mock.patch('awscli.customizations.codeartifact.login.is_windows', False)
418+
def test_login_dotnet_sources_listed_with_backtracking(self):
419+
self.subprocess_utils.check_output.return_value = \
420+
self._NUGET_SOURCES_LIST_RESPONSE_BACKTRACKING
421+
signal.signal(
422+
signal.SIGALRM,
423+
lambda signum, frame: handle_timeout(signum, frame, self.id()))
424+
signal.alarm(10)
425+
self.test_subject.login()
426+
signal.alarm(0)
427+
428+
@skip_if_windows("Windows does not support signal.SIGALRM.")
429+
@mock.patch('awscli.customizations.codeartifact.login.is_windows', True)
430+
def test_login_dotnet_sources_listed_with_backtracking_windows(self):
431+
self.subprocess_utils.check_output.return_value = \
432+
self._NUGET_SOURCES_LIST_RESPONSE_BACKTRACKING
433+
signal.signal(
434+
signal.SIGALRM,
435+
lambda signum, frame: handle_timeout(signum, frame, self.id()))
436+
signal.alarm(10)
437+
self.test_subject.login()
438+
signal.alarm(0)
439+
391440
@mock.patch('awscli.customizations.codeartifact.login.is_windows', False)
392441
def test_login_source_name_already_exists(self):
393442
list_response = 'Registered Sources:\n' \

0 commit comments

Comments
 (0)