s3auth.middleware¶
-
class
s3auth.middleware.S3Auth(app, conf)¶ -
handle_auth_api(req)¶ Decide which handler to use for auth API request.
Path method handler /.prep POST handle_prep()/access_key/<access_key> DELETE handle_delete_access_key()/access_key/<access_key> GET handle_get_access_key()/access_key/<access_key> PUT handle_put_access_key()/access_key/ GET handle_get_listing()/change_secret_key/<access_key> POST handle_change_secret_key()Note: All paths have to be prefixed by /<auth_prefix>/v1
-
handle_change_secret_key(req, access_key)¶ Change current secret key for given access key.
- Required headers:
- x-s3auth-secret-key-old: must match current secret key
- x-s3auth-secret-key-new: the new secret key
-
handle_delete_access_key(**kwargs)¶ Delete access key.
- Required headers:
- x-s3auth-admin-key: admin key
-
handle_get_access_key(**kwargs)¶ Get auth details of access key.
- Required headers:
- x-s3auth-admin-key: admin key
Returns: JSON: {“secret_key”: secret_key, “account”: account}
-
handle_get_listing(**kwargs)¶ Retrieve a new-line separated list of all access keys.
- Required headers:
- x-s3auth-admin-key: admin key
-
handle_prep(req)¶ Prepare the backing store Swiftcluster for use with the auth system.
- Required headers:
- x-s3auth-prep-key: must be same as key in config
- x-s3auth-hash-key: hash key used for hashing admin key
- x-s3auth-admin-key: admin key
Note: The call can also be used to change current s3auth-admin key.
-
handle_put_access_key(**kwargs)¶ Create auth details of access key.
- Required headers:
- x-s3auth-secret-key: secret key to store
- x-s3auth-account: account to store
- x-s3auth-admin-key: admin key
-
-
s3auth.middleware.filter_factory(global_conf, **local_conf)¶ Returns a WSGI filter app for use with paste.deploy.