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

[BUG]: Using Authorization without dependency on jq #390

Closed
tdawe opened this issue Jul 25, 2022 · 8 comments
Closed

[BUG]: Using Authorization without dependency on jq #390

tdawe opened this issue Jul 25, 2022 · 8 comments
Assignees
Labels
area/csm-authorization Issue pertains to the CSM Authorization module type/bug Something isn't working. This is the default label associated with a bug issue.
Milestone

Comments

@tdawe
Copy link
Collaborator

tdawe commented Jul 25, 2022

Bug Description

CSM Authorization documentation needs to be updated to show token generation steps without using jq. Remove references to using jq.

Logs

n/a

Screenshots

No response

Additional Environment Information

No response

Steps to Reproduce

Use Authorization proxy server VM without jq installed

Expected Behavior

There shouldn't be a dependency on jq

CSM Driver(s)

n/a

Installation Type

No response

Container Storage Modules Enabled

No response

Container Orchestrator

n/a

Operating System

RHEL 7.9

@tdawe tdawe added needs-triage Issue requires triage. type/bug Something isn't working. This is the default label associated with a bug issue. labels Jul 25, 2022
@shaynafinocchiaro shaynafinocchiaro added area/csm-authorization Issue pertains to the CSM Authorization module backlog and removed needs-triage Issue requires triage. labels Jul 29, 2022
@shaynafinocchiaro shaynafinocchiaro added this to the v1.4.0 milestone Jul 29, 2022
@donatwork
Copy link
Contributor

@tdawe Is Python 3 an option? We could use sed which does not have a dependency on much or Python 3, which should be standard now on most distributions.

| python3 -c "import json,sys; print(json.load(sys.stdin)['Token'])"

@tdawe
Copy link
Collaborator Author

tdawe commented Aug 2, 2022

@donatwork Checking on my RHEL 7.9 setup, it comes with Python 2.7.5 so we may need to rely on sed.

@donatwork
Copy link
Contributor

Python 2.7.x has been EOLd since 2020-01-01. Even then the same command can work with Python 2.7.x as well as Python 3. Python has been around for a long time. We can use sed but it is ugly. Is that your preference? The command will be this:

| sed -e 's/"Token": //' -e 's/[{}"]//g' -e 's/\n/\n/g'

@atye
Copy link
Contributor

atye commented Aug 2, 2022

Could we have karavictl generate token output valid yaml instead of requiring the user to parse the response? Perhaps we could have a new flag to support valid yaml output.

@tdawe
Copy link
Collaborator Author

tdawe commented Aug 2, 2022

I like that idea @atye , instead of having to rely on other tools to parse the output. A flag such as --yaml could be added so we remain backwards compatible with the current command but provide an option to get the valid yaml.

@sharmilarama
Copy link
Collaborator

I will add this as an enhancement in our backlog. We can update the documentation to use sed for now if we do not want Python dependency @tdawe?

@tdawe
Copy link
Collaborator Author

tdawe commented Aug 2, 2022

I will add this as an enhancement in our backlog. We can update the documentation to use sed for now if we do not want Python dependency @tdawe?

Yes, doc update with sed for now should be fine.

@donatwork
Copy link
Contributor

donatwork commented Aug 4, 2022

Removed dependency on jq in favor of sed which is more portable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/csm-authorization Issue pertains to the CSM Authorization module type/bug Something isn't working. This is the default label associated with a bug issue.
Projects
None yet
Development

No branches or pull requests

5 participants