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

apikey secrets suggestion in stderr #51

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

eguzki
Copy link
Collaborator

@eguzki eguzki commented Nov 30, 2023

The proposed value here is that the tools gives you the correct labels and structure of the secret data (the key of the data needs to be api_key)

❯ bin/kuadrantctl generate kuadrant authpolicy --oas examples/oas3/petstore-multiple-sec-requirements.yaml 1>/dev/null
======================================================================================================
POST /v1/cat endpoint is protected with ApiKey. Consider creating secrets with valid tokens
---
apiVersion: v1
kind: Secret
metadata:
  creationTimestamp: null
  labels:
    authorino.kuadrant.io/managed-by: authorino
    kuadrant.io/apikeys-by: cat_api_key
  name: cat_api_key
stringData:
  api_key: MY_SECRET_TOKEN_VALUE
type: Opaque

======================================================================================================
GET /v1/snake endpoint is protected with ApiKey. Consider creating secrets with valid tokens
---
apiVersion: v1
kind: Secret
metadata:
  creationTimestamp: null
  labels:
    authorino.kuadrant.io/managed-by: authorino
    kuadrant.io/apikeys-by: snakes_api_key
  name: snakes_api_key
stringData:
  api_key: MY_SECRET_TOKEN_VALUE
type: Opaque

Note: stdout has been redirected to /dev/null

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0658b51) 0.38% compared to head (2af1922) 0.38%.

Additional details and impacted files
@@          Coverage Diff          @@
##            main     #51   +/-   ##
=====================================
  Coverage   0.38%   0.38%           
=====================================
  Files         17      17           
  Lines        783     783           
=====================================
  Hits           3       3           
  Misses       780     780           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jasonmadigan
Copy link
Member

nice, like this and the approach

@jasonmadigan
Copy link
Member

I suppose one other option could be a flag to generate a secret, (and an option to pass that secret value in). Not sure which is better really.

If this lands, will need to swallow stderr in our CI

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