IPWorks Cloud 2020 Python Edition

Questions / Feedback?

create_app_key Method

Creates a new application key.

Syntax

def create_app_key(key_name: str, capabilities: str, allowed_bucket_id: str, allowed_prefix: str, validity_duration: int) -> str: ...

Remarks

This method creates a new application key named KeyName with the specified Capabilities. If successful, this method returns a string containing the newly-created application key's Id, followed by the key itself, separated by a newline (\n) character; for example:

[application_key_id]
[application_key]
Important: This is the only time that the application key's key string will be returned, be sure to save it immediately. It is not present in the results returned by the list_app_keys method (this is a security feature enforced by the server).

The string passed for Capabilities must be formatted as a comma-separated list of one or more of the following:

Capability String Related Methods
deleteBuckets delete_bucket
deleteFiles delete_file, delete_file_version
deleteKeys delete_app_key
listBuckets get_bucket_info, list_buckets
listFiles delete_file, list_files, list_file_versions, list_multipart_uploads
listKeys list_app_keys
readFiles copy_file, copy_part, download_file, download_file_by_id, get_file_info
shareFiles get_download_auth_token
writeBuckets create_bucket, update_bucket
writeFiles abort_multipart_upload, complete_multipart_upload, copy_file, copy_part, hide_file, list_parts, start_multipart_upload, upload_file, upload_part
writeKeys create_app_key

To restrict the new application key to a specific bucket, pass the bucket's Id for AllowedBucketId. To further restrict it to files with a specific prefix within that bucket, pass said prefix for AllowedPrefix. It is not possible to apply a prefix restriction without a bucket restriction.

The ValidityDuration parameter specifies how many seconds the new application key will be valid for. The maximum valid value is 86400000 (1000 days); values less than 1 will cause the application key to remain valid indefinitely.

The currently-authenticated application key must have the writeKeys capability to call this method successfully, otherwise the server will return an error. Refer to the account_capabilities property for more information.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Python Edition - Version 20.0 [Build 8265]