Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AUTH_VERSION and OS_OPTIONS to Swift backend #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rclement
Copy link
Contributor

When using the Swift backend with some provider, some more options might be required.
For instance, when using OVH Object Storage service, OpenStack Swift Authentication v2 is required along with specifying the region name.

This PR allows to further configure the swiftclient library using optional variables:

  • AUTH_VERSION: The OpenStack auth version (optional, default: "1")
  • OS_OPTIONS: The OpenStack options as a dictionary with keys such as region_name (optional, default: None)

When configuring flask-fs, the flask user config for the Swift backend can look like:

    FS_SWIFT_AUTHURL = os.environ.get('SWIFT_AUTHURL')
    FS_SWIFT_AUTH_VERSION = os.environ.get('SWIFT_AUTH_VERSION')
    FS_SWIFT_OS_OPTIONS = {
        'region_name': os.environ.get('SWIFT_REGION_NAME')
    }
    FS_SWIFT_USER = os.environ.get('SWIFT_USER')
    FS_SWIFT_KEY = os.environ.get('SWIFT_KEY')
    FS_SWIFT_URL = os.environ.get('SWIFT_URL')

I did not add some more tests for the Swift backend as I currently do not know how to test these options with the used Docker image morrisjobke/docker-swift-onlyone.
However, I tested it successfully with a production-grade web-service.

Let me know if there is anything I can to make this better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant