Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cmd/akash/cmd/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"strconv"
"strings"
"time"

"github.com/golang-jwt/jwt/v5"
Expand Down Expand Up @@ -145,7 +146,7 @@ func authJWTCmd() *cobra.Command {
cmd.Flags().String(FlagJWTExp, "15m", "Set token's `exp` field. Format is either 15m|h or unix timestamp")
cmd.Flags().String(FlagJWTNbf, "", "Set token's `nbf` field. Format is either 15m|h or unix timestamp. Empty equals to current timestamp")
cmd.Flags().String(FlagJWTAccess, "full", "Set token's `leases.access` field. Permitted values are full|scoped|granular. Default is full")
cmd.Flags().StringSlice(FlagJWTScope, nil, "Set token's `leases.scope` field. Comma separated list of scopes. Can only be set if `leases.access=scoped`. Allowed scopes are")
cmd.Flags().StringSlice(FlagJWTScope, nil, fmt.Sprintf("Set token's `leases.scope` field. Comma separated list of scopes. Can only be set if `leases.access=scoped`. Allowed scopes are (%s)", strings.Join(permissionScopesToStrings(ajwt.GetSupportedScopes()), "|")))

return cmd
}
Expand All @@ -163,3 +164,11 @@ func parseAccess(val string) (ajwt.AccessType, bool) {

return res, true
}

func permissionScopesToStrings(scopes ajwt.PermissionScopes) []string {
result := make([]string, len(scopes))
for i, scope := range scopes {
result[i] = string(scope)
}
return result
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.23.5
toolchain go1.23.6

require (
github.com/akash-network/akash-api v0.0.82
github.com/akash-network/akash-api v0.0.83
github.com/blang/semver/v4 v4.0.0
github.com/boz/go-lifecycle v0.1.1
github.com/cosmos/cosmos-sdk v0.45.16
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/akash-network/akash-api v0.0.82 h1:/Qkwhp1hm6UAzWgTBQdghrbSVArjq9hGzeOcycgCVqI=
github.com/akash-network/akash-api v0.0.82/go.mod h1:Y9Bq4S3c/MMjvWj/3KuEYmDfv3leo9OeGGxo7xL0pVc=
github.com/akash-network/akash-api v0.0.83 h1:Vz1Nuwstf2bwoQwb+75lJA2wrgoowB/H38gmAE2eiP4=
github.com/akash-network/akash-api v0.0.83/go.mod h1:Y9Bq4S3c/MMjvWj/3KuEYmDfv3leo9OeGGxo7xL0pVc=
github.com/akash-network/cometbft v0.34.27-akash.5 h1:Xhj+lCkN5XhN04sMuhfA0wUN9iWFSehynIwNjFYNVxE=
github.com/akash-network/cometbft v0.34.27-akash.5/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw=
github.com/akash-network/cosmos-sdk v0.45.16-akash.5 h1:1Pcoo37GFr8DETF61ej47jHzVQlD/xP/s+6Saajj/Is=
Expand Down
Loading