leo_s3_auth¶
The authentication API for S3-API.
References
Description¶
The authentication API for S3-API
Function Index¶
authenticate/3 | Authenticate. |
bulk_put/1 | Add credentials. |
checksum/0 | Retrieve checksum of the table. |
create_key/1 | Generate access-key-id and secret-access-key. |
create_table/2 | Create credential table(mnesia). |
find_all/0 | Retrieve all records. |
get_credential/1 | Retrieve a credential from internal-db. |
get_signature/2 | Get AWS signature version 2. |
has_credential/1 | Has a credential into the master-nodes?. |
has_credential/2 | |
put/1 | Add a credential (an authentication). |
start/2 | Launch or create Mnesia/ETS. |
update_providers/1 | update_providers(slave only). |
Function Details¶
authenticate/3¶
authenticate(Authorization, SignParams, IsCreateBucketOp) -> {ok, binary()} | {error, any()}
- Authorization = binary()
- SignParams = #sign_params{}
- IsCreateBucketOp = boolean()
Authenticate
checksum/0¶
Retrieve checksum of the table
create_key/1¶
create_key(UserId) -> {ok, [tuple()]} | {error, any()}
- UserId = binary()
Generate access-key-id and secret-access-key
create_table/2¶
create_table(Mode, Nodes) -> ok
- Mode = ram_copies | disc_copies
- Nodes = [atom()]
Create credential table(mnesia)
get_credential/1¶
get_credential(AccessKeyId) -> {ok, #credential{}} | not_found | {error, any()}
- AccessKeyId = binary()
Retrieve a credential from internal-db
get_signature/2¶
get_signature(SecretAccessKey, SignParams) -> binary()
- SecretAccessKey = binary()
- SignParams = #sign_params{}
Get AWS signature version 2
has_credential/1¶
has_credential(AccessKeyId) -> boolean()
- AccessKeyId = binary()
Has a credential into the master-nodes?
has_credential/2¶
has_credential(MasterNodes, AccessKey) -> boolean()
- MasterNodes = [atom()]
- AccessKey = binary()
put/1¶
put(Credential) -> ok | {error, any()}
- Credential = #credential{}
Add a credential (an authentication)
start/2¶
start(Role, Providers) -> ok
- Role = master | slave
- Providers = [atom()]
Launch or create Mnesia/ETS
update_providers/1¶
update_providers(Providers) -> ok
- Providers = [atom()]
update_providers(slave only)