MCPcopy Index your code
hub / github.com/coder/coder / idpSyncClaimFields

Method idpSyncClaimFields

enterprise/coderd/idpsync.go:762–781  ·  view source on GitHub ↗
(orgID uuid.UUID, rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

760}
761
762func (api *API) idpSyncClaimFields(orgID uuid.UUID, rw http.ResponseWriter, r *http.Request) {
763 ctx := r.Context()
764
765 fields, err := api.Database.OIDCClaimFields(ctx, orgID)
766 if httpapi.IsUnauthorizedError(err) {
767 // Give a helpful error. The user could read the org, so this does not
768 // leak anything.
769 httpapi.Write(ctx, rw, http.StatusForbidden, codersdk.Response{
770 Message: "You do not have permission to view the available IDP fields",
771 Detail: fmt.Sprintf("%s.read permission is required", rbac.ResourceIdpsyncSettings.Type),
772 })
773 return
774 }
775 if err != nil {
776 httpapi.InternalServerError(rw, err)
777 return
778 }
779
780 httpapi.Write(ctx, rw, http.StatusOK, fields)
781}
782
783// @Summary Get the organization idp sync claim field values
784// @ID get-the-organization-idp-sync-claim-field-values

Calls 5

IsUnauthorizedErrorFunction · 0.92
WriteFunction · 0.92
InternalServerErrorFunction · 0.92
ContextMethod · 0.65
OIDCClaimFieldsMethod · 0.65

Tested by

no test coverage detected