mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
feat(coderd): add endpoint to fetch provisioner key details (#15505)
This PR is the first step aiming to resolve #15126 - Creating a new endpoint to return the details associated to a provisioner key. This is an authenticated endpoints aiming to be used by the provisioner daemons - using the provisioner key as authentication method. This endpoint is not ment to be used with PSK or User Sessions.
This commit is contained in:
@ -343,6 +343,15 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
|
||||
r.Get("/", api.groupByOrganization)
|
||||
})
|
||||
})
|
||||
r.Route("/provisionerkeys", func(r chi.Router) {
|
||||
r.Use(
|
||||
httpmw.ExtractProvisionerDaemonAuthenticated(httpmw.ExtractProvisionerAuthConfig{
|
||||
DB: api.Database,
|
||||
Optional: false,
|
||||
}),
|
||||
)
|
||||
r.Get("/{provisionerkey}", api.fetchProvisionerKey)
|
||||
})
|
||||
r.Route("/organizations/{organization}/provisionerkeys", func(r chi.Router) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
|
Reference in New Issue
Block a user