Skip to content

Commit 61a211e

Browse files
committed
add fields to create auth clients
Supports creating oauth clients Updates: tailscale/tailscale#9632
1 parent a05fc3b commit 61a211e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

keys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (kr *KeysResource) CreateAuthKey(ctx context.Context, ckr CreateKeyRequest)
7777
// CreateOAuthClient creates a new OAuth client. Returns the generated [Key] if successful.
7878
func (kr *KeysResource) CreateOAuthClient(ctx context.Context, ckr CreateOAuthClientRequest) (*Key, error) {
7979
req, err := kr.buildRequest(ctx, http.MethodPost, kr.buildTailnetURL("keys"), requestBody(createOAuthClientWithKeyTypeRequest{
80-
KeyType: "oauthclient",
80+
KeyType: "client",
8181
CreateOAuthClientRequest: ckr,
8282
}))
8383
if err != nil {

keys_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func TestClient_CreateOAuthClient(t *testing.T) {
156156

157157
var actualReq createOAuthClientWithKeyTypeRequest
158158
assert.NoError(t, json.Unmarshal(server.Body.Bytes(), &actualReq))
159-
assert.EqualValues(t, "oauthclient", actualReq.KeyType)
159+
assert.EqualValues(t, "client", actualReq.KeyType)
160160
assert.EqualValues(t, 1, len(actualReq.Scopes))
161161
assert.EqualValues(t, "all:read", actualReq.Scopes[0])
162162
assert.EqualValues(t, 1, len(actualReq.Tags))

0 commit comments

Comments
 (0)