Skip to content

apikey secrets suggestion in stderr#51

Open
eguzki wants to merge 2 commits intomainfrom
apikey-secrets-stderr
Open

apikey secrets suggestion in stderr#51
eguzki wants to merge 2 commits intomainfrom
apikey-secrets-stderr

Conversation

@eguzki
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Member

nice, like this and the approach

@jasonmadigan
Copy link
Copy Markdown
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