falcosecurity / falcoctl

Administrative tooling for Falco
Apache License 2.0
82 stars 57 forks source link

feat(auth/basic): extend auth basic command #588

Closed alacuku closed 2 weeks ago

alacuku commented 2 weeks ago

Username and password can be set using cli flags, env variables and stdin.

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

/kind flaky-test

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area library

/area cli

/area tests

/area examples

What this PR does / why we need it:

This PR extends the falcoctl registry auth basic command by allowing username and password to be set using the cli flags, env variables and stdin other than the interactive prompt.

See examples:

Example - Log in with username and password from command line flags:
    falcoctl registry auth basic -u username -p password localhost:5000
Example - Login with username and password from env variables:
    FALCOCTL_REGISTRY_AUTH_BASIC_USERNAME=username FALCOCTL_REGISTRY_AUTH_BASIC_PASSWORD=password falcoctl registry auth basic localhost:5000
Example - Login with username and password from stdin:
    falcoctl registry auth basic -u username --password-stdin localhost:5000
Example - Login with username and password in an interactive prompt:
    falcoctl registry auth basic localhost:5000

Which issue(s) this PR fixes:

Fixes #

134

Special notes for your reviewer:

poiana commented 2 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alacuku, FedeDP

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/falcosecurity/falcoctl/blob/main/OWNERS)~~ [FedeDP,alacuku] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
poiana commented 2 weeks ago

LGTM label has been added.

Git tree hash: cbefdaab61971415c1b540509596091cfb3d0bc3