-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.0.21: nss detection fix and misc cleanup
- Loading branch information
Showing
50 changed files
with
769 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package auth | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/anchordotdev/cli" | ||
) | ||
|
||
var CmdAuth = cli.NewCmd[cli.ShowHelp](cli.CmdRoot, "auth", func(cmd *cobra.Command) { | ||
cmd.Args = cobra.NoArgs | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package auth | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/anchordotdev/cli" | ||
"github.com/anchordotdev/cli/cmdtest" | ||
"github.com/anchordotdev/cli/ui/uitest" | ||
) | ||
|
||
func TestCmdAuthSignout(t *testing.T) { | ||
cmd := CmdAuthSignin | ||
cfg := cli.ConfigFromCmd(cmd) | ||
cfg.Test.SkipRunE = true | ||
root := cmd.Root() | ||
|
||
t.Run("--help", func(t *testing.T) { | ||
cmdtest.TestOutput(t, root, "auth", "signout", "--help") | ||
}) | ||
} | ||
|
||
func TestSignout(t *testing.T) { | ||
ctx, cancel := context.WithCancel(context.Background()) | ||
defer cancel() | ||
|
||
cfg := new(cli.Config) | ||
cfg.Keyring.MockMode = true | ||
ctx = cli.ContextWithConfig(ctx, cfg) | ||
|
||
t.Run("signed-out", func(t *testing.T) { | ||
uitest.TestTUIError(ctx, t, new(SignOut).UI(), "secret not found in keyring") | ||
}) | ||
|
||
t.Run("signed-in", func(t *testing.T) { | ||
t.Skip("pending singleton keyring") | ||
// kr := keyring.Keyring{} | ||
// if err := kr.Set(keyring.APIToken, "secret"); err != nil { | ||
// t.Fatal(err) | ||
// } | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Manage Anchor.dev Authentication | ||
|
||
Usage: | ||
anchor auth <subcommand> [flags] | ||
anchor auth [command] | ||
|
||
Available Commands: | ||
signin Authenticate with your account | ||
signout Invalidate your local Anchor account session | ||
whoami Identify current account | ||
|
||
Flags: | ||
-h, --help help for auth | ||
|
||
Use "anchor auth [command] --help" for more information about a command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Manage Anchor.dev Authentication | ||
|
||
Usage: | ||
anchor auth <subcommand> [flags] | ||
anchor auth [command] | ||
|
||
Available Commands: | ||
signin Authenticate with your account | ||
signout Invalidate your local Anchor account session | ||
whoami Identify current account | ||
|
||
Flags: | ||
-h, --help help for auth | ||
|
||
Use "anchor auth [command] --help" for more information about a command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Sign into your Anchor account for your local system user. | ||
|
||
Generate a new Personal Access Token (PAT) and store it in the system keychain | ||
for the local system user. | ||
|
||
Usage: | ||
anchor auth signin [flags] | ||
|
||
Flags: | ||
-h, --help help for signin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Sign out of your Anchor account for your local system user. | ||
|
||
Remove your Personal Access Token (PAT) from the system keychain for your local | ||
system user. | ||
|
||
Usage: | ||
anchor auth signout [flags] | ||
|
||
Flags: | ||
-h, --help help for signout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Print the details of the Anchor account for your local system user. | ||
|
||
Usage: | ||
anchor auth whoami [flags] | ||
|
||
Flags: | ||
-h, --help help for whoami |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.