Skip to content

feat(coderd): add endpoint to fetch provisioner key details #15505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Nov 20, 2024
Prev Previous commit
Next Next commit
add missing tests
  • Loading branch information
defelmnq committed Nov 20, 2024
commit c89bcd8927a114517a16d235d4bad22f40c48a0e
14 changes: 14 additions & 0 deletions enterprise/coderd/provisionerkeys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,20 @@
success: true,
expectedErr: "",
},
{
name: "using unknown key",
useFakeKey: true,
fakeKey: "unknownKey",
success: false,
expectedErr: "provisioner daemon key invalid",
},
{
name: "no key provided",
useFakeKey: true,
fakeKey: "",
success: false,
expectedErr: "provisioner daemon key required",
},
}

for _, tt := range tests {
Expand All @@ -172,7 +186,7 @@
},
})

key, err := client.CreateProvisionerKey(ctx, owner.OrganizationID, codersdk.CreateProvisionerKeyRequest{

Check failure on line 189 in enterprise/coderd/provisionerkeys_test.go

View workflow job for this annotation

GitHub Actions / lint

ruleguard: This client is operating as the owner user, which has unrestricted permissions. Consider creating a different user. (gocritic)
Name: "my-test-key",
Tags: map[string]string{"key1": "value1", "key2": "value2"},
})
Expand Down
Loading