Skip to content

Commit

Permalink
bugfix: Minor adjustments to last PR (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
telegrapher authored May 5, 2023
1 parent cb90191 commit d08a707
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 278 deletions.
2 changes: 1 addition & 1 deletion cmd/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This command has no effect by itself, the authorization type needs to be specifi
authzUserCmd(imsConfig),
authzServiceCmd(imsConfig),
authzJWTCmd(imsConfig),
authzOAuthCmd(imsConfig),
authzClientCredentialsCmd(imsConfig),
)
return cmd
}
11 changes: 6 additions & 5 deletions cmd/authz_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ import (
"github.com/spf13/cobra"
)

func authzOAuthCmd(imsConfig *ims.Config) *cobra.Command {
func authzClientCredentialsCmd(imsConfig *ims.Config) *cobra.Command {
cmd := &cobra.Command{
Use: "oauth",
Short: "Negotiate authorization using OAuth Server-to-Server.",
Long: "Perform the 'Client Credential Authorization Flow' to negotiate an access token for a service.'",
Use: "clientCredentials",
Aliases: []string{"client"},
Short: "Negotiate a service to service access token using a technical account.",
Long: "Perform the 'Client Credentials Authorization Flow' to negotiate an access token for a service.",
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
cmd.SilenceErrors = true

resp, err := imsConfig.AuthorizeOAuth()
resp, err := imsConfig.AuthorizeClientCredentials()
if err != nil {
return fmt.Errorf("error in login service: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/authz_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
func authzServiceCmd(imsConfig *ims.Config) *cobra.Command {
cmd := &cobra.Command{
Use: "service",
Short: "Negotiate authorization as a service.",
Short: "Negotiate a service to service token.",
Long: "Perform the 'Client Credential Authorization Flow' to negotiate an access token for a service.'",
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
Expand Down
29 changes: 23 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,30 @@

module github.com/adobe/imscli

go 1.15

replace github.com/adobe/ims-go => ../ims-go
go 1.19

require (
github.com/adobe/ims-go v0.11.0
github.com/adobe/ims-go v0.13.0
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.15.0
)

require (
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit d08a707

Please sign in to comment.