EOX GitLab Instance
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESA
PRISM
VS
Commits
709f0634
Commit
709f0634
authored
4 years ago
by
Fabian Schindler
Browse files
Options
Downloads
Patches
Plain Diff
Allow to switch off S3 bucket name validation
parent
b13a12cf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!55
Production release 1.2.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/registrar/source.py
+13
-2
13 additions, 2 deletions
core/registrar/source.py
with
13 additions
and
2 deletions
core/registrar/source.py
+
13
−
2
View file @
709f0634
...
...
@@ -6,6 +6,10 @@ from fnmatch import fnmatch
import
logging
import
boto3
import
boto3.session
import
botocore.session
import
botocore.handlers
from
swiftclient.multithreading
import
OutputManager
from
swiftclient.service
import
SwiftError
,
SwiftService
...
...
@@ -132,7 +136,8 @@ class SwiftSource(Source):
class
S3Source
(
Source
):
def
__init__
(
self
,
name
=
None
,
bucket_name
=
None
,
secret_access_key
=
None
,
access_key_id
=
None
,
endpoint_url
=
None
,
strip_bucket
=
True
,
**
client_kwargs
):
def
__init__
(
self
,
name
=
None
,
bucket_name
=
None
,
secret_access_key
=
None
,
access_key_id
=
None
,
endpoint_url
=
None
,
strip_bucket
=
True
,
validate_bucket_name
=
True
,
**
client_kwargs
):
super
().
__init__
(
name
)
# see https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html#boto3.session.Session.client
...
...
@@ -143,7 +148,13 @@ class S3Source(Source):
self
.
endpoint_url
=
endpoint_url
self
.
strip_bucket
=
strip_bucket
self
.
client
=
boto3
.
client
(
botocore_session
=
botocore
.
session
.
Session
()
if
not
validate_bucket_name
:
botocore_session
.
unregister
(
'
before-parameter-build.s3
'
,
botocore
.
handlers
.
validate_bucket_name
)
session
=
boto3
.
session
.
Session
(
botocore_session
=
botocore_session
)
self
.
client
=
session
.
client
(
'
s3
'
,
aws_secret_access_key
=
secret_access_key
,
aws_access_key_id
=
access_key_id
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment