Commit b0dc00bb authored by Shiting Long's avatar Shiting Long
Browse files

add accessibility check for setting OS token through cloud storage urls

parent ad282dbd
Pipeline #3938199 failed with stages
in 1 minute and 33 seconds
......@@ -160,6 +160,11 @@ class SwiftConnector(Connector):
cred["os_token"],
cred["project_id"])
if cloud_credential:
cloud_storage = Session.query(CloudStorage).get('SWIFT:' + parsed.hostname)
if not swiftauth.verified_swift_project_user(cloud_storage, cloud_credential):
raise BadRequest(
"Cloud user does not have access to the required Swift project"
)
try:
Session.merge(CloudCredentialCache(**cloud_credential))
Session.commit()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment