Proposal: Allow saving and reusing bearer tokens via the auth command
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 816
- Forks
- 230
- Avg merge
- 6h 4m
- Merged PRs (30d)
- 1
Description
Expected Behaviour
I would like to authenticate the CLI using a token and persist this to the configuration
faas-cli login -g http://example.com --token abc123
And then subsequent CLI commands will reuse this token without needing to specify it via a flag, these two commands would be equivalent after authentication
faas-cli deploy -g http://example.com --token abc123 --name echo --image theaxer/pycho --fprocess="python index.py"
faas-cli deploy -g http://example.com --name echo --image theaxer/pycho --fprocess="python index.py"
Current Behaviour
faas-cli login only supports basic auth
Context
This is useful when using an authentication proxy in the load balancer layer versus enabling auth directly in openfaas. For example, nginx can make a side request to authenticate a request. We often enable this as a centralized auth layer instead of enabling authentication in each application that is deployed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the faas-cli login and deploy command entry points and how they currently receive authentication flags. Define how a token passed to login is persisted and reused by later commands, then verify that the shown authenticated and tokenless deploy commands behave equivalently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, nginx
- Domain
- authentication, cli, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100