Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions authentication/restapi/configure_auth_sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ func configureAPI(api *operations.AuthSampleAPI) http.Handler {
api.JSONProducer = runtime.JSONProducer()

// Applies when the "x-token" header is set
// snippet:keyauth
if api.KeyAuth == nil {
api.KeyAuth = func(token string) (*models.Principal, error) {
_ = token

return nil, errors.NotImplemented("api key auth (key) x-token from header param [x-token] has not yet been implemented")
}
}
// endsnippet:keyauth

// Set your custom authorizer if needed. Default one is security.Authorized()
// Expected interface runtime.Authorizer
Expand Down
2 changes: 0 additions & 2 deletions generated/restapi/configure_petstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func configureAPI(api *operations.PetstoreAPI) http.Handler {
api.JSONProducer = runtime.JSONProducer()
api.XMLProducer = runtime.XMLProducer()

// snippet:auth
// Applies when the "api_key" header is set
if api.APIKeyAuth == nil {
api.APIKeyAuth = func(token string) (any, error) {
Expand All @@ -61,7 +60,6 @@ func configureAPI(api *operations.PetstoreAPI) http.Handler {
return nil, errors.NotImplemented("oauth2 bearer auth (petstore_auth) has not yet been implemented")
}
}
// endsnippet:auth

// Set your custom authorizer if needed. Default one is security.Authorized()
// Expected interface runtime.Authorizer
Expand Down
2 changes: 0 additions & 2 deletions task-tracker/restapi/configure_task_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func configureAPI(api *operations.TaskTrackerAPI) http.Handler {

api.JSONProducer = runtime.JSONProducer()

// snippet:auth
// Applies when the "token" query is set
if api.APIKeyAuth == nil {
api.APIKeyAuth = func(token string) (any, error) {
Expand All @@ -57,7 +56,6 @@ func configureAPI(api *operations.TaskTrackerAPI) http.Handler {
return nil, errors.NotImplemented("api key auth (token_header) X-Token from header param [X-Token] has not yet been implemented")
}
}
// endsnippet:auth

// Set your custom authorizer if needed. Default one is security.Authorized()
// Expected interface runtime.Authorizer
Expand Down
2 changes: 0 additions & 2 deletions todo-list-strict/restapi/configure_simple_to_do_list_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func configureAPI(api *operations.SimpleToDoListAPIAPI) http.Handler {
// You may change here the memory limit for this multipart form parser. Below is the default (32 MB).
// todos.FindMaxParseMemory = 32 << 20

// snippet:strict-handler
if api.TodosAddOneHandler == nil {
api.TodosAddOneHandler = todos.AddOneHandlerFunc(func(params todos.AddOneParams, principal any) todos.AddOneResponder {
_ = params
Expand All @@ -64,7 +63,6 @@ func configureAPI(api *operations.SimpleToDoListAPIAPI) http.Handler {
return todos.AddOneNotImplemented()
})
}
// endsnippet:strict-handler
if api.TodosDestroyOneHandler == nil {
api.TodosDestroyOneHandler = todos.DestroyOneHandlerFunc(func(params todos.DestroyOneParams, principal any) todos.DestroyOneResponder {
_ = params
Expand Down
Loading