Skip to content

Secret v2 api

Rustam Lotsmanenko (EPAM) requested to merge secret-v2-api into main

Description:

ADR: #8

  • Implement role-based access to secrets based on Entitlements service.
  • Implement fine-grained access to secrets based on ACL.
  • High privileged role admin will allow to Manage secrets and access them.
  • The reader role will only allow reading secrets.
  • ACL will stored in Secret Entity.
  • Integration tests for V2 API.
  • Swagger is updated.

V2 API is disabled by default, to enable it use SECRET_V2_ENABLED=true variable.

To enable integration tests use V2_TEST_ENABLED=true.

Example of V2 Secret Entity:

       {
            "id": "test-secret-eds",
            "value": "some_value",
            "createdAt": "2024-05-31T11:03:05Z",
            "secretAcls": {
                "viewers": [
                    "eds.secret.viewers@osdu.group"
                ],
                "owners": [
                    "eds.secret.owners@osdu.group"
                ]
            },
            "metadata": {},
            "createdBy": "integration-tester@service.local",
            "enabled": true
        }

How to test:

Integration tests.

Changes include:

  • Refactor (a non-breaking change that improves code maintainability).
  • Bugfix (a non-breaking change that solves an issue).
  • New feature (a non-breaking change that adds functionality).
  • Breaking change (a change that is not backward-compatible and/or changes current functionality).

Changes in:

  • Common Code
  • RI

Dev Checklist:

  • Added Unit Tests, wherever applicable.
  • Updated the Readme, if applicable.
  • Existing Tests pass
  • Verified functionality locally
  • Self Reviewed my code for formatting and complex business logic.

Other comments:

  • To enable Secret V2 API CSPs should implement ISecretsManagerV2 interface.
  • After that V2 API can be enabled via property
  • V1 API is deprecated but online, later can be disabled via property
Edited by Rustam Lotsmanenko (EPAM)

Merge request reports

Loading