- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: add keys to organization provision daemons#14627
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
e5b9cc9683876b7192df7c0beed940826786a190141e883810f60bc9f676ba4c0ae05656373ce174f02a9f59974bdb5f57dde933c8283329f7f6ab13814ff15e457f4607638bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1491,6 +1491,11 @@ func (api *API) CreateInMemoryTaggedProvisionerDaemon(dialCtx context.Context, n | ||||||||||||
| dbTypes = append(dbTypes, database.ProvisionerType(tp)) | ||||||||||||
| } | ||||||||||||
| keyID, err := uuid.Parse(string(codersdk.ProvisionerKeyIDBuiltIn)) | ||||||||||||
| if err != nil { | ||||||||||||
| return nil, xerrors.Errorf("failed to parse built-in provisioner key ID: %w", err) | ||||||||||||
| } | ||||||||||||
Comment on lines +1494 to +1497 Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Suggested change
const (ProvisionerKeyIDBuiltIn="00000000-0000-0000-0000-000000000001"ProvisionerKeyIDUserAuth="00000000-0000-0000-0000-000000000002"ProvisionerKeyIDPSK="00000000-0000-0000-0000-000000000003") ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. They should be safe, but I'd rather just follow the no panic principal here so we at least return a proper error in the response | ||||||||||||
| //nolint:gocritic // in-memory provisioners are owned by system | ||||||||||||
| daemon, err := api.Database.UpsertProvisionerDaemon(dbauthz.AsSystemRestricted(dialCtx), database.UpsertProvisionerDaemonParams{ | ||||||||||||
| Name: name, | ||||||||||||
| @@ -1501,6 +1506,7 @@ func (api *API) CreateInMemoryTaggedProvisionerDaemon(dialCtx context.Context, n | ||||||||||||
| LastSeenAt: sql.NullTime{Time: dbtime.Now(), Valid: true}, | ||||||||||||
| Version: buildinfo.Version(), | ||||||||||||
| APIVersion: proto.CurrentVersion.String(), | ||||||||||||
| KeyID: keyID, | ||||||||||||
| }) | ||||||||||||
| if err != nil { | ||||||||||||
| return nil, xerrors.Errorf("failed to create in-memory provisioner daemon: %w", err) | ||||||||||||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.