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

Scope parameter in raw endpoint seems not working #181

Closed
mkschuel opened this issue Oct 10, 2023 · 1 comment
Closed

Scope parameter in raw endpoint seems not working #181

mkschuel opened this issue Oct 10, 2023 · 1 comment

Comments

@mkschuel
Copy link

Currently it's not possible to generate a sealed secret via the /api/raw endpoint for different scopes than the default one (strict).

The error seems to be in the 'Raw' function. Instead of using the predefined scope

scope := v1alpha1.DefaultScope
if data.Scope != "" {
_ = scope.Set(data.Scope)
}

the 'kubeseal.EncryptSecretItem' is called with 'v1alpha1.DefaultScope' again

v1alpha1.DefaultScope, a.pubKey); err != nil {

Please ignore this analysis if I'm wrong. I'm not a Go developer.
Might be also that I'm used the API in a wrong way. This is how I used it:

curl --request POST 'https://<my-cluster-url>/api/raw' \                                                                ─╯
     --header 'Content-Type: application/json' \
     --data '{ "scope": "cluster-wide", "value": "value to seal" }'

PS: Anyway. Great tool. Thanks for sharing it.

bakito added a commit that referenced this issue Oct 10, 2023
@bakito
Copy link
Owner

bakito commented Oct 10, 2023

Hi @mkschuel

You're right, this seems not to work as expected.
Thank you very much for reporting.

I'll provide a new version ASAP

@bakito bakito closed this as completed Oct 10, 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

No branches or pull requests

2 participants