Skip to content

Commit

Permalink
[api] Change name apikey -> api_token
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeland73 committed Apr 24, 2024
1 parent 429c96e commit b351ff3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions pkg/api/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (

func (c *Client) GetAccessToken(
ctx context.Context,
apiKey ids.APIKey,
apiToken ids.APIToken,
) (*tokenservicev1alpha1.GetAccessTokenResponse, error) {
response, err := c.tokenClient().GetAccessToken(
ctx,
connect.NewRequest(&tokenservicev1alpha1.GetAccessTokenRequest{
Token: apiKey.String(),
Token: apiToken.String(),
}),
)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.9.0
go.jetify.com/typeid v1.1.0
go.jetpack.io/typeid v1.0.1-0.20240410183543-96a4fd53d1e2
golang.org/x/oauth2 v0.19.0
google.golang.org/protobuf v1.33.0
Expand Down
2 changes: 2 additions & 0 deletions pkg/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8
github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.jetify.com/typeid v1.1.0 h1:eRW/BBYx1Kh3DiOKBLaAHbwomxK4jm4/tWuNshN5wXY=
go.jetify.com/typeid v1.1.0/go.mod h1:68KXnMPJvJi4Pf2vUhr1QtWo5LfXzMwbUdLfwPlO4jI=
go.jetpack.io/typeid v1.0.1-0.20240410183543-96a4fd53d1e2 h1:w9uWg8BAim374iWzxEuDhf6MJ/cMQVR/0xi/L3DgfT0=
go.jetpack.io/typeid v1.0.1-0.20240410183543-96a4fd53d1e2/go.mod h1:zqBUNjE3NxAL8wRYW2LcOpH5LxCvTqthm9YSuuu1ic4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down
13 changes: 0 additions & 13 deletions pkg/ids/apikey.go

This file was deleted.

13 changes: 13 additions & 0 deletions pkg/ids/apitoken.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package ids

import (
"go.jetify.com/typeid"
)

type APITokenPrefix struct{}

func (APITokenPrefix) Prefix() string { return "api_token" }

type APIToken struct {
typeid.TypeID[APITokenPrefix]
}

0 comments on commit b351ff3

Please sign in to comment.