Skip to content

chore: add provisioner key crud apis #13857

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 20 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
save
  • Loading branch information
f0ssel committed Jul 16, 2024
commit e5f73112c5d4be584cf720c587d3ba187a27112c
3 changes: 2 additions & 1 deletion coderd/database/migrations/000226_provisioner_keys.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ CREATE TABLE provisioner_keys (
organization_id uuid NOT NULL REFERENCES organizations (id) ON DELETE CASCADE,
name varchar(64) NOT NULL,
hashed_secret bytea NOT NULL,
UNIQUE (organization_id, name)
);

CREATE INDEX provisioner_keys_organization_id_name_idx ON provisioner_keys (organization_id, name);
6 changes: 0 additions & 6 deletions coderd/database/modelmethods.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,6 @@ func (p ProvisionerKey) RBACObject() rbac.Object {
InOrg(p.OrganizationID)
}

func (p ListProvisionerKeysByOrganizationRow) RBACObject() rbac.Object {
return rbac.ResourceProvisionerKeys.
WithID(p.ID).
InOrg(p.OrganizationID)
}

func (w WorkspaceProxy) RBACObject() rbac.Object {
return rbac.ResourceWorkspaceProxy.
WithID(w.ID)
Expand Down
2 changes: 1 addition & 1 deletion coderd/database/queries/provisionerkeys.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ INSERT INTO
hashed_secret
)
VALUES
($1, $2, $3, $4, $5) RETURNING *;
($1, $2, $3, lower($4), $5) RETURNING *;

-- name: GetProvisionerKeyByID :one
SELECT
Expand Down