Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KSM-458 - Python SDK - remove core dep on helper #519

Merged

Conversation

jwalstra-keeper
Copy link
Contributor

No description provided.

Created a new Ansible action to retrieve records from the Vault and
create a encrypted serialized cache. This cache can then be set on
the attributes of the existing action. If set, the existing actions
will use the records in the cache. However, if the action uses
notation, the cache will not work. The KSM SDK notation method
needs to be changed to allow a list of Record to be passed in. Right
now it always get record from the Keeper Vault.

The new action `keeper_cache_records` takes a list of UID and/or titles.

```yaml
  tasks:
    - name: Generate a Keeper Record Cache secret
      keeper_password:
        length: 64
      register: keeper_record_cache_secret
      no_log: True

    - name: Store the Keeper Record Cache secret into variables.
      set_fact:
        keeper_record_cache_secret: "{{ keeper_record_cache_secret.password }}"
      no_log: True

    - name: Cache records. Will use keeper_record_cache_secret from above.
      keeper_cache_records:
        uids:
          - RECORD UID 1
          - RECORD UID 2
        titles:
          - TITLE 1
          - TITLE 2
      register: my_records
      no_log: True

    - name: "Get Value By UID"
      keeper_get:
        cache: "{{ my_records.cache }}"
        uid: RECORD UID 1
        field: "password"
      register: "my_password_by_uid"
```

Bonus changes

* Added the ability to select records by title to the `keeper_get`, `keeper_set`, and
  `keeper_copy` actions.
* Added a non-notation selectors for complex field values. The attributes
  `array_index` and `value_key` allow selecting which object/value in an array
  and key/value pair for dictionaries.
* Updated the test framework. Changes in Ansible broke our test framework.
Refactor add_custom_field not to use the helper module. The method
will accept an instance of FieldType, however it is not tied to the
keeper_secrets_manager_helper.v3.field_type.FieldType module.

Allow the ability to set the type, label, and value not using the
FieldType instance. The method will still take the param `field`,
however it will also take `field_type`, `label`, and `value`. This
allows adding a custom field without have to use the helper module.

Removed references `keeper-secrets-manager-helper` from setup.py
and requirements.txt. This should break the circular reference.

Added unit tests for the method.
@jwalstra-keeper jwalstra-keeper force-pushed the KSM-458_remove_core_dep_on_helper branch from e54d5c0 to ee89659 Compare August 22, 2023 17:09
@maksimu maksimu changed the title Ksm 458 remove core dep on helper KSM-458 - Python Helper - remove core dep on helper Sep 14, 2023
@maksimu maksimu changed the title KSM-458 - Python Helper - remove core dep on helper KSM-458 - Python SDK - remove core dep on helper Sep 14, 2023
@maksimu maksimu changed the base branch from master to release/sdk/python/core/v16.6.2 September 14, 2023 23:21
@maksimu maksimu merged commit 93034b6 into release/sdk/python/core/v16.6.2 Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants