Skip to content

Commit

Permalink
fix profile usage with default capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmann committed Jan 17, 2023
1 parent 8645e5a commit 2a2a089
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions internal/commands/mt.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (opts *mtOpts) Request(ctx *cli.Context) (*api.GeneralMytokenRequest, error
if err != nil {
return nil, err
}
if len(opts.request.Capabilities) == 0 {
if len(opts.request.Capabilities) == 0 && len(opts.request.IncludedProfiles) == 0 {
opts.request.Capabilities = api.NewCapabilities(config.Get().DefaultTokenCapabilities)
}
return opts.request, nil
Expand Down Expand Up @@ -502,10 +502,12 @@ func obtainMT(context *cli.Context) (string, error) {
}
mtGrant := mtCommand.GetToken()
if mtGrant != "" && !mtCommand.UseOIDCFlow {

mtRes, err := mytoken.Mytoken.APIFromMytoken(
mtGrant, req.Issuer, req.Restrictions, req.Capabilities,
req.Rotation, req.ResponseType, req.Name,
req.GrantType = api.GrantTypeMytoken
mtRes, err := mytoken.Mytoken.APIFromRequest(
api.MytokenFromMytokenRequest{
GeneralMytokenRequest: *req,
Mytoken: mtGrant,
},
)
if err != nil {
return "", err
Expand Down

0 comments on commit 2a2a089

Please sign in to comment.