Commit Graph

9 Commits

Author SHA1 Message Date
Sascha Grunert e344d412c0 Remove `--accept-repositories` flag
We decided to remove the flag and opt-in via the options from Podman.
This means we do not need the flags any more, but keep the configuration
itself.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-07-30 13:03:03 +02:00
Sascha Grunert 9f3d6b6bdd Add support for path based registry in login/logout
We now add a new configuration option to opt-in for path based registry
authentication in containers-auth.json. This affects login and logout,
which means if the option is enabled we can now use
`my-registry.local/path/to/image` to save or remove the credentials from
the auth.json.

If the option is enabled, then we enforce a stricter validation of the
input. For example it is not allowed input `http[s]://` prefixed keys.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-07-23 09:41:19 +02:00
flouthoc 71eec0674b Use SetCredentials and add verbose to loginopts
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2021-06-16 13:56:07 +05:30
Paul Holzinger 08f65cc609 Shell Completion with cobra for login/logout flags
The PR containers/podman#6442 enables a new way to create
shell completions scripts. The shell completion is handled
by cobra and since the login/logout flags are defined here
the completion functions for this should be defined here
as well. For Reference see:
https://github.com/spf13/cobra/blob/master/shell_completions.md

I added a unit test to ensure that the flags have a
completion function set.

This could also be used by skopeo and buildah if
someone wants to implement such completions for them.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-21 15:12:30 +02:00
Miloslav Trmač 6be0374d61 Document the intent of fully handling various options
Alternatively, it is very tempting to make them completely private
instead. This makes the code usable by callers that don't use
cobra (but they would still drag in the dependency).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-05-07 22:50:22 +02:00
Miloslav Trmač 513e3eedd5 Remove LogoutOptions.Stdin
It has no users and we don't expect it to be necessary.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-05-07 21:57:42 +02:00
Miloslav Trmač 2b8d439680 Provide a CLI flag for LoginOptions.GetLoginSet
There seems to be no reason to move that to callers

Also clarify what the callers should do about --tls-verify.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-05-07 21:56:42 +02:00
Qi Wang 1d57954f2c auth pkg supports login empty argument
Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-06 12:16:50 -04:00
Qi Wang 6b9441182d Add pkg/auth common code for login/logout
pkg/auth includes CLI options definitions and implementatoin of login/logout.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-04-09 13:38:57 -04:00