Skip to content

feat: implement login/logout UX#413

Merged
shizhMSFT merged 4 commits intonotaryproject:mainfrom
JeyJeyGao:junjiegao/spec_login
Oct 31, 2022
Merged

feat: implement login/logout UX#413
shizhMSFT merged 4 commits intonotaryproject:mainfrom
JeyJeyGao:junjiegao/spec_login

Conversation

@JeyJeyGao
Copy link
Copy Markdown
Contributor

@JeyJeyGao JeyJeyGao commented Oct 25, 2022

implemnt login UI based on https://github.com/notaryproject/notation/blob/main/specs/commandline/login.md fix:

  1. added Login Succeeded message when login succeeded
  2. added username parameter validation
  3. removed --plain-http global flag
  4. updated spec: removed logout --plain-http & --all flag

Test:

  1. login with -u -p flags
  2. login with $NOTATION_USERNAME $NOTATION_PASSWORD
  3. login with --password-stdin
  4. login without username -> username was not set.

Signed-off-by: Junjie Gao junjiegao@microsoft.com

@JeyJeyGao JeyJeyGao force-pushed the junjiegao/spec_login branch from e7f9813 to 5027651 Compare October 26, 2022 02:41
@yizha1 yizha1 added this to the beta-1 milestone Oct 26, 2022
@yizha1 yizha1 linked an issue Oct 26, 2022 that may be closed by this pull request
@yizha1 yizha1 requested review from a team, priteshbandi, rgnote, shizhMSFT and yizha1 October 26, 2022 06:11
@JeyJeyGao JeyJeyGao force-pushed the junjiegao/spec_login branch from 0ac3223 to f418a78 Compare October 26, 2022 09:09
@yizha1
Copy link
Copy Markdown
Contributor

yizha1 commented Oct 26, 2022

@dtzar There are some cases need to be considered for --all flag, for example, user will log out from all the registries including those logged in using docker login or other tools. There are also other cases. We need spend more time on investigation. So, I suggest removing --all flag for now considering the time of beta.1 release is approaching and add it back later once we figure out the correct behaviors.

@JeyJeyGao JeyJeyGao force-pushed the junjiegao/spec_login branch from 8df0dce to b3a26e1 Compare October 27, 2022 04:27
@yizha1 yizha1 removed this from the beta-1 milestone Oct 27, 2022
Copy link
Copy Markdown
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@priteshbandi
Copy link
Copy Markdown
Contributor

priteshbandi commented Oct 28, 2022

@dtzar There are some cases need to be considered for --all flag, for example, user will log out from all the registries including those logged in using docker login or other tools. There are also other cases. We need spend more time on investigation. So, I suggest removing --all flag for now considering the time of beta.1 release is approaching and add it back later once we figure out the correct behaviors.

Should we mention in command help that logout will log out from registries including those logged in using docker login or other tools?

Copy link
Copy Markdown
Contributor

@priteshbandi priteshbandi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@patrickzheng200 patrickzheng200 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 28, 2022

Codecov Report

Merging #413 (325b069) into main (469069e) will not change coverage.
The diff coverage is 85.71%.

@@           Coverage Diff           @@
##             main     #413   +/-   ##
=======================================
  Coverage   33.91%   33.91%           
=======================================
  Files          21       21           
  Lines        1138     1138           
=======================================
  Hits          386      386           
  Misses        744      744           
  Partials        8        8           
Impacted Files Coverage Δ
cmd/notation/main.go 0.00% <ø> (ø)
cmd/notation/login.go 42.68% <80.00%> (-0.53%) ⬇️
cmd/notation/logout.go 54.16% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Copy Markdown
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

implemnt login UI based on https://github.com/notaryproject/notation/blob/main/specs/commandline/login.md
fix:
1. added `Login Succeeded` message when login succeeded
2. added username parameter validation
3. removed --plain-http global flag

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
@JeyJeyGao JeyJeyGao force-pushed the junjiegao/spec_login branch from 0d8f8c7 to 325b069 Compare October 31, 2022 06:10
Copy link
Copy Markdown
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shizhMSFT shizhMSFT merged commit a41b377 into notaryproject:main Oct 31, 2022
7h3-3mp7y-m4n pushed a commit to 7h3-3mp7y-m4n/notation that referenced this pull request Mar 29, 2025
implemnt login UI based on
https://github.com/notaryproject/notation/blob/main/specs/commandline/login.md
fix:
1. added `Login Succeeded` message when login succeeded
2. added username parameter validation
3. removed --plain-http global flag
4. updated spec: removed logout --plain-http & --all flag

Test:
1. login with -u -p flags
2. login with $NOTATION_USERNAME $NOTATION_PASSWORD
3. login with --password-stdin
5. login without username -> `username was not set.`

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
FeynmanZhou pushed a commit to FeynmanZhou/notation that referenced this pull request May 15, 2025
implemnt login UI based on
https://github.com/notaryproject/notation/blob/main/specs/commandline/login.md
fix:
1. added `Login Succeeded` message when login succeeded
2. added username parameter validation
3. removed --plain-http global flag
4. updated spec: removed logout --plain-http & --all flag

Test:
1. login with -u -p flags
2. login with $NOTATION_USERNAME $NOTATION_PASSWORD
3. login with --password-stdin
5. login without username -> `username was not set.`

Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Implementing login/logout command

7 participants