capactio / capact

Simple way to manage applications and infrastructure.
https://capact.io
Apache License 2.0
80 stars 19 forks source link

Implement Secret storage backend as gRPC server #644

Closed pkosiec closed 2 years ago

pkosiec commented 2 years ago

Description

Changes proposed in this pull request:

TODO

Notes

Lint failing because of timeout. Don't worry about it - The job will be green after review 🙂

Testing

To regenerate the gRPC code, run:

SKIP_DEPS_INSTALLATION=false make gen-grpc-resources

To run example calls against the gRPC service:

  1. Create AWS security credentials with SecretsManagerReadWrite policy.

  2. Export environment variables:

    export AWS_ACCESS_KEY_ID="{accessKey}"
    export AWS_SECRET_ACCESS_KEY="{secretKey}"
  3. Run the server:

    APP_SUPPORTED_PROVIDERS=dotenv,aws_secretsmanager APP_LOGGER_DEV_MODE=true go run ./cmd/secret-storage-backend/main.go
  4. Now let's use Go generated gRPC client to to see how the server behaves. Run the example pkg/hub/api/grpc/storage_backend/example_test.go.

    To run it, you can e.g. change the func ExampleNewStorageBackendClient() { to func TestE2EScenario(t *testing.T) { and run it as an usual test.

  5. Change the line 12 of this test and run it again:

    provider := "aws_secretsmanager"

Related issue(s)

Resolves #637

pkosiec commented 2 years ago

Integration tests failed during Capact iunstallation, but the previous run was successful (https://github.com/capactio/capact/actions/runs/1900095690) - and also this PR doesn't change anything related to integration tests, so I'm merging this without retry.