Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3af6272
Merge pull request #30 from oidc-mytoken/prerel
zachmann Jan 17, 2023
f515bb8
Merge pull request #56 from oidc-mytoken/prerel
zachmann Jul 31, 2024
f422222
update dependencies
zachmann May 4, 2026
872f8f9
update to urfave/cli v3 and refactor code to align with new API changes
zachmann May 4, 2026
336c6de
add support for specifying a custom mytoken server URL via CLI flag o…
zachmann May 4, 2026
ff3f97b
update copyright years in LICENSE and code files
zachmann May 4, 2026
60e7350
add "config" and "capabilities" commands to CLI for retrieving server…
zachmann May 4, 2026
17edd37
add "email," "tags," "profiles," and "mttags" commands to CLI for man…
zachmann May 6, 2026
0964cea
add support for enabling/disabling colored output via environment var…
zachmann May 6, 2026
a0b39c2
add support for italic and gray text formatting; extend "list-mytoken…
zachmann May 6, 2026
4ecd70d
add "mt list" as an alias for "info list-mytokens"
zachmann May 6, 2026
f98321d
add additional aliases ("rm," "delete") for tag and SSH key managemen…
zachmann May 6, 2026
a25ba60
add "list-all" and "groups" commands for listing profiles, templates,…
zachmann May 6, 2026
ae91f52
normalize color handling: support hex colors with or without "#" prefix
zachmann May 6, 2026
03239f8
add "calendars" and "notifications" commands to CLI for managing cale…
zachmann May 7, 2026
ce9694c
update oidc-mytoken/lib to v0.8.0 and remove local replace directive
zachmann May 7, 2026
b7f666e
Merge branch 'prerel' into new-features
zachmann May 7, 2026
2d0dc6b
update github.com/urfave/cli dependency to v3.8.0
zachmann May 7, 2026
6c15874
bump Go version in CI to 1.25
zachmann May 7, 2026
3ce50ac
update Go version in staticcheck job to 1.25
zachmann May 7, 2026
0f943e3
replace deprecated `strings.Title` with `cases.Title` and update cont…
zachmann May 7, 2026
f6aa970
update `golang.org/x/text` dependency to v0.36.0 and adjust `golang.o…
zachmann May 7, 2026
84e9085
New features
deepsource-autofix[bot] May 7, 2026
34e2746
update `oidc-mytoken/lib` dependency to v0.8.1-0.20260507130659-1d2d0…
zachmann May 7, 2026
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
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ variables:
UPSTREAM_PROJECT: oidc-mytoken/client
USE_GORELEASER: true

image: golang:1.24
image: golang:1.25
stages:
- build
- test
Expand Down Expand Up @@ -38,7 +38,7 @@ test_race:
- go test -race -v ./...

staticcheck:
image: golang:1.24
image: golang:1.25
stage: lint
before_script:
- go install honnef.co/go/tools/cmd/staticcheck@latest
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2024 Gabriel Zachmann
Copyright (c) 2020-2026 Gabriel Zachmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion cmd/mytoken/main.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package main

import (
"context"
"fmt"

mytokenlib "github.com/oidc-mytoken/lib"
"github.com/oidc-mytoken/utils/httpclient"
"golang.org/x/net/context"

"github.com/oidc-mytoken/client/internal/commands"
"github.com/oidc-mytoken/client/internal/model/version"
Expand Down
48 changes: 28 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,43 +1,51 @@
module github.com/oidc-mytoken/client

go 1.24.0
go 1.25.0

require (
github.com/Songmu/prompter v0.5.1
github.com/gliderlabs/ssh v0.3.7
github.com/mdp/qrterminal/v3 v3.2.0
github.com/oidc-mytoken/api v0.11.1
github.com/oidc-mytoken/lib v0.7.1
github.com/gliderlabs/ssh v0.3.8
github.com/mattn/go-isatty v0.0.22
github.com/mdp/qrterminal/v3 v3.2.1
github.com/oidc-mytoken/api v0.12.1
github.com/oidc-mytoken/lib v0.8.1-0.20260507130659-1d2d0a003337
github.com/oidc-mytoken/utils v0.1.2
github.com/olekukonko/tablewriter v0.0.5
github.com/olekukonko/tablewriter v1.1.4
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
github.com/urfave/cli/v2 v2.3.1-0.20211205195634-e8d81738896c
golang.org/x/net v0.38.0
golang.org/x/term v0.36.0
github.com/sirupsen/logrus v1.9.4
github.com/urfave/cli/v3 v3.8.0
golang.org/x/text v0.36.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/coreos/go-oidc/v3 v3.4.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/go-resty/resty/v2 v2.7.0 // indirect
github.com/goccy/go-json v0.10.6 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-runewidth v0.0.23 // indirect
github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 // indirect
github.com/olekukonko/errors v1.3.0 // indirect
github.com/olekukonko/ll v0.1.8 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.41.0 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/oauth2 v0.27.0 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/crypto v0.50.0 // indirect
golang.org/x/net v0.53.0 // indirect
golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 // indirect
golang.org/x/sys v0.43.0 // indirect
golang.org/x/term v0.42.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
rsc.io/qr v0.2.0 // indirect
)

replace github.com/urfave/cli/v2 => github.com/zachmann/cli/v2 v2.3.1-0.20211220102037-d619fd40a704
96 changes: 56 additions & 40 deletions go.sum

Large diffs are not rendered by default.

23 changes: 11 additions & 12 deletions internal/commands/at.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
package commands

import (
"context"
"os"

"github.com/oidc-mytoken/api/v0"
mytokenlib "github.com/oidc-mytoken/lib"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v3"

"github.com/oidc-mytoken/client/internal/config"
cutils "github.com/oidc-mytoken/client/internal/utils"
)

var atCommand = struct {
MTOptions
Scopes cli.StringSlice
Audiences cli.StringSlice
Scopes []string
Audiences []string
Out string
}{}

Expand All @@ -35,42 +36,40 @@ func init() {
Usage: "Request the passed scope.",
DefaultText: "all scopes allowed for the used mytoken",
Destination: &atCommand.Scopes,
Placeholder: "SCOPE",
},
&cli.StringSliceFlag{
Name: "aud",
Aliases: []string{"audience"},
Usage: "Request the passed audience.",
Destination: &atCommand.Audiences,
Placeholder: "AUD",
},
&cli.StringFlag{
Name: "out",
Aliases: []string{"o"},
Usage: "The access token will be printed to this output",
Usage: "The access token will be printed to this `FILE`",
TakesFile: true,
Value: os.Stdout.Name(),
Destination: &atCommand.Out,
Placeholder: "FILE",
},
),
},
)
}

func getAT(context *cli.Context) error {
func getAT(_ context.Context, cmd *cli.Command) error {
atc := atCommand
var comment string
if context.Args().Len() > 0 {
comment = context.Args().Get(0)
if cmd.Args().Len() > 0 {
comment = cmd.Args().Get(0)
}
if ssh := atc.SSH(); ssh != "" {
req := mytokenlib.NewAccessTokenRequest("", "", atc.Scopes.Value(), atc.Audiences.Value(), comment)
req := mytokenlib.NewAccessTokenRequest("", "", atc.Scopes, atc.Audiences, comment)
return doSSH(ssh, api.SSHRequestAccessToken, req)
}
mToken := atc.MustGetToken()
mytoken := config.Get().Mytoken()
atRes, err := mytoken.AccessToken.APIGet(
mToken, "", atc.Scopes.Value(), atc.Audiences.Value(), comment,
mToken, "", atc.Scopes, atc.Audiences, comment,
)
if err != nil {
return err
Expand Down
Loading
Loading