Skip to content

Commit

Permalink
refactor(trust): rename SDK method from getTrustedJwtGrantIssuer to…
Browse files Browse the repository at this point in the history
… `adminGetTrustedOAuth2JwtGrantIssuer`

BREAKING CHANGE: Rename SDK method from `getTrustedJwtGrantIssuer` to `adminGetTrustedOAuth2JwtGrantIssuer`.
  • Loading branch information
aeneasr committed Sep 7, 2022
1 parent 7edf8df commit 210116e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions oauth2/trust/handler.go
Expand Up @@ -29,7 +29,7 @@ func NewHandler(r InternalRegistry) *Handler {
}

func (h *Handler) SetRoutes(admin *httprouterx.RouterAdmin) {
admin.GET(grantJWTBearerPath+"/:id", h.Get)
admin.GET(grantJWTBearerPath+"/:id", h.adminGetTrustedOAuth2JwtGrantIssuer)
admin.GET(grantJWTBearerPath, h.List)
admin.POST(grantJWTBearerPath, h.adminTrustOAuth2JwtGrantIssuer)
admin.DELETE(grantJWTBearerPath+"/:id", h.Delete)
Expand Down Expand Up @@ -128,7 +128,16 @@ func (h *Handler) adminTrustOAuth2JwtGrantIssuer(w http.ResponseWriter, r *http.
h.registry.Writer().WriteCreated(w, r, grantJWTBearerPath+"/"+grant.ID, &grant)
}

// swagger:route GET /trust/grants/jwt-bearer/issuers/{id} admin getTrustedJwtGrantIssuer
// swagger:parameters adminGetTrustedOAuth2JwtGrantIssuer
type adminGetTrustedOAuth2JwtGrantIssuer struct {
// The id of the desired grant
//
// in: path
// required: true
ID string `json:"id"`
}

// swagger:route GET /admin/trust/grants/jwt-bearer/issuers/{id} v1 adminGetTrustedOAuth2JwtGrantIssuer
//
// Get a Trusted OAuth2 JWT Bearer Grant Type Issuer
//
Expand All @@ -144,10 +153,9 @@ func (h *Handler) adminTrustOAuth2JwtGrantIssuer(w http.ResponseWriter, r *http.
// Schemes: http, https
//
// Responses:
// 200: trustedJwtGrantIssuer
// 404: genericError
// 500: genericError
func (h *Handler) Get(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
// 200: trustedOAuth2JwtGrantIssuer
// default: genericError
func (h *Handler) adminGetTrustedOAuth2JwtGrantIssuer(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
var id = ps.ByName("id")

grant, err := h.registry.GrantManager().GetConcreteGrant(r.Context(), id)
Expand Down

0 comments on commit 210116e

Please sign in to comment.