From 939525321021bed4f980ef089f9e621e1fba5c65 Mon Sep 17 00:00:00 2001 From: Aidan Carson Date: Thu, 22 Feb 2024 12:30:54 -0800 Subject: [PATCH] Remove passthrough --- api/v1/openapi.yaml | 34 +----------------------- pkg/api/v1/server.gen.go | 57 ++++++++++++---------------------------- pkg/api/v1/spec.gen.go | 50 +++++++++++++++++------------------ pkg/api/v1/types.gen.go | 21 +++------------ 4 files changed, 45 insertions(+), 117 deletions(-) diff --git a/api/v1/openapi.yaml b/api/v1/openapi.yaml index 88235c3..bfddf71 100644 --- a/api/v1/openapi.yaml +++ b/api/v1/openapi.yaml @@ -11,7 +11,7 @@ paths: description: Creates an application of type oauth2. This is intended to be integrated with an Open Id Connect Provider that the IDP Connect implementation integrates with. Note that the `clientSecret` is never stored in the database and is shown to the user only once. Keep this secret to make future requests to the API products in the Portal. operationId: CreateOAuthApplication requestBody: - description: (Required) name for creating name of the client. `passthrough` is directly passed to the IDP Connect implementation that will create the client in the Open Id Connect Provider. + description: (Required) name for creating name of the client. required: true content: application/json: @@ -23,8 +23,6 @@ paths: name: type: string example: "example-user-pool-developer-1" - passthrough: - type: object responses: '201': content: @@ -41,16 +39,6 @@ paths: clientName: type: string example: "example-user-pool-developer-1" - passthroughResponse: - type: object - example: { - UserPoolClient: { - AllowedOAuthScopes: [ - "email", - "openid" - ], - } - } description: Successfully created client. '400': description: Invalid input. @@ -78,11 +66,6 @@ paths: description: (Required) ID for application to delete. schema: type: string - - in: query - name: "passthrough" - description: Optionally include passthrough data as a json string. - schema: - type: string responses: '204': description: Successfully deleted application. @@ -127,11 +110,6 @@ paths: items: type: string example: "example-api-product" - passthrough: - type: object - example: { - UserPoolId: "example-user-pool" - } responses: '204': description: Successfully added API Product to application. @@ -172,11 +150,6 @@ paths: properties: apiProduct: $ref: '#/components/schemas/ApiProduct' - passthrough: - type: object - example: { - UserPoolId: "example-user-pool" - } responses: '201': description: Successfully created API Product. @@ -212,11 +185,6 @@ paths: description: (Required) Name of the API Product we'd like to delete. schema: type: string - - in: query - name: "passthrough" - description: Optionally include passthrough data. - schema: - type: string responses: '204': description: Successfully deleted API Product. diff --git a/pkg/api/v1/server.gen.go b/pkg/api/v1/server.gen.go index 2351432..a5b06ff 100644 --- a/pkg/api/v1/server.gen.go +++ b/pkg/api/v1/server.gen.go @@ -16,19 +16,19 @@ import ( // ServerInterface represents all server handlers. type ServerInterface interface { - // Creates API Product in the OpenID Connect Provider. Then, you can add this API Product to the application for your Portal applications with the `PUT /applications/{id}/api-products` API request + // Creates API Product in the OpenID Connect Provider. Then, you can add this API Product to the application for your Portal applications with the `PUT /applications/{id}/api-products` API request. // (POST /api-products) CreateAPIProduct(ctx echo.Context) error // Deletes API Product in the OpenID Connect Provider. // (DELETE /api-products/{name}) - DeleteAPIProduct(ctx echo.Context, name string, params DeleteAPIProductParams) error - // Creates a client in the OpenID Connect Provider. + DeleteAPIProduct(ctx echo.Context, name string) error + // Creates an application of type oauth2. // (POST /applications/oauth2) CreateOAuthApplication(ctx echo.Context) error // Deletes an application in the OpenID Connect Provider. // (DELETE /applications/{id}) - DeleteApplication(ctx echo.Context, id string, params DeleteApplicationParams) error - // Adds API Product to a application in the OpenID Connect Provider + DeleteApplication(ctx echo.Context, id string) error + // Updates the set of API Products that the application has access to in the OpenID Connect Provider. // (PUT /applications/{id}/api-products) UpdateAppAPIProducts(ctx echo.Context, id string) error } @@ -58,17 +58,8 @@ func (w *ServerInterfaceWrapper) DeleteAPIProduct(ctx echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) } - // Parameter object where we will unmarshal all parameters from the context - var params DeleteAPIProductParams - // ------------- Optional query parameter "passthrough" ------------- - - err = runtime.BindQueryParameter("form", true, false, "passthrough", ctx.QueryParams(), ¶ms.Passthrough) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter passthrough: %s", err)) - } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteAPIProduct(ctx, name, params) + err = w.Handler.DeleteAPIProduct(ctx, name) return err } @@ -92,17 +83,8 @@ func (w *ServerInterfaceWrapper) DeleteApplication(ctx echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) } - // Parameter object where we will unmarshal all parameters from the context - var params DeleteApplicationParams - // ------------- Optional query parameter "passthrough" ------------- - - err = runtime.BindQueryParameter("form", true, false, "passthrough", ctx.QueryParams(), ¶ms.Passthrough) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter passthrough: %s", err)) - } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteApplication(ctx, id, params) + err = w.Handler.DeleteApplication(ctx, id) return err } @@ -202,8 +184,7 @@ func (response CreateAPIProduct500JSONResponse) VisitCreateAPIProductResponse(w } type DeleteAPIProductRequestObject struct { - Name string `json:"name"` - Params DeleteAPIProductParams + Name string `json:"name"` } type DeleteAPIProductResponseObject interface { @@ -245,10 +226,9 @@ type CreateOAuthApplicationResponseObject interface { } type CreateOAuthApplication201JSONResponse struct { - ClientId *string `json:"clientId,omitempty"` - ClientName *string `json:"clientName,omitempty"` - ClientSecret *string `json:"clientSecret,omitempty"` - PassthroughResponse *map[string]interface{} `json:"passthroughResponse,omitempty"` + ClientId *string `json:"clientId,omitempty"` + ClientName *string `json:"clientName,omitempty"` + ClientSecret *string `json:"clientSecret,omitempty"` } func (response CreateOAuthApplication201JSONResponse) VisitCreateOAuthApplicationResponse(w http.ResponseWriter) error { @@ -277,8 +257,7 @@ func (response CreateOAuthApplication500JSONResponse) VisitCreateOAuthApplicatio } type DeleteApplicationRequestObject struct { - Id string `json:"id"` - Params DeleteApplicationParams + Id string `json:"id"` } type DeleteApplicationResponseObject interface { @@ -357,19 +336,19 @@ func (response UpdateAppAPIProducts500JSONResponse) VisitUpdateAppAPIProductsRes // StrictServerInterface represents all server handlers. type StrictServerInterface interface { - // Creates API Product in the OpenID Connect Provider. Then, you can add this API Product to the application for your Portal applications with the `PUT /applications/{id}/api-products` API request + // Creates API Product in the OpenID Connect Provider. Then, you can add this API Product to the application for your Portal applications with the `PUT /applications/{id}/api-products` API request. // (POST /api-products) CreateAPIProduct(ctx context.Context, request CreateAPIProductRequestObject) (CreateAPIProductResponseObject, error) // Deletes API Product in the OpenID Connect Provider. // (DELETE /api-products/{name}) DeleteAPIProduct(ctx context.Context, request DeleteAPIProductRequestObject) (DeleteAPIProductResponseObject, error) - // Creates a client in the OpenID Connect Provider. + // Creates an application of type oauth2. // (POST /applications/oauth2) CreateOAuthApplication(ctx context.Context, request CreateOAuthApplicationRequestObject) (CreateOAuthApplicationResponseObject, error) // Deletes an application in the OpenID Connect Provider. // (DELETE /applications/{id}) DeleteApplication(ctx context.Context, request DeleteApplicationRequestObject) (DeleteApplicationResponseObject, error) - // Adds API Product to a application in the OpenID Connect Provider + // Updates the set of API Products that the application has access to in the OpenID Connect Provider. // (PUT /applications/{id}/api-products) UpdateAppAPIProducts(ctx context.Context, request UpdateAppAPIProductsRequestObject) (UpdateAppAPIProductsResponseObject, error) } @@ -416,11 +395,10 @@ func (sh *strictHandler) CreateAPIProduct(ctx echo.Context) error { } // DeleteAPIProduct operation middleware -func (sh *strictHandler) DeleteAPIProduct(ctx echo.Context, name string, params DeleteAPIProductParams) error { +func (sh *strictHandler) DeleteAPIProduct(ctx echo.Context, name string) error { var request DeleteAPIProductRequestObject request.Name = name - request.Params = params handler := func(ctx echo.Context, request interface{}) (interface{}, error) { return sh.ssi.DeleteAPIProduct(ctx.Request().Context(), request.(DeleteAPIProductRequestObject)) @@ -471,11 +449,10 @@ func (sh *strictHandler) CreateOAuthApplication(ctx echo.Context) error { } // DeleteApplication operation middleware -func (sh *strictHandler) DeleteApplication(ctx echo.Context, id string, params DeleteApplicationParams) error { +func (sh *strictHandler) DeleteApplication(ctx echo.Context, id string) error { var request DeleteApplicationRequestObject request.Id = id - request.Params = params handler := func(ctx echo.Context, request interface{}) (interface{}, error) { return sh.ssi.DeleteApplication(ctx.Request().Context(), request.(DeleteApplicationRequestObject)) diff --git a/pkg/api/v1/spec.gen.go b/pkg/api/v1/spec.gen.go index 2b5b961..337e064 100644 --- a/pkg/api/v1/spec.gen.go +++ b/pkg/api/v1/spec.gen.go @@ -18,32 +18,30 @@ import ( // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/+RY8U8buRL+V0b7ntRWCkmA8Er4LYV3p+h0JSrlpwoJs54kbndt1/aGRij/+2nsTeLd", - "LCz0KJx0EhLZXXtmPDPf58++S1KVayVROpuc3CU2nWPO/M+RFhOjeJE6etJGaTROoP/G0aZGaCeUpEf8", - "wXKdYXKy/gWjyRjK2RAP7iRuqWmgdUbIWbLqJJLl2Ghkj2mxp8sQdiauOonB74UwyJOTL8HK1aqT/N8Y", - "ZXYjThX3XkorQjqcoSH/OVrLZrUQLhxzhYVTxRH+LAc0xG6Q2XoKfABQfmkL24e1jWFj8WpFI4Wcqp10", - "Jx9wqgzCUhVwgzMhO2DRQaHh90wpmGTMTZXJYaKMYxncCjensQbONcrxGZwqKTF18PZ8fHb6DrRRC8HR", - "dOHzHGUY7ubCwvhsshk7mow73mHKJORMshmCmyOkmaDOASZ5XHILQpY+x2enGxfg5szBDB0wa1UqmEMe", - "xVcGzLTORMposbYLvykDOS2XcmFy/5oWHPx/aVwyV6m9ejt3TtuTXo+eulZlqitUb5Yptaf9sF7GHFrX", - "e9elKgnni9dor5aJpJMs0NhQjP1uv9unVlAaJdMiOUkO/atOopmb+97rRY3sX2hl3W5dTw1SRBXsCOnX", - "SaWDMd9EMVkXLfGOjU/LmG+MjCbjyQY41G9o3QfFlwEJ0qH0/qNU976WjRwYYBdArEIH/zU4TU6S//S2", - "9NEruaMXEceKsmCtmxtVzOYVnNwllxbNRKnMx73GfGHR7GmlMppbYkfdfEUyVsNOFNHV7thVpzG9lexO", - "lWluxUoPJrFbZwr0cVitpA2pOejv71bzokhTtHZaZNkS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vcCvClNXevRM6hvBxaLV", + "iU2PmLIoqF4fhk7EevMG3e1IjTIWaC82YaU3EWXp5+8+tqrJE+Fm/v4dJPFvyR1nmwYR3HhXFTg9B9GF", + "cSCJidQdBL0mgSR37qzbhPHN0eL+IE/9+wcxSQAWLPgKBZSCfy4ROENheca7eCa4aPCMopoWaFG7LNoh", + "Pf+rwuMLeE0LBJn5cOIIv+AzBjn/hK7uITXnl7vtjktJrRXCf22I96LJax+613vwHx6Af/DfBf/h4+JQ", + "SEd6pWBPCEFfjAMQPDBzXRA8NPMReiQt7fLs8NnpkByh1U3ZWiGE7Q7z3ID758rHkLlJu0X/uNC7A4WK", + "+3HiNYzLKlYF3Gm/AoUNbrf2AiX04bW0uNt5E2TTW0w12hsXj8AVajBWamR11Ri19JYa9OKKGzBL+UXU", + "lFQa1CBFvgYpUuzDH4gq8JfxVt26gn5CyEpbaqxpxtT7Xb1VJNbcu8Bo90mKN5PSLie72v4wYXG//ndJ", + "nigp8xOGK8zdppPTI28CR6iLiJLcHs+A28NGRCQV2nW0qPjOOgQvruJxLejgcvQSf2EDpKNhdnE5Ss8v", + "z15e3qZ0iKPz4VnXrSRYev1P61obCnPaNJWOhuyWXVyesYvREC8pHQxH58NslL7EbJBdnHV26WBHOgVY", + "Xf2n015PrHu2BeiUPN9mvJhiIz7tolgnUA6LitjZvaqgwRLHyoLZNGiQKJlDOoCzR1IBjaQfTQVElfhP", + "qYBmNTpVQGsqHyAEjpjS/ft02SEJ3itGm/P6rKFOzP74hi0TpXa61jxgguOGzaZuet2tonmh+IGT/GNv", + "9f6RWyzMd3yM276gWtP1N6795qiTedIqW7ibGIUpz3japqBDh/IhkFPGsN2mDsQ/0bX/f0g0lLEWzbRw", + "2+ScgFrjGcagdUdg41vkVnfHBpfUAPVD4Lr9/fzkIkG9qrmh1DkZk/rTI1W8H744Vl8Uq0+P/VQWyeqU", + "bK43fwcAAP//n2nwxoEXAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/pkg/api/v1/types.gen.go b/pkg/api/v1/types.gen.go index e81e31e..59aefc4 100644 --- a/pkg/api/v1/types.gen.go +++ b/pkg/api/v1/types.gen.go @@ -18,32 +18,17 @@ type Error struct { // CreateAPIProductJSONBody defines parameters for CreateAPIProduct. type CreateAPIProductJSONBody struct { - ApiProduct ApiProduct `json:"apiProduct"` - Passthrough *map[string]interface{} `json:"passthrough,omitempty"` -} - -// DeleteAPIProductParams defines parameters for DeleteAPIProduct. -type DeleteAPIProductParams struct { - // Passthrough Optionally include passthrough data. - Passthrough *string `form:"passthrough,omitempty" json:"passthrough,omitempty"` + ApiProduct ApiProduct `json:"apiProduct"` } // CreateOAuthApplicationJSONBody defines parameters for CreateOAuthApplication. type CreateOAuthApplicationJSONBody struct { - Name string `json:"name"` - Passthrough *map[string]interface{} `json:"passthrough,omitempty"` -} - -// DeleteApplicationParams defines parameters for DeleteApplication. -type DeleteApplicationParams struct { - // Passthrough Optionally include passthrough data as a json string. - Passthrough *string `form:"passthrough,omitempty" json:"passthrough,omitempty"` + Name string `json:"name"` } // UpdateAppAPIProductsJSONBody defines parameters for UpdateAppAPIProducts. type UpdateAppAPIProductsJSONBody struct { - ApiProducts []string `json:"apiProducts"` - Passthrough *map[string]interface{} `json:"passthrough,omitempty"` + ApiProducts []string `json:"apiProducts"` } // CreateAPIProductJSONRequestBody defines body for CreateAPIProduct for application/json ContentType.