Support D-Bus secret service via libsecret #7

Merged
merged 1 commit into from Jun 8, 2016

Projects

None yet

2 participants

@eagletmt
Collaborator
eagletmt commented Jun 7, 2016
  • Extract platform-independent API:
    • envchain_search_namespaces
    • envchain_search_values
    • envchain_save_values
  • Implement those APIs for Linux using D-Bus secret service
@eagletmt eagletmt commented on an outdated diff Jun 7, 2016
envchain_linux.c
+ GList *iter;
+ for (iter = items; iter != NULL; iter = iter->next) {
+ SecretItem *item = iter->data;
+ GHashTable *attrs = secret_item_get_attributes(item);
+ char *key = g_hash_table_lookup(attrs, "key");
+ SecretValue *value = secret_item_get_secret(item);
+ callback(key, secret_value_get_text(value), data);
+ secret_value_unref(value);
+ g_hash_table_unref(attrs);
+ }
+ return 0;
+}
+
+void envchain_save_value(const char *name, const char *key, char *value,
+ G_GNUC_UNUSED int require_passphrase) {
+ /* TODO: Support require_passphrase flag */
@eagletmt
eagletmt Jun 7, 2016 Collaborator

I'm not sure if this is possible or not

@eagletmt eagletmt was assigned by sorah Jun 7, 2016
@sorah
Owner
sorah commented Jun 7, 2016

lgtm?

@eagletmt
Collaborator
eagletmt commented Jun 7, 2016

I believe it's working well now.
It automatically show prompt requesting to unlock the default collection.

@sorah
Owner
sorah commented Jun 7, 2016

LGTM

@eagletmt eagletmt Support D-Bus secret service via libsecret
- Extract platform-independent API:
  - envchain_search_namespaces
  - envchain_search_values
  - envchain_save_values
- Implement those APIs for Linux using D-Bus secret service
0d682b3
@eagletmt
Collaborator
eagletmt commented Jun 8, 2016

squashed

@eagletmt eagletmt merged commit af16d2f into sorah:master Jun 8, 2016
@eagletmt eagletmt deleted the eagletmt:linux branch Jun 8, 2016
@sorah sorah added a commit that referenced this pull request Jun 8, 2016
@sorah Release v1.0.0
= New feature

- Linux support with libsecret (#7 @eagletmt)

  libsecret commuicates with D-Bus secret service; for instance,
  gnome-keyring implements it.

= New feature in v0.2.0 (forgot to note..)

- `--list` command

  On OS X keychain, values have to be set after envchain v0.2.0 or later
  due to data structure change, in prior to be listed.
cc84ebc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment