Skip to content

Commit

Permalink
Improve setup for multiple SCEP providers (slightly)
Browse files Browse the repository at this point in the history
  • Loading branch information
hslatman committed Feb 19, 2021
1 parent 78d7858 commit 165f6a1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scep/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,18 @@ type nextHTTP = func(http.ResponseWriter, *http.Request)
func (h *Handler) lookupProvisioner(next nextHTTP) nextHTTP {
return func(w http.ResponseWriter, r *http.Request) {

// name := chi.URLParam(r, "provisionerID")
// provisionerID, err := url.PathUnescape(name)
// if err != nil {
// api.WriteError(w, fmt.Errorf("error url unescaping provisioner id '%s'", name))
// return
// }

// TODO: make this configurable; and we might want to look at being able to provide multiple,
// like the actual ACME one? The below assumes a SCEP provider (scep/) called "scep1" exists.
p, err := h.Auth.LoadProvisionerByID("scep/scep1")
// like the ACME one? The below assumes a SCEP provider (scep/) called "scep1" exists.
provisionerID := "scep1"

p, err := h.Auth.LoadProvisionerByID("scep/" + provisionerID)
if err != nil {
api.WriteError(w, err)
return
Expand Down

0 comments on commit 165f6a1

Please sign in to comment.