Class: Secret::Item
- Inherits:
-
Gio::DBusProxy
- Object
- Gio::DBusProxy
- Secret::Item
- Defined in:
- (unknown)
Overview
The class for Secret::Item.
Class Method Summary collapse
-
.create(collection, schema, attributes, label, value, flags, cancellable, callback, user_data) ⇒ nil
Create a new item in the secret service.
-
.create_finish(result) ⇒ Secret::Item
Finish operation to create a new item in the secret service.
-
.create_sync(collection, schema, attributes, label, value, flags, cancellable) ⇒ Secret::Item
Create a new item in the secret service.
-
.load_secrets(items, cancellable, callback, user_data) ⇒ nil
Load the secret values for a secret item stored in the service.
-
.load_secrets_finish(result) ⇒ Boolean
Complete asynchronous operation to load the secret values for secret items stored in the service.
-
.load_secrets_sync(items, cancellable) ⇒ Boolean
Load the secret values for a secret item stored in the service.
-
.new_for_dbus_path(service, item_path, flags, cancellable, callback, user_data) ⇒ nil
Get a new item proxy for a secret item in the secret service.
Instance Method Summary collapse
-
#attributes ⇒ GLib::HashTable<String>
Set the attributes of this item.
-
#attributes_finish=(result) ⇒ Boolean
Complete operation to set the attributes of this item.
-
#created ⇒ Integer
Get the created date and time of the item.
-
#delete(cancellable, callback, user_data) ⇒ nil
Delete this item.
-
#delete_finish(result) ⇒ Boolean
Complete asynchronous operation to delete the secret item.
-
#delete_sync(cancellable) ⇒ Boolean
Delete this secret item.
-
#flags ⇒ Secret::ItemFlags
A set of flags describing which parts of the secret item have been initialized.
-
#flags=(flags) ⇒ Secret::ItemFlags
A set of flags describing which parts of the secret item have been initialized.
-
#initialize(service, item_path, flags, cancellable) ⇒ Secret::Item
constructor
Get a new item proxy for a secret item in the secret service.
-
#label ⇒ String
Get the label of this item.
-
#label_finish=(result) ⇒ Boolean
Complete asynchronous operation to set the label of this collection.
-
#load_secret(cancellable, callback, user_data) ⇒ nil
Load the secret value of this item.
-
#load_secret_finish(result) ⇒ Boolean
Complete asynchronous operation to load the secret value of this item.
-
#load_secret_sync(cancellable) ⇒ Boolean
Load the secret value of this item.
-
#locked ⇒ Boolean
Get whether the item is locked or not.
-
#locked=(locked) ⇒ Boolean
Whether the item is locked or not.
-
#locked? ⇒ Boolean
Whether the item is locked or not.
-
#modified ⇒ Integer
Get the modified date and time of the item.
-
#refresh ⇒ nil
Refresh the properties on this item.
-
#schema_name ⇒ String
Gets the name of the schema that this item was stored with.
-
#secret ⇒ Secret::Value
Get the secret value of this item.
-
#secret_finish=(result) ⇒ Boolean
Complete asynchronous operation to set the secret value of this item.
-
#service ⇒ Secret::Service
The [classService] object that this item is associated with and uses to interact with the actual D-Bus Secret Service.
-
#service=(service) ⇒ Secret::Service
The [classService] object that this item is associated with and uses to interact with the actual D-Bus Secret Service.
-
#set_attributes(schema, attributes, cancellable, callback, user_data) ⇒ nil
Set the attributes of this item.
-
#set_attributes_sync(schema, attributes, cancellable) ⇒ Boolean
Set the attributes of this item.
-
#set_label(label, cancellable, callback, user_data) ⇒ nil
Set the label of this item.
-
#set_label_sync(label, cancellable) ⇒ Boolean
Set the label of this item.
-
#set_secret(value, cancellable, callback, user_data) ⇒ nil
Set the secret value of this item.
-
#set_secret_sync(value, cancellable) ⇒ Boolean
Set the secret value of this item.
Constructor Details
#initialize(service, item_path, flags, cancellable) ⇒ Secret::Item
Get a new item proxy for a secret item in the secret service.
If service is nil, then [funcService.get_sync] will be called to get the default [classService] proxy.
This method may block indefinitely and should not be used in user interface threads.
Class Method Details
.create(collection, schema, attributes, label, value, flags, cancellable, callback, user_data) ⇒ nil
Create a new item in the secret service.
If the flags contains %SECRET_ITEM_CREATE_REPLACE, then the secret service will search for an item matching the attributes, and update that item instead of creating a new one.
This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. [methodService.prompt] will be used to handle any prompts that are required.
.create_finish(result) ⇒ Secret::Item
Finish operation to create a new item in the secret service.
.create_sync(collection, schema, attributes, label, value, flags, cancellable) ⇒ Secret::Item
Create a new item in the secret service.
If the flags contains %SECRET_ITEM_CREATE_REPLACE, then the secret service will search for an item matching the attributes, and update that item instead of creating a new one.
This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. [methodService.prompt] will be used to handle any prompts that are required.
.load_secrets(items, cancellable, callback, user_data) ⇒ nil
Load the secret values for a secret item stored in the service.
The items must all have the same [propertyItem:service] property.
This function returns immediately and completes asynchronously.
.load_secrets_finish(result) ⇒ Boolean
Complete asynchronous operation to load the secret values for secret items stored in the service.
Items that are locked will not have their secrets loaded.
.load_secrets_sync(items, cancellable) ⇒ Boolean
Load the secret values for a secret item stored in the service.
The items must all have the same [propertyItem:service] property.
This method may block indefinitely and should not be used in user interface threads.
Items that are locked will not have their secrets loaded.
.new_for_dbus_path(service, item_path, flags, cancellable, callback, user_data) ⇒ nil
Get a new item proxy for a secret item in the secret service.
If service is nil, then [funcService.get] will be called to get the default [classService] proxy.
This method will return immediately and complete asynchronously.
Instance Method Details
#attributes ⇒ GLib::HashTable<String>
Set the attributes of this item.
The attributes are a mapping of string keys to string values. Attributes are used to search for items. Attributes are not stored or transferred securely by the secret service.
Do not modify the attributes returned by this method. Use [methodItem.set_attributes] instead.
#attributes_finish=(result) ⇒ Boolean
Complete operation to set the attributes of this item.
#created ⇒ Integer
Get the created date and time of the item.
The return value is the number of seconds since the unix epoch, January 1st 1970.
#delete(cancellable, callback, user_data) ⇒ nil
Delete this item.
This method returns immediately and completes asynchronously. The secret service may prompt the user. [methodService.prompt] will be used to handle any prompts that show up.
#delete_finish(result) ⇒ Boolean
Complete asynchronous operation to delete the secret item.
#delete_sync(cancellable) ⇒ Boolean
Delete this secret item.
This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. [methodService.prompt] will be used to handle any prompts that show up.
#flags ⇒ Secret::ItemFlags
A set of flags describing which parts of the secret item have been initialized.
#flags=(flags) ⇒ Secret::ItemFlags
A set of flags describing which parts of the secret item have been initialized.
#label ⇒ String
Get the label of this item.
#label_finish=(result) ⇒ Boolean
Complete asynchronous operation to set the label of this collection.
#load_secret(cancellable, callback, user_data) ⇒ nil
Load the secret value of this item.
Each item has a single secret which might be a password or some other secret binary value.
This function will fail if the secret item is locked.
This function returns immediately and completes asynchronously.
#load_secret_finish(result) ⇒ Boolean
Complete asynchronous operation to load the secret value of this item.
The newly loaded secret value can be accessed by calling [methodItem.get_secret].
#load_secret_sync(cancellable) ⇒ Boolean
Load the secret value of this item.
Each item has a single secret which might be a password or some other secret binary value.
This function may block indefinitely. Use the asynchronous version in user interface threads.
#locked ⇒ Boolean
Get whether the item is locked or not.
Depending on the secret service an item may not be able to be locked independently from the collection that it is in.
#locked=(locked) ⇒ Boolean
Whether the item is locked or not.
An item may not be independently lockable separate from other items in its collection.
To lock or unlock a item use the [methodService.lock] or [methodService.unlock] functions.
#locked? ⇒ Boolean
Whether the item is locked or not.
An item may not be independently lockable separate from other items in its collection.
To lock or unlock a item use the [methodService.lock] or [methodService.unlock] functions.
#modified ⇒ Integer
Get the modified date and time of the item.
The return value is the number of seconds since the unix epoch, January 1st 1970.
#refresh ⇒ nil
Refresh the properties on this item.
This fires off a request to refresh, and the properties will be updated later.
Calling this method is not normally necessary, as the secret service will notify the client when properties change.
#schema_name ⇒ String
Gets the name of the schema that this item was stored with. This is also
available at the xdg:schema attribute.
#secret ⇒ Secret::Value
Get the secret value of this item.
If this item is locked or the secret has not yet been loaded then this will return nil.
To load the secret call the [methodItem.load_secret] method.
#secret_finish=(result) ⇒ Boolean
Complete asynchronous operation to set the secret value of this item.
#service ⇒ Secret::Service
The [classService] object that this item is associated with and uses to interact with the actual D-Bus Secret Service.
#service=(service) ⇒ Secret::Service
The [classService] object that this item is associated with and uses to interact with the actual D-Bus Secret Service.
#set_attributes(schema, attributes, cancellable, callback, user_data) ⇒ nil
Set the attributes of this item.
The attributes are a mapping of string keys to string values. Attributes are used to search for items. Attributes are not stored or transferred securely by the secret service.
This function returns immediately and completes asynchronously.
#set_attributes_sync(schema, attributes, cancellable) ⇒ Boolean
Set the attributes of this item.
The attributes are a mapping of string keys to string values. Attributes are used to search for items. Attributes are not stored or transferred securely by the secret service.
This function may block indefinitely. Use the asynchronous version in user interface threads.
#set_label(label, cancellable, callback, user_data) ⇒ nil
Set the label of this item.
This function returns immediately and completes asynchronously.
#set_label_sync(label, cancellable) ⇒ Boolean
Set the label of this item.
This function may block indefinitely. Use the asynchronous version in user interface threads.
#set_secret(value, cancellable, callback, user_data) ⇒ nil
Set the secret value of this item.
Each item has a single secret which might be a password or some other secret binary value.
This function returns immediately and completes asynchronously.
#set_secret_sync(value, cancellable) ⇒ Boolean
Set the secret value of this item.
Each item has a single secret which might be a password or some other secret binary value.
This function may block indefinitely. Use the asynchronous version in user interface threads.