From 29a4462efd5eaeb57c7e78fe6bb08ce0f7ddcd67 Mon Sep 17 00:00:00 2001 From: SM43 Date: Mon, 25 Jan 2021 10:55:39 +0530 Subject: [PATCH] Adds an API to refresh User access token This adds an API to refresh access token for user. This requires user refresh token to be passed to get a new access token. Signed-off-by: Shivam Mukhade --- api/cmd/api/http.go | 10 + api/cmd/api/main.go | 7 + api/design/api.go | 1 + api/design/types/type.go | 6 + api/design/user.go | 57 +++++ api/gen/admin/endpoints.go | 4 +- api/gen/catalog/endpoints.go | 2 +- api/gen/http/cli/hub/cli.go | 50 +++++ api/gen/http/openapi.json | 2 +- api/gen/http/openapi.yaml | 237 ++++++++++++++++++-- api/gen/http/openapi3.json | 2 +- api/gen/http/openapi3.yaml | 184 ++++++++++++--- api/gen/http/user/client/cli.go | 25 +++ api/gen/http/user/client/client.go | 79 +++++++ api/gen/http/user/client/encode_decode.go | 168 ++++++++++++++ api/gen/http/user/client/paths.go | 13 ++ api/gen/http/user/client/types.go | 258 ++++++++++++++++++++++ api/gen/http/user/server/encode_decode.go | 134 +++++++++++ api/gen/http/user/server/paths.go | 13 ++ api/gen/http/user/server/server.go | 179 +++++++++++++++ api/gen/http/user/server/types.go | 154 +++++++++++++ api/gen/rating/endpoints.go | 4 +- api/gen/user/client.go | 37 ++++ api/gen/user/endpoints.go | 53 +++++ api/gen/user/service.go | 94 ++++++++ api/pkg/service/user/user.go | 130 +++++++++++ api/pkg/service/user/user_http_test.go | 126 +++++++++++ api/pkg/service/user/user_test.go | 73 ++++++ api/test/fixtures/users.yaml | 8 + 29 files changed, 2051 insertions(+), 59 deletions(-) create mode 100644 api/design/user.go create mode 100644 api/gen/http/user/client/cli.go create mode 100644 api/gen/http/user/client/client.go create mode 100644 api/gen/http/user/client/encode_decode.go create mode 100644 api/gen/http/user/client/paths.go create mode 100644 api/gen/http/user/client/types.go create mode 100644 api/gen/http/user/server/encode_decode.go create mode 100644 api/gen/http/user/server/paths.go create mode 100644 api/gen/http/user/server/server.go create mode 100644 api/gen/http/user/server/types.go create mode 100644 api/gen/user/client.go create mode 100644 api/gen/user/endpoints.go create mode 100644 api/gen/user/service.go create mode 100644 api/pkg/service/user/user.go create mode 100644 api/pkg/service/user/user_http_test.go create mode 100644 api/pkg/service/user/user_test.go diff --git a/api/cmd/api/http.go b/api/cmd/api/http.go index 89b9657068..2308726c9c 100644 --- a/api/cmd/api/http.go +++ b/api/cmd/api/http.go @@ -38,10 +38,12 @@ import ( resourcesvr "github.com/tektoncd/hub/api/gen/http/resource/server" statussvr "github.com/tektoncd/hub/api/gen/http/status/server" swaggersvr "github.com/tektoncd/hub/api/gen/http/swagger/server" + usersvr "github.com/tektoncd/hub/api/gen/http/user/server" "github.com/tektoncd/hub/api/gen/log" rating "github.com/tektoncd/hub/api/gen/rating" resource "github.com/tektoncd/hub/api/gen/resource" status "github.com/tektoncd/hub/api/gen/status" + user "github.com/tektoncd/hub/api/gen/user" v1resourcesvr "github.com/tektoncd/hub/api/v1/gen/http/resource/server" v1swaggersvr "github.com/tektoncd/hub/api/v1/gen/http/swagger/server" v1resource "github.com/tektoncd/hub/api/v1/gen/resource" @@ -59,6 +61,7 @@ func handleHTTPServer( resourceEndpoints *resource.Endpoints, v1resourceEndpoints *v1resource.Endpoints, statusEndpoints *status.Endpoints, + userEndpoints *user.Endpoints, wg *sync.WaitGroup, errc chan error, logger *log.Logger, debug bool) { // Setup goa log adapter. @@ -100,6 +103,7 @@ func handleHTTPServer( statusServer *statussvr.Server swaggerServer *swaggersvr.Server v1swaggerServer *v1swaggersvr.Server + userServer *usersvr.Server ) { eh := errorHandler(logger) @@ -113,6 +117,7 @@ func handleHTTPServer( statusServer = statussvr.New(statusEndpoints, mux, dec, enc, eh, nil) swaggerServer = swaggersvr.New(nil, mux, dec, enc, eh, nil) v1swaggerServer = v1swaggersvr.New(nil, mux, dec, enc, eh, nil) + userServer = usersvr.New(userEndpoints, mux, dec, enc, eh, nil) if debug { servers := goahttp.Servers{ @@ -126,6 +131,7 @@ func handleHTTPServer( statusServer, swaggerServer, v1swaggerServer, + userServer, } servers.Use(httpmdlwr.Debug(mux, os.Stdout)) } @@ -141,6 +147,7 @@ func handleHTTPServer( statussvr.Mount(mux, statusServer) swaggersvr.Mount(mux, swaggerServer) v1swaggersvr.Mount(mux, v1swaggerServer) + usersvr.Mount(mux, userServer) // Wrap the multiplexer with additional middlewares. Middlewares mounted // here apply to all the service endpoints. @@ -183,6 +190,9 @@ func handleHTTPServer( for _, m := range v1swaggerServer.Mounts { logger.Infof("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern) } + for _, m := range userServer.Mounts { + logger.Infof("HTTP %q mounted on %s %s", m.Method, m.Verb, m.Pattern) + } (*wg).Add(1) go func() { diff --git a/api/cmd/api/main.go b/api/cmd/api/main.go index 06268a0d2a..3f3d6e8189 100644 --- a/api/cmd/api/main.go +++ b/api/cmd/api/main.go @@ -32,6 +32,7 @@ import ( rating "github.com/tektoncd/hub/api/gen/rating" resource "github.com/tektoncd/hub/api/gen/resource" status "github.com/tektoncd/hub/api/gen/status" + user "github.com/tektoncd/hub/api/gen/user" "github.com/tektoncd/hub/api/pkg/app" "github.com/tektoncd/hub/api/pkg/db/initializer" adminsvc "github.com/tektoncd/hub/api/pkg/service/admin" @@ -41,6 +42,7 @@ import ( ratingsvc "github.com/tektoncd/hub/api/pkg/service/rating" resourcesvc "github.com/tektoncd/hub/api/pkg/service/resource" statussvc "github.com/tektoncd/hub/api/pkg/service/status" + usersvc "github.com/tektoncd/hub/api/pkg/service/user" v1resource "github.com/tektoncd/hub/api/v1/gen/resource" v1resourcesvc "github.com/tektoncd/hub/api/v1/service/resource" ) @@ -89,6 +91,7 @@ func main() { resourceSvc resource.Service v1resourceSvc v1resource.Service statusSvc status.Service + userSvc user.Service ) { adminSvc = adminsvc.New(api) @@ -99,6 +102,7 @@ func main() { resourceSvc = resourcesvc.New(api) v1resourceSvc = v1resourcesvc.New(api) statusSvc = statussvc.New(api) + userSvc = usersvc.New(api) } // Wrap the services in endpoints that can be invoked from other services @@ -112,6 +116,7 @@ func main() { resourceEndpoints *resource.Endpoints v1resourceEndpoints *v1resource.Endpoints statusEndpoints *status.Endpoints + userEndpoints *user.Endpoints ) { adminEndpoints = admin.NewEndpoints(adminSvc) @@ -122,6 +127,7 @@ func main() { resourceEndpoints = resource.NewEndpoints(resourceSvc) v1resourceEndpoints = v1resource.NewEndpoints(v1resourceSvc) statusEndpoints = status.NewEndpoints(statusSvc) + userEndpoints = user.NewEndpoints(userSvc) } // Create channel used by both the signal handler and server goroutines @@ -171,6 +177,7 @@ func main() { resourceEndpoints, v1resourceEndpoints, statusEndpoints, + userEndpoints, &wg, errc, api.Logger("http"), *dbgF, ) } diff --git a/api/design/api.go b/api/design/api.go index d1438c37e6..1356a5a617 100644 --- a/api/design/api.go +++ b/api/design/api.go @@ -41,6 +41,7 @@ var _ = API("hub", func() { "resource", "status", "swagger", + "user", ) }) diff --git a/api/design/types/type.go b/api/design/types/type.go index b34e94caca..4ae7738e73 100644 --- a/api/design/types/type.go +++ b/api/design/types/type.go @@ -284,6 +284,7 @@ var JWTAuth = JWTSecurity("jwt", func() { Scope("agent:create", "Access to create or update an agent") Scope("catalog:refresh", "Access to refresh catalog") Scope("config:refresh", "Access to refresh config file") + Scope("refresh:token", "Access to refresh user access token") }) var HubService = Type("HubService", func() { @@ -357,3 +358,8 @@ var AuthTokens = Type("AuthTokens", func() { Attribute("access", Token, "Access Token") Attribute("refresh", Token, "Refresh Token") }) + +var AccessToken = Type("AccessToken", func() { + Description("Access Token for User") + Attribute("access", Token, "Access Token for user") +}) diff --git a/api/design/user.go b/api/design/user.go new file mode 100644 index 0000000000..afae01a275 --- /dev/null +++ b/api/design/user.go @@ -0,0 +1,57 @@ +// Copyright © 2021 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package design + +import ( + "github.com/tektoncd/hub/api/design/types" + . "goa.design/goa/v3/dsl" +) + +var _ = Service("user", func() { + Description("The user service exposes endpoint to get user specific specs") + + Error("invalid-token", ErrorResult, "Invalid User token") + Error("invalid-scopes", ErrorResult, "Invalid User scope") + Error("internal-error", ErrorResult, "Internal Server Error") + + Method("RefreshAccessToken", func() { + Description("Refresh the access token of User") + Security(types.JWTAuth, func() { + Scope("refresh:token") + }) + Payload(func() { + Token("refreshToken", String, "Refresh Token of User", func() { + Example("refreshToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9."+ + "eyJleHAiOjE1Nzc4ODM2MDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJlZnJlc2g6dG9rZW4iXSwidHlwZSI6InJlZnJlc2gtdG9rZW4ifQ."+ + "4RdUk5ttHdDiymurlZ_f7Uy5Pas3Lq9w04BjKQKRiCE") + }) + Required("refreshToken") + }) + Result(func() { + Attribute("data", types.AccessToken, "User Access JWT") + Required("data") + }) + + HTTP(func() { + POST("/user/refresh/accesstoken") + Header("refreshToken:Authorization") + + Response(StatusOK) + Response("internal-error", StatusInternalServerError) + Response("invalid-token", StatusUnauthorized) + Response("invalid-scopes", StatusForbidden) + }) + }) +}) diff --git a/api/gen/admin/endpoints.go b/api/gen/admin/endpoints.go index 9386d65d75..1a588adbe9 100644 --- a/api/gen/admin/endpoints.go +++ b/api/gen/admin/endpoints.go @@ -44,7 +44,7 @@ func NewUpdateAgentEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpo var err error sc := security.JWTScheme{ Name: "jwt", - Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh"}, + Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh", "refresh:token"}, RequiredScopes: []string{"agent:create"}, } ctx, err = authJWTFn(ctx, p.Token, &sc) @@ -63,7 +63,7 @@ func NewRefreshConfigEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.End var err error sc := security.JWTScheme{ Name: "jwt", - Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh"}, + Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh", "refresh:token"}, RequiredScopes: []string{"config:refresh"}, } ctx, err = authJWTFn(ctx, p.Token, &sc) diff --git a/api/gen/catalog/endpoints.go b/api/gen/catalog/endpoints.go index ae6ca2915f..350c201e7b 100644 --- a/api/gen/catalog/endpoints.go +++ b/api/gen/catalog/endpoints.go @@ -41,7 +41,7 @@ func NewRefreshEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint var err error sc := security.JWTScheme{ Name: "jwt", - Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh"}, + Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh", "refresh:token"}, RequiredScopes: []string{"catalog:refresh"}, } ctx, err = authJWTFn(ctx, p.Token, &sc) diff --git a/api/gen/http/cli/hub/cli.go b/api/gen/http/cli/hub/cli.go index 736af20a82..97cca17c0f 100644 --- a/api/gen/http/cli/hub/cli.go +++ b/api/gen/http/cli/hub/cli.go @@ -20,6 +20,7 @@ import ( ratingc "github.com/tektoncd/hub/api/gen/http/rating/client" resourcec "github.com/tektoncd/hub/api/gen/http/resource/client" statusc "github.com/tektoncd/hub/api/gen/http/status/client" + userc "github.com/tektoncd/hub/api/gen/http/user/client" goahttp "goa.design/goa/v3/http" goa "goa.design/goa/v3/pkg" ) @@ -36,6 +37,7 @@ category list rating (get|update) resource (query|list|versions-by-id|by-catalog-kind-name-version|by-version-id|by-catalog-kind-name|by-id) status status +user refresh-access-token ` } @@ -135,6 +137,11 @@ func ParseEndpoint( statusFlags = flag.NewFlagSet("status", flag.ContinueOnError) statusStatusFlags = flag.NewFlagSet("status", flag.ExitOnError) + + userFlags = flag.NewFlagSet("user", flag.ContinueOnError) + + userRefreshAccessTokenFlags = flag.NewFlagSet("refresh-access-token", flag.ExitOnError) + userRefreshAccessTokenRefreshTokenFlag = userRefreshAccessTokenFlags.String("refresh-token", "REQUIRED", "") ) adminFlags.Usage = adminUsage adminUpdateAgentFlags.Usage = adminUpdateAgentUsage @@ -165,6 +172,9 @@ func ParseEndpoint( statusFlags.Usage = statusUsage statusStatusFlags.Usage = statusStatusUsage + userFlags.Usage = userUsage + userRefreshAccessTokenFlags.Usage = userRefreshAccessTokenUsage + if err := flag.CommandLine.Parse(os.Args[1:]); err != nil { return nil, nil, err } @@ -194,6 +204,8 @@ func ParseEndpoint( svcf = resourceFlags case "status": svcf = statusFlags + case "user": + svcf = userFlags default: return nil, nil, fmt.Errorf("unknown service %q", svcn) } @@ -282,6 +294,13 @@ func ParseEndpoint( } + case "user": + switch epn { + case "refresh-access-token": + epf = userRefreshAccessTokenFlags + + } + } } if epf == nil { @@ -375,6 +394,13 @@ func ParseEndpoint( endpoint = c.Status() data = nil } + case "user": + c := userc.NewClient(scheme, host, doer, enc, dec, restore) + switch epn { + case "refresh-access-token": + endpoint = c.RefreshAccessToken() + data, err = userc.BuildRefreshAccessTokenPayload(*userRefreshAccessTokenRefreshTokenFlag) + } } } if err != nil { @@ -675,3 +701,27 @@ Example: `+os.Args[0]+` status status `, os.Args[0]) } + +// userUsage displays the usage of the user command and its subcommands. +func userUsage() { + fmt.Fprintf(os.Stderr, `The user service exposes endpoint to get user specific specs +Usage: + %s [globalflags] user COMMAND [flags] + +COMMAND: + refresh-access-token: Refresh the access token of User + +Additional help: + %s user COMMAND --help +`, os.Args[0], os.Args[0]) +} +func userRefreshAccessTokenUsage() { + fmt.Fprintf(os.Stderr, `%s [flags] user refresh-access-token -refresh-token STRING + +Refresh the access token of User + -refresh-token STRING: + +Example: + `+os.Args[0]+` user refresh-access-token --refresh-token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODM2MDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJlZnJlc2g6dG9rZW4iXSwidHlwZSI6InJlZnJlc2gtdG9rZW4ifQ.4RdUk5ttHdDiymurlZ_f7Uy5Pas3Lq9w04BjKQKRiCE" +`, os.Args[0]) +} diff --git a/api/gen/http/openapi.json b/api/gen/http/openapi.json index b9c1af4d01..14142aef1b 100644 --- a/api/gen/http/openapi.json +++ b/api/gen/http/openapi.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"title":"Tekton Hub","description":"HTTP services for managing Tekton Hub","version":"1.0"},"host":"api.hub.tekton.dev","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/StatusStatusResponseBody"}}},"schemes":["http"]}},"/auth/login":{"post":{"tags":["auth"],"summary":"Authenticate auth","description":"Authenticates users against GitHub OAuth","operationId":"auth#Authenticate","parameters":[{"name":"code","in":"query","description":"OAuth Authorization code of User","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AuthAuthenticateResponseBody","required":["data"]}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidCodeResponseBody"}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AuthAuthenticateInternalErrorResponseBody"}}},"schemes":["http"]}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refreshes Tekton Catalog\n\n**Required security scopes for jwt**:\n * `catalog:refresh`","operationId":"catalog#Refresh","parameters":[{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CatalogRefreshResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/CatalogRefreshNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CatalogRefreshInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CategoryListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CategoryListInternalErrorResponseBody"}}},"schemes":["http"]}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","required":false,"type":"string","default":""},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000},{"name":"match","in":"query","description":"Strategy used to find matching resources","required":false,"type":"string","default":"contains","enum":["exact","contains"]}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceQueryResponseBody"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/ResourceQueryInvalidKindResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceQueryNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceQueryInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByVersionIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByVersionIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByVersionIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"Name of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"name of resource","required":true,"type":"string"},{"name":"version","in":"path","description":"version of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{id}/rating":{"get":{"tags":["rating"],"summary":"Get rating","description":"Find user's rating for a resource\n\n**Required security scopes for jwt**:\n * `rating:read`","operationId":"rating#Get","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"},{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/RatingGetResponseBody","required":["rating"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/RatingGetInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/RatingGetInvalidScopesResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/RatingGetNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/RatingGetInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]},"put":{"tags":["rating"],"summary":"Update rating","description":"Update user's rating for a resource\n\n**Required security scopes for jwt**:\n * `rating:write`","operationId":"rating#Update","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"},{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"},{"name":"UpdateRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/RatingUpdateRequestBody","required":["rating"]}}],"responses":{"200":{"description":"OK response."},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/RatingUpdateInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/RatingUpdateInvalidScopesResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/RatingUpdateNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/RatingUpdateInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceListInternalErrorResponseBody"}}},"schemes":["http"]}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download gen/http/openapi3.yaml","description":"JSON document containing the API swagger definition","operationId":"swagger#/schema/swagger.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/system/config/refresh":{"post":{"tags":["admin"],"summary":"RefreshConfig admin","description":"Refresh the changes in config file\n\n**Required security scopes for jwt**:\n * `config:refresh`","operationId":"admin#RefreshConfig","parameters":[{"name":"Authorization","in":"header","description":"User JWT","required":true,"type":"string"},{"name":"RefreshConfigRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/AdminRefreshConfigRequestBody","required":["force"]}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AdminRefreshConfigResponseBody","required":["checksum"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/system/user/agent":{"put":{"tags":["admin"],"summary":"UpdateAgent admin","description":"Create or Update an agent user with required scopes\n\n**Required security scopes for jwt**:\n * `agent:create`","operationId":"admin#UpdateAgent","parameters":[{"name":"Authorization","in":"header","description":"User JWT","required":true,"type":"string"},{"name":"UpdateAgentRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/AdminUpdateAgentRequestBody","required":["name","scopes"]}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AdminUpdateAgentResponseBody","required":["token"]}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidPayloadResponseBody"}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/v1":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status#1","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/StatusStatusResponseBody"}}},"schemes":["http"]}},"/v1/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list#1","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CategoryListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CategoryListInternalErrorResponseBody"}}},"schemes":["http"]}}},"definitions":{"AdminRefreshConfigInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Token scopes (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigRequestBody":{"title":"AdminRefreshConfigRequestBody","type":"object","properties":{"force":{"type":"boolean","description":"Force Refresh the config file","example":false}},"example":{"force":true},"required":["force"]},"AdminRefreshConfigResponseBody":{"title":"AdminRefreshConfigResponseBody","type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"Eveniet nihil et beatae ex voluptas voluptas."}},"example":{"checksum":"Non molestiae illo aut numquam."},"required":["checksum"]},"AdminUpdateAgentInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidPayloadResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid request body (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Token scopes (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentRequestBody":{"title":"AdminUpdateAgentRequestBody","type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"Sed voluptatem nulla laborum ut."},"scopes":{"type":"array","items":{"type":"string","example":"Architecto rerum id quia."},"description":"Scopes required for Agent","example":["Eaque necessitatibus magni quia.","Perferendis suscipit voluptatem est.","Rerum autem dolores at."]}},"example":{"name":"Aliquam voluptates illo.","scopes":["Et ut pariatur similique ullam laudantium nostrum.","Totam magni reprehenderit maxime et velit.","Dolores dolor esse officia velit aliquid praesentium.","Sed optio ab beatae est."]},"required":["name","scopes"]},"AdminUpdateAgentResponseBody":{"title":"AdminUpdateAgentResponseBody","type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"Quis nostrum et ab placeat facere."}},"example":{"token":"Ipsum iusto et dolor vitae voluptatem."},"required":["token"]},"AuthAuthenticateInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidCodeResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Authorization code (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateResponseBody":{"title":"AuthAuthenticateResponseBody","type":"object","properties":{"data":{"$ref":"#/definitions/AuthTokensResponseBody"}},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"required":["data"]},"AuthTokensResponseBody":{"title":"AuthTokensResponseBody","type":"object","properties":{"access":{"$ref":"#/definitions/TokenResponseBody"},"refresh":{"$ref":"#/definitions/TokenResponseBody"}},"description":"Auth tokens have access and refresh token for user","example":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"CatalogRefreshInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"CatalogRefreshNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"CatalogRefreshResponseBody":{"title":"Mediatype identifier: application/vnd.hub.job; view=default","type":"object","properties":{"id":{"type":"integer","description":"id of the job","example":8951834590360407852,"format":"int64"},"status":{"type":"string","description":"status of the job","example":"Perspiciatis ut ut."}},"description":"RefreshResponseBody result type (default view)","example":{"id":10863881996075796435,"status":"Sed ipsa velit dolorem."},"required":["id","status"]},"CatalogResponseBody":{"title":"CatalogResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the catalog","example":1,"format":"int64"},"name":{"type":"string","description":"Name of catalog","example":"Tekton"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]}},"example":{"id":1,"name":"Tekton","type":"community"},"required":["id","name","type"]},"CategoryListInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"CategoryListResponseBody":{"title":"CategoryListResponseBody","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/CategoryResponseBody"},"example":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"CategoryResponseBody":{"title":"CategoryResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the category","example":1,"format":"int64"},"name":{"type":"string","description":"Name of category","example":"Image Builder"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"List of tags associated with the category","example":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}},"example":{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},"required":["id","name","tags"]},"HubServiceResponseBody":{"title":"HubServiceResponseBody","type":"object","properties":{"error":{"type":"string","description":"Details of the error if any","example":"unable to reach db"},"name":{"type":"string","description":"Name of the service","example":"api"},"status":{"type":"string","description":"Status of the service","example":"ok","enum":["ok","error"]}},"description":"Describes the services and their status","example":{"error":"unable to reach db","name":"api","status":"ok"},"required":["name","status"]},"RatingGetInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetResponseBody":{"title":"RatingGetResponseBody","type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":4,"format":"int64"}},"example":{"rating":4},"required":["rating"]},"RatingUpdateInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateRequestBody":{"title":"RatingUpdateRequestBody","type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":0,"minimum":0,"maximum":5}},"example":{"rating":1},"required":["rating"]},"ResourceByCatalogKindNameInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBody"}},"description":"ByCatalogKindNameResponseBody result type (default view)","example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceByCatalogKindNameVersionInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameVersionNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameVersionResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceVersionDataResponseBody"}},"description":"ByCatalogKindNameVersionResponseBody result type (default view)","example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceByIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBody"}},"description":"ByIdResponseBody result type (default view)","example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceByVersionIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByVersionIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByVersionIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceVersionDataResponseBody"}},"description":"ByVersionIdResponseBody result type (default view)","example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceDataResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/definitions/ResourceVersionDataResponseBodyWithoutResource"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]},"versions":{"type":"array","items":{"$ref":"#/definitions/ResourceVersionDataResponseBodyTiny"},"description":"List of all versions of a resource","example":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"description":"The resource type describes resource information.","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating","versions"]},"ResourceDataResponseBodyInfo":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]}},"description":"The resource type describes resource information. (default view)","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","kind","tags","rating"]},"ResourceDataResponseBodyWithoutVersion":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/definitions/ResourceVersionDataResponseBodyWithoutResource"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]}},"description":"The resource type describes resource information. (withoutVersion view) (default view)","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating"]},"ResourceDataResponseBodyWithoutVersionCollection":{"title":"Mediatype identifier: application/vnd.hub.resource.data; type=collection; view=default","type":"array","items":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersion"},"description":"ResourceDataResponseBodyWithoutVersionCollection is the result type for an array of ResourceDataResponseBodyWithoutVersion (default view)","example":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceListInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceListResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resources; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersionCollection"}},"description":"ListResponseBody result type (default view)","example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceQueryInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryInvalidKindResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid Resource Kind (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resources; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersionCollection"}},"description":"QueryResponseBody result type (default view)","example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceVersionDataResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"resource":{"$ref":"#/definitions/ResourceDataResponseBodyInfo"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","resource"]},"ResourceVersionDataResponseBodyMin":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (default view)","example":{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","rawURL","webURL"]},"ResourceVersionDataResponseBodyTiny":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"version":{"type":"string","description":"Version of resource","example":"0.1"}},"description":"The Version result type describes resource's version information. (default view)","example":{"id":1,"version":"0.1"},"required":["id","version"]},"ResourceVersionDataResponseBodyWithoutResource":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (default view)","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt"]},"ResourceVersionsByIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceVersionsByIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceVersionsByIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.versions; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/VersionsResponseBody"}},"description":"VersionsByIDResponseBody result type (default view)","example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"required":["data"]},"StatusStatusResponseBody":{"title":"StatusStatusResponseBody","type":"object","properties":{"services":{"type":"array","items":{"$ref":"#/definitions/HubServiceResponseBody"},"description":"List of services and their status","example":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"TagResponseBody":{"title":"TagResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of tag","example":1,"format":"int64"},"name":{"type":"string","description":"Name of tag","example":"image-build"}},"example":{"id":1,"name":"image-build"},"required":["id","name"]},"TokenResponseBody":{"title":"TokenResponseBody","type":"object","properties":{"expiresAt":{"type":"integer","description":"Time the token will expires at","example":0,"format":"int64"},"refreshInterval":{"type":"string","description":"Duration the token will Expire In","example":"1h30m"},"token":{"type":"string","description":"JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"description":"Token includes the JWT, Expire Duration \u0026 Time","example":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token","refreshInterval","expiresAt"]},"VersionsResponseBody":{"title":"Mediatype identifier: application/vnd.hub.versions; view=default","type":"object","properties":{"latest":{"$ref":"#/definitions/ResourceVersionDataResponseBodyMin"},"versions":{"type":"array","items":{"$ref":"#/definitions/ResourceVersionDataResponseBodyMin"},"description":"List of all versions of resource","example":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"description":"The Versions type describes response for versions by resource id API.","example":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]},"required":["latest","versions"]}},"securityDefinitions":{"jwt_header_Authorization":{"type":"apiKey","description":"Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint.\n\n**Security Scopes**:\n * `rating:read`: Read-only access to rating\n * `rating:write`: Read and write access to rating\n * `agent:create`: Access to create or update an agent\n * `catalog:refresh`: Access to refresh catalog\n * `config:refresh`: Access to refresh config file","name":"Authorization","in":"header"}}} \ No newline at end of file +{"swagger":"2.0","info":{"title":"Tekton Hub","description":"HTTP services for managing Tekton Hub","version":"1.0"},"host":"api.hub.tekton.dev","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/StatusStatusResponseBody"}}},"schemes":["http"]}},"/auth/login":{"post":{"tags":["auth"],"summary":"Authenticate auth","description":"Authenticates users against GitHub OAuth","operationId":"auth#Authenticate","parameters":[{"name":"code","in":"query","description":"OAuth Authorization code of User","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AuthAuthenticateResponseBody","required":["data"]}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidCodeResponseBody"}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AuthAuthenticateInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AuthAuthenticateInternalErrorResponseBody"}}},"schemes":["http"]}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refreshes Tekton Catalog\n\n**Required security scopes for jwt**:\n * `catalog:refresh`","operationId":"catalog#Refresh","parameters":[{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CatalogRefreshResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/CatalogRefreshNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CatalogRefreshInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CategoryListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CategoryListInternalErrorResponseBody"}}},"schemes":["http"]}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","required":false,"type":"string","default":""},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000},{"name":"match","in":"query","description":"Strategy used to find matching resources","required":false,"type":"string","default":"contains","enum":["exact","contains"]}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceQueryResponseBody"}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/ResourceQueryInvalidKindResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceQueryNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceQueryInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByVersionIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByVersionIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByVersionIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"Name of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"type":"string"},{"name":"kind","in":"path","description":"kind of resource","required":true,"type":"string","enum":["task","pipeline"]},{"name":"name","in":"path","description":"name of resource","required":true,"type":"string"},{"name":"version","in":"path","description":"version of resource","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByCatalogKindNameVersionInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resource/{id}/rating":{"get":{"tags":["rating"],"summary":"Get rating","description":"Find user's rating for a resource\n\n**Required security scopes for jwt**:\n * `rating:read`","operationId":"rating#Get","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"},{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/RatingGetResponseBody","required":["rating"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/RatingGetInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/RatingGetInvalidScopesResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/RatingGetNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/RatingGetInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]},"put":{"tags":["rating"],"summary":"Update rating","description":"Update user's rating for a resource\n\n**Required security scopes for jwt**:\n * `rating:write`","operationId":"rating#Update","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"},{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"},{"name":"UpdateRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/RatingUpdateRequestBody","required":["rating"]}}],"responses":{"200":{"description":"OK response."},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/RatingUpdateInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/RatingUpdateInvalidScopesResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/RatingUpdateNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/RatingUpdateInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"type":"integer"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDResponseBody"}},"404":{"description":"Not Found response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDNotFoundResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceVersionsByIDInternalErrorResponseBody"}}},"schemes":["http"]}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","required":false,"type":"integer","default":1000}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/ResourceListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/ResourceListInternalErrorResponseBody"}}},"schemes":["http"]}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download gen/http/openapi3.yaml","description":"JSON document containing the API swagger definition","operationId":"swagger#/schema/swagger.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["http"]}},"/system/config/refresh":{"post":{"tags":["admin"],"summary":"RefreshConfig admin","description":"Refresh the changes in config file\n\n**Required security scopes for jwt**:\n * `config:refresh`","operationId":"admin#RefreshConfig","parameters":[{"name":"Authorization","in":"header","description":"User JWT","required":true,"type":"string"},{"name":"RefreshConfigRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/AdminRefreshConfigRequestBody","required":["force"]}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AdminRefreshConfigResponseBody","required":["checksum"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AdminRefreshConfigInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/system/user/agent":{"put":{"tags":["admin"],"summary":"UpdateAgent admin","description":"Create or Update an agent user with required scopes\n\n**Required security scopes for jwt**:\n * `agent:create`","operationId":"admin#UpdateAgent","parameters":[{"name":"Authorization","in":"header","description":"User JWT","required":true,"type":"string"},{"name":"UpdateAgentRequestBody","in":"body","required":true,"schema":{"$ref":"#/definitions/AdminUpdateAgentRequestBody","required":["name","scopes"]}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/AdminUpdateAgentResponseBody","required":["token"]}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidPayloadResponseBody"}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/AdminUpdateAgentInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/user/refresh/accesstoken":{"post":{"tags":["user"],"summary":"RefreshAccessToken user","description":"Refresh the access token of User\n\n**Required security scopes for jwt**:\n * `refresh:token`","operationId":"user#RefreshAccessToken","parameters":[{"name":"Authorization","in":"header","description":"Refresh Token of User","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/UserRefreshAccessTokenResponseBody","required":["data"]}},"401":{"description":"Unauthorized response.","schema":{"$ref":"#/definitions/UserRefreshAccessTokenInvalidTokenResponseBody"}},"403":{"description":"Forbidden response.","schema":{"$ref":"#/definitions/UserRefreshAccessTokenInvalidScopesResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/UserRefreshAccessTokenInternalErrorResponseBody"}}},"schemes":["http"],"security":[{"jwt_header_Authorization":[]}]}},"/v1":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status#1","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/StatusStatusResponseBody"}}},"schemes":["http"]}},"/v1/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list#1","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CategoryListResponseBody"}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CategoryListInternalErrorResponseBody"}}},"schemes":["http"]}}},"definitions":{"AccessTokenResponseBody":{"title":"AccessTokenResponseBody","type":"object","properties":{"access":{"$ref":"#/definitions/TokenResponseBody"}},"description":"Access Token for User","example":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"AdminRefreshConfigInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Token scopes (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminRefreshConfigRequestBody":{"title":"AdminRefreshConfigRequestBody","type":"object","properties":{"force":{"type":"boolean","description":"Force Refresh the config file","example":false}},"example":{"force":true},"required":["force"]},"AdminRefreshConfigResponseBody":{"title":"AdminRefreshConfigResponseBody","type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"Eveniet nihil et beatae ex voluptas voluptas."}},"example":{"checksum":"Non molestiae illo aut numquam."},"required":["checksum"]},"AdminUpdateAgentInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidPayloadResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid request body (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Token scopes (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentRequestBody":{"title":"AdminUpdateAgentRequestBody","type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"Architecto rerum id quia."},"scopes":{"type":"array","items":{"type":"string","example":"Molestiae eaque."},"description":"Scopes required for Agent","example":["Quia illum perferendis suscipit voluptatem est quae.","Autem dolores at."]}},"example":{"name":"Aliquam voluptates illo.","scopes":["Et ut pariatur similique ullam laudantium nostrum.","Totam magni reprehenderit maxime et velit.","Dolores dolor esse officia velit aliquid praesentium.","Sed optio ab beatae est."]},"required":["name","scopes"]},"AdminUpdateAgentResponseBody":{"title":"AdminUpdateAgentResponseBody","type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"Et dolor vitae voluptatem deleniti."}},"example":{"token":"Minus reiciendis nulla quasi."},"required":["token"]},"AuthAuthenticateInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidCodeResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid Authorization code (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"AuthAuthenticateResponseBody":{"title":"AuthAuthenticateResponseBody","type":"object","properties":{"data":{"$ref":"#/definitions/AuthTokensResponseBody"}},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"required":["data"]},"AuthTokensResponseBody":{"title":"AuthTokensResponseBody","type":"object","properties":{"access":{"$ref":"#/definitions/TokenResponseBody"},"refresh":{"$ref":"#/definitions/TokenResponseBody"}},"description":"Auth tokens have access and refresh token for user","example":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"CatalogRefreshInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"CatalogRefreshNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"CatalogRefreshResponseBody":{"title":"Mediatype identifier: application/vnd.hub.job; view=default","type":"object","properties":{"id":{"type":"integer","description":"id of the job","example":8951834590360407852,"format":"int64"},"status":{"type":"string","description":"status of the job","example":"Perspiciatis ut ut."}},"description":"RefreshResponseBody result type (default view)","example":{"id":10863881996075796435,"status":"Sed ipsa velit dolorem."},"required":["id","status"]},"CatalogResponseBody":{"title":"CatalogResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the catalog","example":1,"format":"int64"},"name":{"type":"string","description":"Name of catalog","example":"Tekton"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]}},"example":{"id":1,"name":"Tekton","type":"community"},"required":["id","name","type"]},"CategoryListInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"CategoryListResponseBody":{"title":"CategoryListResponseBody","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/CategoryResponseBody"},"example":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"CategoryResponseBody":{"title":"CategoryResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the category","example":1,"format":"int64"},"name":{"type":"string","description":"Name of category","example":"Image Builder"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"List of tags associated with the category","example":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}},"example":{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},"required":["id","name","tags"]},"HubServiceResponseBody":{"title":"HubServiceResponseBody","type":"object","properties":{"error":{"type":"string","description":"Details of the error if any","example":"unable to reach db"},"name":{"type":"string","description":"Name of the service","example":"api"},"status":{"type":"string","description":"Status of the service","example":"ok","enum":["ok","error"]}},"description":"Describes the services and their status","example":{"error":"unable to reach db","name":"api","status":"ok"},"required":["name","status"]},"RatingGetInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingGetResponseBody":{"title":"RatingGetResponseBody","type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":4,"format":"int64"}},"example":{"rating":4},"required":["rating"]},"RatingUpdateInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal server error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"RatingUpdateRequestBody":{"title":"RatingUpdateRequestBody","type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":0,"minimum":0,"maximum":5}},"example":{"rating":1},"required":["rating"]},"ResourceByCatalogKindNameInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBody"}},"description":"ByCatalogKindNameResponseBody result type (default view)","example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceByCatalogKindNameVersionInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameVersionNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByCatalogKindNameVersionResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceVersionDataResponseBody"}},"description":"ByCatalogKindNameVersionResponseBody result type (default view)","example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceByIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBody"}},"description":"ByIdResponseBody result type (default view)","example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceByVersionIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByVersionIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceByVersionIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceVersionDataResponseBody"}},"description":"ByVersionIdResponseBody result type (default view)","example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceDataResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/definitions/ResourceVersionDataResponseBodyWithoutResource"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]},"versions":{"type":"array","items":{"$ref":"#/definitions/ResourceVersionDataResponseBodyTiny"},"description":"List of all versions of a resource","example":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"description":"The resource type describes resource information.","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating","versions"]},"ResourceDataResponseBodyInfo":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]}},"description":"The resource type describes resource information. (default view)","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","kind","tags","rating"]},"ResourceDataResponseBodyWithoutVersion":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBody"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1,"format":"int64"},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/definitions/ResourceVersionDataResponseBodyWithoutResource"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/definitions/TagResponseBody"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]}},"description":"The resource type describes resource information. (withoutVersion view) (default view)","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating"]},"ResourceDataResponseBodyWithoutVersionCollection":{"title":"Mediatype identifier: application/vnd.hub.resource.data; type=collection; view=default","type":"array","items":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersion"},"description":"ResourceDataResponseBodyWithoutVersionCollection is the result type for an array of ResourceDataResponseBodyWithoutVersion (default view)","example":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceListInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceListResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resources; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersionCollection"}},"description":"ListResponseBody result type (default view)","example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceQueryInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryInvalidKindResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid Resource Kind (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Resource Not Found Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceQueryResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resources; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/ResourceDataResponseBodyWithoutVersionCollection"}},"description":"QueryResponseBody result type (default view)","example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceVersionDataResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"resource":{"$ref":"#/definitions/ResourceDataResponseBodyInfo"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","resource"]},"ResourceVersionDataResponseBodyMin":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (default view)","example":{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","rawURL","webURL"]},"ResourceVersionDataResponseBodyTiny":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"version":{"type":"string","description":"Version of resource","example":"0.1"}},"description":"The Version result type describes resource's version information. (default view)","example":{"id":1,"version":"0.1"},"required":["id","version"]},"ResourceVersionDataResponseBodyWithoutResource":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1,"format":"int64"},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (default view)","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt"]},"ResourceVersionsByIDInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"ResourceVersionsByIDNotFoundResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Resource Not Found Error (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"ResourceVersionsByIDResponseBody":{"title":"Mediatype identifier: application/vnd.hub.resource.versions; view=default","type":"object","properties":{"data":{"$ref":"#/definitions/VersionsResponseBody"}},"description":"VersionsByIDResponseBody result type (default view)","example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"required":["data"]},"StatusStatusResponseBody":{"title":"StatusStatusResponseBody","type":"object","properties":{"services":{"type":"array","items":{"$ref":"#/definitions/HubServiceResponseBody"},"description":"List of services and their status","example":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"TagResponseBody":{"title":"TagResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of tag","example":1,"format":"int64"},"name":{"type":"string","description":"Name of tag","example":"image-build"}},"example":{"id":1,"name":"image-build"},"required":["id","name"]},"TokenResponseBody":{"title":"TokenResponseBody","type":"object","properties":{"expiresAt":{"type":"integer","description":"Time the token will expires at","example":0,"format":"int64"},"refreshInterval":{"type":"string","description":"Duration the token will Expire In","example":"1h30m"},"token":{"type":"string","description":"JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"description":"Token includes the JWT, Expire Duration \u0026 Time","example":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token","refreshInterval","expiresAt"]},"UserRefreshAccessTokenInternalErrorResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Internal Server Error (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"UserRefreshAccessTokenInvalidScopesResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"Invalid User scope (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"UserRefreshAccessTokenInvalidTokenResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid User token (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"UserRefreshAccessTokenResponseBody":{"title":"UserRefreshAccessTokenResponseBody","type":"object","properties":{"data":{"$ref":"#/definitions/AccessTokenResponseBody"}},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"required":["data"]},"VersionsResponseBody":{"title":"Mediatype identifier: application/vnd.hub.versions; view=default","type":"object","properties":{"latest":{"$ref":"#/definitions/ResourceVersionDataResponseBodyMin"},"versions":{"type":"array","items":{"$ref":"#/definitions/ResourceVersionDataResponseBodyMin"},"description":"List of all versions of resource","example":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"description":"The Versions type describes response for versions by resource id API.","example":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]},"required":["latest","versions"]}},"securityDefinitions":{"jwt_header_Authorization":{"type":"apiKey","description":"Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint.\n\n**Security Scopes**:\n * `rating:read`: Read-only access to rating\n * `rating:write`: Read and write access to rating\n * `agent:create`: Access to create or update an agent\n * `catalog:refresh`: Access to refresh catalog\n * `config:refresh`: Access to refresh config file\n * `refresh:token`: Access to refresh user access token","name":"Authorization","in":"header"}}} \ No newline at end of file diff --git a/api/gen/http/openapi.yaml b/api/gen/http/openapi.yaml index bc83077c12..c1c73393eb 100644 --- a/api/gen/http/openapi.yaml +++ b/api/gen/http/openapi.yaml @@ -592,6 +592,46 @@ paths: - http security: - jwt_header_Authorization: [] + /user/refresh/accesstoken: + post: + tags: + - user + summary: RefreshAccessToken user + description: |- + Refresh the access token of User + + **Required security scopes for jwt**: + * `refresh:token` + operationId: user#RefreshAccessToken + parameters: + - name: Authorization + in: header + description: Refresh Token of User + required: true + type: string + responses: + "200": + description: OK response. + schema: + $ref: '#/definitions/UserRefreshAccessTokenResponseBody' + required: + - data + "401": + description: Unauthorized response. + schema: + $ref: '#/definitions/UserRefreshAccessTokenInvalidTokenResponseBody' + "403": + description: Forbidden response. + schema: + $ref: '#/definitions/UserRefreshAccessTokenInvalidScopesResponseBody' + "500": + description: Internal Server Error response. + schema: + $ref: '#/definitions/UserRefreshAccessTokenInternalErrorResponseBody' + schemes: + - http + security: + - jwt_header_Authorization: [] /v1: get: tags: @@ -625,6 +665,18 @@ paths: schemes: - http definitions: + AccessTokenResponseBody: + title: AccessTokenResponseBody + type: object + properties: + access: + $ref: '#/definitions/TokenResponseBody' + description: Access Token for User + example: + access: + expiresAt: 0 + refreshInterval: 1h30m + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM AdminRefreshConfigInternalErrorResponseBody: title: 'Mediatype identifier: application/vnd.goa.error; view=default' type: object @@ -791,7 +843,7 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: false + example: true id: type: string description: ID is a unique identifier for this particular occurrence of the @@ -821,7 +873,7 @@ definitions: message: parameter 'p' must be an integer name: bad_request temporary: true - timeout: true + timeout: false required: - name - id @@ -858,15 +910,15 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: true + example: false description: Invalid request body (default view) example: - fault: true + fault: false id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: false - timeout: true + temporary: true + timeout: false required: - name - id @@ -899,14 +951,14 @@ definitions: temporary: type: boolean description: Is the error temporary? - example: false + example: true timeout: type: boolean description: Is the error a timeout? example: true description: Invalid Token scopes (default view) example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request @@ -926,7 +978,7 @@ definitions: fault: type: boolean description: Is the error a server-side fault? - example: true + example: false id: type: string description: ID is a unique identifier for this particular occurrence of the @@ -948,7 +1000,7 @@ definitions: timeout: type: boolean description: Is the error a timeout? - example: false + example: true description: Invalid User token (default view) example: fault: false @@ -956,7 +1008,7 @@ definitions: message: parameter 'p' must be an integer name: bad_request temporary: true - timeout: false + timeout: true required: - name - id @@ -971,17 +1023,16 @@ definitions: name: type: string description: Name of Agent - example: Sed voluptatem nulla laborum ut. + example: Architecto rerum id quia. scopes: type: array items: type: string - example: Architecto rerum id quia. + example: Molestiae eaque. description: Scopes required for Agent example: - - Eaque necessitatibus magni quia. - - Perferendis suscipit voluptatem est. - - Rerum autem dolores at. + - Quia illum perferendis suscipit voluptatem est quae. + - Autem dolores at. example: name: Aliquam voluptates illo. scopes: @@ -999,9 +1050,9 @@ definitions: token: type: string description: Agent JWT - example: Quis nostrum et ab placeat facere. + example: Et dolor vitae voluptatem deleniti. example: - token: Ipsum iusto et dolor vitae voluptatem. + token: Minus reiciendis nulla quasi. required: - token AuthAuthenticateInternalErrorResponseBody: @@ -3318,6 +3369,155 @@ definitions: - token - refreshInterval - expiresAt + UserRefreshAccessTokenInternalErrorResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: false + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Internal Server Error (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + UserRefreshAccessTokenInvalidScopesResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: true + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: Invalid User scope (default view) + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + UserRefreshAccessTokenInvalidTokenResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: true + id: + type: string + description: ID is a unique identifier for this particular occurrence of the + problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence + of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: true + description: Invalid User token (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: true + required: + - name + - id + - message + - temporary + - timeout + - fault + UserRefreshAccessTokenResponseBody: + title: UserRefreshAccessTokenResponseBody + type: object + properties: + data: + $ref: '#/definitions/AccessTokenResponseBody' + example: + data: + access: + expiresAt: 0 + refreshInterval: 1h30m + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM + required: + - data VersionsResponseBody: title: 'Mediatype identifier: application/vnd.hub.versions; view=default' type: object @@ -3370,5 +3570,6 @@ securityDefinitions: * `agent:create`: Access to create or update an agent * `catalog:refresh`: Access to refresh catalog * `config:refresh`: Access to refresh config file + * `refresh:token`: Access to refresh user access token name: Authorization in: header diff --git a/api/gen/http/openapi3.json b/api/gen/http/openapi3.json index 99de9419e7..5db870cbc8 100644 --- a/api/gen/http/openapi3.json +++ b/api/gen/http/openapi3.json @@ -1 +1 @@ -{"openapi":"3.0.3","info":{"title":"Tekton Hub","description":"HTTP services for managing Tekton Hub","version":"1.0"},"servers":[{"url":"http://api.hub.tekton.dev"}],"paths":{"/":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseBody"},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Authenticate auth","description":"Authenticates users against GitHub OAuth","operationId":"auth#Authenticate","parameters":[{"name":"code","in":"query","description":"OAuth Authorization code of User","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"OAuth Authorization code of User","example":"5628b69ec09c09512eef"},"example":"5628b69ec09c09512eef"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticateResponseBody"},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refreshes Tekton Catalog","operationId":"catalog#Refresh","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"},"example":{"id":13680623773748373161,"status":"Pariatur quasi."}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","allowEmptyValue":true,"schema":{"type":"string","description":"Name of resource","default":"","example":"buildah"},"example":"buildah"},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Et nam pariatur corrupti atque."},"description":"Kinds of resource to filter by","example":["task","pipelines"]},"example":["task","pipelines"]},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Expedita sit repellendus magnam."},"description":"Tags associated with a resource to filter by","example":["image","build"]},"example":["image","build"]},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100},{"name":"match","in":"query","description":"Strategy used to find matching resources","allowEmptyValue":true,"schema":{"type":"string","description":"Strategy used to find matching resources","default":"contains","example":"contains","enum":["exact","contains"]},"example":"exact"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"schema":{"type":"integer","description":"Version ID of a resource's version","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"task","enum":["task","pipeline"]},"example":"task"},{"name":"name","in":"path","description":"Name of resource","required":true,"schema":{"type":"string","description":"Name of resource","example":"buildah"},"example":"buildah"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"pipeline","enum":["task","pipeline"]},"example":"task"},{"name":"name","in":"path","description":"name of resource","required":true,"schema":{"type":"string","description":"name of resource","example":"buildah"},"example":"buildah"},{"name":"version","in":"path","description":"version of resource","required":true,"schema":{"type":"string","description":"version of resource","example":"0.1"},"example":"0.1"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/resource/{id}/rating":{"get":{"tags":["rating"],"summary":"Get rating","description":"Find user's rating for a resource","operationId":"rating#Get","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":9293410832204462916},"example":15595973357138799589}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetResponseBody"},"example":{"rating":4}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]},"put":{"tags":["rating"],"summary":"Update rating","description":"Update user's rating for a resource","operationId":"rating#Update","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":5038586986718798316},"example":12822747110185372831}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRequestBody"},"example":{"rating":0}}}},"responses":{"200":{"description":"","content":{"application/json":{"example":{}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersions"},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download gen/http/openapi3.yaml","description":"JSON document containing the API swagger definition","operationId":"swagger#/schema/swagger.json","responses":{"200":{"description":"File downloaded"}}}},"/system/config/refresh":{"post":{"tags":["admin"],"summary":"RefreshConfig admin","description":"Refresh the changes in config file","operationId":"admin#RefreshConfig","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshConfigRequestBody"},"example":{"force":true}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshConfigResponseBody"},"example":{"checksum":"Cumque omnis non."}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/system/user/agent":{"put":{"tags":["admin"],"summary":"UpdateAgent admin","description":"Create or Update an agent user with required scopes","operationId":"admin#UpdateAgent","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequestBody"},"example":{"name":"Non omnis quas deserunt.","scopes":["Pariatur occaecati voluptas assumenda maiores quaerat consequatur.","Quia nihil officia itaque."]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentResponseBody"},"example":{"token":"Autem ut est error eaque."}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh"]}]}},"/v1":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status#1","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseBody"},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}}}}}}},"/v1/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list#1","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}}},"components":{"schemas":{"AuthTokens":{"type":"object","properties":{"access":{"$ref":"#/components/schemas/Token"},"refresh":{"$ref":"#/components/schemas/Token"}},"description":"Auth tokens have access and refresh token for user","example":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"AuthenticateResponseBody":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AuthTokens"}},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"required":["data"]},"Catalog":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the catalog","example":1},"name":{"type":"string","description":"Name of catalog","example":"Tekton"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]}},"example":{"id":1,"name":"Tekton","type":"community"},"required":["id","name","type"]},"Category":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the category","example":1},"name":{"type":"string","description":"Name of category","example":"Image Builder"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"},"description":"List of tags associated with the category","example":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}},"example":{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},"required":["id","name","tags"]},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid request body","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"GetResponseBody":{"type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":4,"format":"int64"}},"example":{"rating":4},"required":["rating"]},"HubService":{"type":"object","properties":{"error":{"type":"string","description":"Details of the error if any","example":"unable to reach db"},"name":{"type":"string","description":"Name of the service","example":"api"},"status":{"type":"string","description":"Status of the service","example":"ok","enum":["ok","error"]}},"description":"Describes the services and their status","example":{"error":"unable to reach db","name":"api","status":"ok"},"required":["name","status"]},"Job":{"type":"object","properties":{"id":{"type":"integer","description":"id of the job","example":8451480480088601963},"status":{"type":"string","description":"status of the job","example":"Vitae ducimus."}},"example":{"id":3463136335453028454,"status":"Autem aut id."},"required":["id","status"]},"ListResponseBody":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"example":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"RefreshConfigRequestBody":{"type":"object","properties":{"force":{"type":"boolean","description":"Force Refresh the config file","example":true}},"example":{"force":false},"required":["force"]},"RefreshConfigResponseBody":{"type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"Quas veniam."}},"example":{"checksum":"Accusamus ut dolorum sapiente."},"required":["checksum"]},"Resource":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceData"}},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceData":{"type":"object","properties":{"catalog":{"$ref":"#/components/schemas/Catalog"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/components/schemas/ResourceVersionData"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ResourceVersionData"},"description":"List of all versions of a resource","example":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"description":"The resource type describes resource information.","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating","versions"]},"ResourceDataCollection":{"type":"array","items":{"$ref":"#/components/schemas/ResourceData"},"example":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceVersion":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceVersionData"}},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceVersionData":{"type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"resource":{"$ref":"#/components/schemas/ResourceData"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","resource"]},"ResourceVersions":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Versions"}},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"required":["data"]},"Resources":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceDataCollection"}},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"required":["data"]},"StatusResponseBody":{"type":"object","properties":{"services":{"type":"array","items":{"$ref":"#/components/schemas/HubService"},"description":"List of services and their status","example":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"Tag":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of tag","example":1},"name":{"type":"string","description":"Name of tag","example":"image-build"}},"example":{"id":1,"name":"image-build"},"required":["id","name"]},"Token":{"type":"object","properties":{"expiresAt":{"type":"integer","description":"Time the token will expires at","example":0,"format":"int64"},"refreshInterval":{"type":"string","description":"Duration the token will Expire In","example":"1h30m"},"token":{"type":"string","description":"JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"description":"Token includes the JWT, Expire Duration \u0026 Time","example":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token","refreshInterval","expiresAt"]},"UpdateAgentRequestBody":{"type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"Et nam quia incidunt accusamus."},"scopes":{"type":"array","items":{"type":"string","example":"Non eum praesentium corrupti et qui nam."},"description":"Scopes required for Agent","example":["Enim sint tempora.","Neque maxime nesciunt."]}},"example":{"name":"Debitis laboriosam incidunt neque asperiores reiciendis hic.","scopes":["Dicta itaque possimus.","Aut repellat.","Qui accusantium nulla ea rem.","Ipsam sapiente labore assumenda qui sequi officiis."]},"required":["name","scopes"]},"UpdateAgentResponseBody":{"type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"Dolorem laudantium quidem amet suscipit fuga."}},"example":{"token":"Dolorem eveniet qui sint omnis."},"required":["token"]},"UpdateRequestBody":{"type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":1,"minimum":0,"maximum":5}},"example":{"rating":0},"required":["rating"]},"Versions":{"type":"object","properties":{"latest":{"$ref":"#/components/schemas/ResourceVersionData"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ResourceVersionData"},"description":"List of all versions of resource","example":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"description":"The Versions type describes response for versions by resource id API.","example":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]},"required":["latest","versions"]}},"securitySchemes":{"jwt_header_Authorization":{"type":"http","description":"Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint.","scheme":"bearer"}}}} \ No newline at end of file +{"openapi":"3.0.3","info":{"title":"Tekton Hub","description":"HTTP services for managing Tekton Hub","version":"1.0"},"servers":[{"url":"http://api.hub.tekton.dev"}],"paths":{"/":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseBody"},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Authenticate auth","description":"Authenticates users against GitHub OAuth","operationId":"auth#Authenticate","parameters":[{"name":"code","in":"query","description":"OAuth Authorization code of User","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"OAuth Authorization code of User","example":"5628b69ec09c09512eef"},"example":"5628b69ec09c09512eef"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthenticateResponseBody"},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refreshes Tekton Catalog","operationId":"catalog#Refresh","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"},"example":{"id":13680623773748373161,"status":"Pariatur quasi."}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh","refresh:token"]}]}},"/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","allowEmptyValue":true,"schema":{"type":"string","description":"Name of resource","default":"","example":"buildah"},"example":"buildah"},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Aliquam possimus tempore non."},"description":"Kinds of resource to filter by","example":["task","pipelines"]},"example":["task","pipelines"]},{"name":"tags","in":"query","description":"Tags associated with a resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Voluptatibus voluptatem voluptates sint est officia."},"description":"Tags associated with a resource to filter by","example":["image","build"]},"example":["image","build"]},{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100},{"name":"match","in":"query","description":"Strategy used to find matching resources","allowEmptyValue":true,"schema":{"type":"string","description":"Strategy used to find matching resources","default":"contains","example":"exact","enum":["exact","contains"]},"example":"contains"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/resource/version/{versionID}":{"get":{"tags":["resource"],"summary":"ByVersionId resource","description":"Find a resource using its version's id","operationId":"resource#ByVersionId","parameters":[{"name":"versionID","in":"path","description":"Version ID of a resource's version","required":true,"schema":{"type":"integer","description":"Version ID of a resource's version","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/resource/{catalog}/{kind}/{name}":{"get":{"tags":["resource"],"summary":"ByCatalogKindName resource","description":"Find resources using name of catalog, resource name and kind of resource","operationId":"resource#ByCatalogKindName","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"pipeline","enum":["task","pipeline"]},"example":"task"},{"name":"name","in":"path","description":"Name of resource","required":true,"schema":{"type":"string","description":"Name of resource","example":"buildah"},"example":"buildah"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/resource/{catalog}/{kind}/{name}/{version}":{"get":{"tags":["resource"],"summary":"ByCatalogKindNameVersion resource","description":"Find resource using name of catalog \u0026 name, kind and version of resource","operationId":"resource#ByCatalogKindNameVersion","parameters":[{"name":"catalog","in":"path","description":"name of catalog","required":true,"schema":{"type":"string","description":"name of catalog","example":"tektoncd"},"example":"tektoncd"},{"name":"kind","in":"path","description":"kind of resource","required":true,"schema":{"type":"string","description":"kind of resource","example":"task","enum":["task","pipeline"]},"example":"task"},{"name":"name","in":"path","description":"name of resource","required":true,"schema":{"type":"string","description":"name of resource","example":"buildah"},"example":"buildah"},{"name":"version","in":"path","description":"version of resource","required":true,"schema":{"type":"string","description":"version of resource","example":"0.1"},"example":"0.1"}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersion"},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}},"/resource/{id}":{"get":{"tags":["resource"],"summary":"ById resource","description":"Find a resource using it's id","operationId":"resource#ById","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resource"},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}}}}},"/resource/{id}/rating":{"get":{"tags":["rating"],"summary":"Get rating","description":"Find user's rating for a resource","operationId":"rating#Get","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":3078878078453162771},"example":837001675168035242}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetResponseBody"},"example":{"rating":4}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh","refresh:token"]}]},"put":{"tags":["rating"],"summary":"Update rating","description":"Update user's rating for a resource","operationId":"rating#Update","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":7956349260887148895},"example":11092447930406954788}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRequestBody"},"example":{"rating":0}}}},"responses":{"200":{"description":"","content":{"application/json":{"example":{}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh","refresh:token"]}]}},"/resource/{id}/versions":{"get":{"tags":["resource"],"summary":"VersionsByID resource","description":"Find all versions of a resource by its id","operationId":"resource#VersionsByID","parameters":[{"name":"id","in":"path","description":"ID of a resource","required":true,"schema":{"type":"integer","description":"ID of a resource","example":1},"example":1}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceVersions"},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}}}}},"404":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","parameters":[{"name":"limit","in":"query","description":"Maximum number of resources to be returned","allowEmptyValue":true,"schema":{"type":"integer","description":"Maximum number of resources to be returned","default":1000,"example":100},"example":100}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}}}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download gen/http/openapi3.yaml","description":"JSON document containing the API swagger definition","operationId":"swagger#/schema/swagger.json","responses":{"200":{"description":"File downloaded"}}}},"/system/config/refresh":{"post":{"tags":["admin"],"summary":"RefreshConfig admin","description":"Refresh the changes in config file","operationId":"admin#RefreshConfig","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshConfigRequestBody"},"example":{"force":true}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshConfigResponseBody"},"example":{"checksum":"Cumque omnis non."}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh","refresh:token"]}]}},"/system/user/agent":{"put":{"tags":["admin"],"summary":"UpdateAgent admin","description":"Create or Update an agent user with required scopes","operationId":"admin#UpdateAgent","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequestBody"},"example":{"name":"Non omnis quas deserunt.","scopes":["Pariatur occaecati voluptas assumenda maiores quaerat consequatur.","Quia nihil officia itaque."]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentResponseBody"},"example":{"token":"Autem ut est error eaque."}}}},"400":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh","refresh:token"]}]}},"/user/refresh/accesstoken":{"post":{"tags":["user"],"summary":"RefreshAccessToken user","description":"Refresh the access token of User","operationId":"user#RefreshAccessToken","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshAccessTokenResponseBody"},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}}}}},"401":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":false}}}},"403":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh","refresh:token"]}]}},"/v1":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status#1","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponseBody"},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}}}}}}},"/v1/categories":{"get":{"tags":["category"],"summary":"list category","description":"List all categories along with their tags sorted by name","operationId":"category#list#1","responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}}}},"500":{"description":"","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true}}}}}}}},"components":{"schemas":{"AccessToken":{"type":"object","properties":{"access":{"$ref":"#/components/schemas/Token"}},"description":"Access Token for User","example":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"AuthTokens":{"type":"object","properties":{"access":{"$ref":"#/components/schemas/Token"},"refresh":{"$ref":"#/components/schemas/Token"}},"description":"Auth tokens have access and refresh token for user","example":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"AuthenticateResponseBody":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AuthTokens"}},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"refresh":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"required":["data"]},"Catalog":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the catalog","example":1},"name":{"type":"string","description":"Name of catalog","example":"Tekton"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]}},"example":{"id":1,"name":"Tekton","type":"community"},"required":["id","name","type"]},"Category":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of the category","example":1},"name":{"type":"string","description":"Name of category","example":"Image Builder"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"},"description":"List of tags associated with the category","example":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}},"example":{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},"required":["id","name","tags"]},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"Invalid request body","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"GetResponseBody":{"type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":4,"format":"int64"}},"example":{"rating":4},"required":["rating"]},"HubService":{"type":"object","properties":{"error":{"type":"string","description":"Details of the error if any","example":"unable to reach db"},"name":{"type":"string","description":"Name of the service","example":"api"},"status":{"type":"string","description":"Status of the service","example":"ok","enum":["ok","error"]}},"description":"Describes the services and their status","example":{"error":"unable to reach db","name":"api","status":"ok"},"required":["name","status"]},"Job":{"type":"object","properties":{"id":{"type":"integer","description":"id of the job","example":14381081816862842907},"status":{"type":"string","description":"status of the job","example":"Quia at impedit."}},"example":{"id":10579553497869499435,"status":"Omnis recusandae accusantium fugiat alias ipsa."},"required":["id","status"]},"ListResponseBody":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"example":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"example":{"data":[{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]},{"id":1,"name":"Image Builder","tags":[{"id":1,"name":"image-build"},{"id":2,"name":"kaniko"}]}]}},"RefreshAccessTokenResponseBody":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccessToken"}},"example":{"data":{"access":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}},"required":["data"]},"RefreshConfigRequestBody":{"type":"object","properties":{"force":{"type":"boolean","description":"Force Refresh the config file","example":false}},"example":{"force":true},"required":["force"]},"RefreshConfigResponseBody":{"type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"Corrupti atque odit expedita sit repellendus."}},"example":{"checksum":"Consequatur numquam id aut illum ut rerum."},"required":["checksum"]},"Resource":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceData"}},"example":{"data":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"required":["data"]},"ResourceData":{"type":"object","properties":{"catalog":{"$ref":"#/components/schemas/Catalog"},"id":{"type":"integer","description":"ID is the unique id of the resource","example":1},"kind":{"type":"string","description":"Kind of resource","example":"task"},"latestVersion":{"$ref":"#/components/schemas/ResourceVersionData"},"name":{"type":"string","description":"Name of resource","example":"buildah"},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Tag"},"description":"Tags related to resource","example":[{"id":1,"name":"image-build"}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ResourceVersionData"},"description":"List of all versions of a resource","example":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}},"description":"The resource type describes resource information.","example":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","kind","latestVersion","tags","rating","versions"]},"ResourceDataCollection":{"type":"array","items":{"$ref":"#/components/schemas/ResourceData"},"example":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceVersion":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceVersionData"}},"example":{"data":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"}},"required":["data"]},"ResourceVersionData":{"type":"object","properties":{"description":{"type":"string","description":"Description of version","example":"Buildah task builds source into a container image and then pushes it to a container registry."},"displayName":{"type":"string","description":"Display name of version","example":"Buildah"},"id":{"type":"integer","description":"ID is the unique id of resource's version","example":1},"minPipelinesVersion":{"type":"string","description":"Minimum pipelines version the resource's version is compatible with","example":"0.12.1"},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","format":"uri"},"resource":{"$ref":"#/components/schemas/ResourceData"},"updatedAt":{"type":"string","description":"Timestamp when version was last updated","example":"2020-01-01 12:00:00 +0000 UTC","format":"date-time"},"version":{"type":"string","description":"Version of resource","example":"0.1"},"webURL":{"type":"string","description":"Web URL of resource's yaml file of the version","example":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","resource"]},"ResourceVersions":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Versions"}},"example":{"data":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"required":["data"]},"Resources":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceDataCollection"}},"example":{"data":[{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"type":"community"},"id":1,"kind":"task","latestVersion":{"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","id":1,"minPipelinesVersion":"0.12.1","rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","updatedAt":"2020-01-01 12:00:00 +0000 UTC","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},"name":"buildah","rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"required":["data"]},"StatusResponseBody":{"type":"object","properties":{"services":{"type":"array","items":{"$ref":"#/components/schemas/HubService"},"description":"List of services and their status","example":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"example":{"services":[{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"},{"error":"unable to reach db","name":"api","status":"ok"}]}},"Tag":{"type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of tag","example":1},"name":{"type":"string","description":"Name of tag","example":"image-build"}},"example":{"id":1,"name":"image-build"},"required":["id","name"]},"Token":{"type":"object","properties":{"expiresAt":{"type":"integer","description":"Time the token will expires at","example":0,"format":"int64"},"refreshInterval":{"type":"string","description":"Duration the token will Expire In","example":"1h30m"},"token":{"type":"string","description":"JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"description":"Token includes the JWT, Expire Duration \u0026 Time","example":{"expiresAt":0,"refreshInterval":"1h30m","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token","refreshInterval","expiresAt"]},"UpdateAgentRequestBody":{"type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"Dolorem neque maxime nesciunt."},"scopes":{"type":"array","items":{"type":"string","example":"Debitis laboriosam incidunt neque asperiores reiciendis hic."},"description":"Scopes required for Agent","example":["Dicta itaque possimus.","Aut repellat.","Qui accusantium nulla ea rem.","Ipsam sapiente labore assumenda qui sequi officiis."]}},"example":{"name":"Dolorem laudantium quidem amet suscipit fuga.","scopes":["Eveniet qui sint omnis consequatur omnis.","Aut sed voluptas animi molestiae nam.","Veniam optio accusamus ut dolorum sapiente modi.","Vitae ducimus."]},"required":["name","scopes"]},"UpdateAgentResponseBody":{"type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"Natus autem."}},"example":{"token":"Id porro placeat et et at itaque."},"required":["token"]},"UpdateRequestBody":{"type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":1,"minimum":0,"maximum":5}},"example":{"rating":0},"required":["rating"]},"Versions":{"type":"object","properties":{"latest":{"$ref":"#/components/schemas/ResourceVersionData"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ResourceVersionData"},"description":"List of all versions of resource","example":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]}},"description":"The Versions type describes response for versions by resource id API.","example":{"latest":{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"},"versions":[{"id":1,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.1/buildah.yaml","version":"0.1","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.1/buildah.yaml"},{"id":2,"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/master/task/buildah/0.2/buildah.yaml","version":"0.2","webURL":"https://github.com/tektoncd/catalog/blob/master/task/buildah/0.2/buildah.yaml"}]},"required":["latest","versions"]}},"securitySchemes":{"jwt_header_Authorization":{"type":"http","description":"Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint.","scheme":"bearer"}}}} \ No newline at end of file diff --git a/api/gen/http/openapi3.yaml b/api/gen/http/openapi3.yaml index f341bc1e89..b304fbeeb3 100644 --- a/api/gen/http/openapi3.yaml +++ b/api/gen/http/openapi3.yaml @@ -171,6 +171,7 @@ paths: - agent:create - catalog:refresh - config:refresh + - refresh:token /categories: get: tags: @@ -254,7 +255,7 @@ paths: type: array items: type: string - example: Et nam pariatur corrupti atque. + example: Aliquam possimus tempore non. description: Kinds of resource to filter by example: - task @@ -270,7 +271,7 @@ paths: type: array items: type: string - example: Expedita sit repellendus magnam. + example: Voluptatibus voluptatem voluptates sint est officia. description: Tags associated with a resource to filter by example: - image @@ -296,11 +297,11 @@ paths: type: string description: Strategy used to find matching resources default: contains - example: contains + example: exact enum: - exact - contains - example: exact + example: contains responses: "200": description: "" @@ -449,7 +450,7 @@ paths: schema: type: string description: kind of resource - example: task + example: pipeline enum: - task - pipeline @@ -548,7 +549,7 @@ paths: schema: type: string description: kind of resource - example: pipeline + example: task enum: - task - pipeline @@ -718,8 +719,8 @@ paths: schema: type: integer description: ID of a resource - example: 9293410832204462916 - example: 15595973357138799589 + example: 3078878078453162771 + example: 837001675168035242 responses: "200": description: "" @@ -788,6 +789,7 @@ paths: - agent:create - catalog:refresh - config:refresh + - refresh:token put: tags: - rating @@ -802,8 +804,8 @@ paths: schema: type: integer description: ID of a resource - example: 5038586986718798316 - example: 12822747110185372831 + example: 7956349260887148895 + example: 11092447930406954788 requestBody: required: true content: @@ -877,6 +879,7 @@ paths: - agent:create - catalog:refresh - config:refresh + - refresh:token /resource/{id}/versions: get: tags: @@ -1210,6 +1213,7 @@ paths: - agent:create - catalog:refresh - config:refresh + - refresh:token /system/user/agent: put: tags: @@ -1296,6 +1300,74 @@ paths: - agent:create - catalog:refresh - config:refresh + - refresh:token + /user/refresh/accesstoken: + post: + tags: + - user + summary: RefreshAccessToken user + description: Refresh the access token of User + operationId: user#RefreshAccessToken + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/RefreshAccessTokenResponseBody' + example: + data: + access: + expiresAt: 0 + refreshInterval: 1h30m + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM + "401": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: false + "403": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: true + "500": + description: "" + content: + application/vnd.goa.error: + schema: + $ref: '#/components/schemas/Error' + example: + fault: false + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: false + timeout: true + security: + - jwt_header_Authorization: + - rating:read + - rating:write + - agent:create + - catalog:refresh + - config:refresh + - refresh:token /v1: get: tags: @@ -1383,6 +1455,17 @@ paths: timeout: true components: schemas: + AccessToken: + type: object + properties: + access: + $ref: '#/components/schemas/Token' + description: Access Token for User + example: + access: + expiresAt: 0 + refreshInterval: 1h30m + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM AuthTokens: type: object properties: @@ -1482,7 +1565,7 @@ components: fault: type: boolean description: Is the error a server-side fault? - example: true + example: false id: type: string description: ID is a unique identifier for this particular occurrence of @@ -1512,7 +1595,7 @@ components: message: parameter 'p' must be an integer name: bad_request temporary: true - timeout: true + timeout: false required: - name - id @@ -1564,14 +1647,14 @@ components: id: type: integer description: id of the job - example: 8451480480088601963 + example: 14381081816862842907 status: type: string description: status of the job - example: Vitae ducimus. + example: Quia at impedit. example: - id: 3463136335453028454 - status: Autem aut id. + id: 10579553497869499435 + status: Omnis recusandae accusantium fugiat alias ipsa. required: - id - status @@ -1597,6 +1680,20 @@ components: name: image-build - id: 2 name: kaniko + - id: 1 + name: Image Builder + tags: + - id: 1 + name: image-build + - id: 2 + name: kaniko + - id: 1 + name: Image Builder + tags: + - id: 1 + name: image-build + - id: 2 + name: kaniko example: data: - id: 1 @@ -1613,15 +1710,35 @@ components: name: image-build - id: 2 name: kaniko + - id: 1 + name: Image Builder + tags: + - id: 1 + name: image-build + - id: 2 + name: kaniko + RefreshAccessTokenResponseBody: + type: object + properties: + data: + $ref: '#/components/schemas/AccessToken' + example: + data: + access: + expiresAt: 0 + refreshInterval: 1h30m + token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM + required: + - data RefreshConfigRequestBody: type: object properties: force: type: boolean description: Force Refresh the config file - example: true + example: false example: - force: false + force: true required: - force RefreshConfigResponseBody: @@ -1630,9 +1747,9 @@ components: checksum: type: string description: Config file checksum - example: Quas veniam. + example: Corrupti atque odit expedita sit repellendus. example: - checksum: Accusamus ut dolorum sapiente. + checksum: Consequatur numquam id aut illum ut rerum. required: - checksum Resource: @@ -2088,9 +2205,6 @@ components: - error: unable to reach db name: api status: ok - - error: unable to reach db - name: api - status: ok Tag: type: object properties: @@ -2139,23 +2253,25 @@ components: name: type: string description: Name of Agent - example: Et nam quia incidunt accusamus. + example: Dolorem neque maxime nesciunt. scopes: type: array items: type: string - example: Non eum praesentium corrupti et qui nam. + example: Debitis laboriosam incidunt neque asperiores reiciendis hic. description: Scopes required for Agent example: - - Enim sint tempora. - - Neque maxime nesciunt. + - Dicta itaque possimus. + - Aut repellat. + - Qui accusantium nulla ea rem. + - Ipsam sapiente labore assumenda qui sequi officiis. example: - name: Debitis laboriosam incidunt neque asperiores reiciendis hic. + name: Dolorem laudantium quidem amet suscipit fuga. scopes: - - Dicta itaque possimus. - - Aut repellat. - - Qui accusantium nulla ea rem. - - Ipsam sapiente labore assumenda qui sequi officiis. + - Eveniet qui sint omnis consequatur omnis. + - Aut sed voluptas animi molestiae nam. + - Veniam optio accusamus ut dolorum sapiente modi. + - Vitae ducimus. required: - name - scopes @@ -2165,9 +2281,9 @@ components: token: type: string description: Agent JWT - example: Dolorem laudantium quidem amet suscipit fuga. + example: Natus autem. example: - token: Dolorem eveniet qui sint omnis. + token: Id porro placeat et et at itaque. required: - token UpdateRequestBody: diff --git a/api/gen/http/user/client/cli.go b/api/gen/http/user/client/cli.go new file mode 100644 index 0000000000..b1478c9e5f --- /dev/null +++ b/api/gen/http/user/client/cli.go @@ -0,0 +1,25 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// user HTTP client CLI support package +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package client + +import ( + user "github.com/tektoncd/hub/api/gen/user" +) + +// BuildRefreshAccessTokenPayload builds the payload for the user +// RefreshAccessToken endpoint from CLI flags. +func BuildRefreshAccessTokenPayload(userRefreshAccessTokenRefreshToken string) (*user.RefreshAccessTokenPayload, error) { + var refreshToken string + { + refreshToken = userRefreshAccessTokenRefreshToken + } + v := &user.RefreshAccessTokenPayload{} + v.RefreshToken = refreshToken + + return v, nil +} diff --git a/api/gen/http/user/client/client.go b/api/gen/http/user/client/client.go new file mode 100644 index 0000000000..31f2905f32 --- /dev/null +++ b/api/gen/http/user/client/client.go @@ -0,0 +1,79 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// user client HTTP transport +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package client + +import ( + "context" + "net/http" + + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" +) + +// Client lists the user service endpoint HTTP clients. +type Client struct { + // RefreshAccessToken Doer is the HTTP client used to make requests to the + // RefreshAccessToken endpoint. + RefreshAccessTokenDoer goahttp.Doer + + // CORS Doer is the HTTP client used to make requests to the endpoint. + CORSDoer goahttp.Doer + + // RestoreResponseBody controls whether the response bodies are reset after + // decoding so they can be read again. + RestoreResponseBody bool + + scheme string + host string + encoder func(*http.Request) goahttp.Encoder + decoder func(*http.Response) goahttp.Decoder +} + +// NewClient instantiates HTTP clients for all the user service servers. +func NewClient( + scheme string, + host string, + doer goahttp.Doer, + enc func(*http.Request) goahttp.Encoder, + dec func(*http.Response) goahttp.Decoder, + restoreBody bool, +) *Client { + return &Client{ + RefreshAccessTokenDoer: doer, + CORSDoer: doer, + RestoreResponseBody: restoreBody, + scheme: scheme, + host: host, + decoder: dec, + encoder: enc, + } +} + +// RefreshAccessToken returns an endpoint that makes HTTP requests to the user +// service RefreshAccessToken server. +func (c *Client) RefreshAccessToken() goa.Endpoint { + var ( + encodeRequest = EncodeRefreshAccessTokenRequest(c.encoder) + decodeResponse = DecodeRefreshAccessTokenResponse(c.decoder, c.RestoreResponseBody) + ) + return func(ctx context.Context, v interface{}) (interface{}, error) { + req, err := c.BuildRefreshAccessTokenRequest(ctx, v) + if err != nil { + return nil, err + } + err = encodeRequest(req, v) + if err != nil { + return nil, err + } + resp, err := c.RefreshAccessTokenDoer.Do(req) + if err != nil { + return nil, goahttp.ErrRequestError("user", "RefreshAccessToken", err) + } + return decodeResponse(resp) + } +} diff --git a/api/gen/http/user/client/encode_decode.go b/api/gen/http/user/client/encode_decode.go new file mode 100644 index 0000000000..87aaa58b52 --- /dev/null +++ b/api/gen/http/user/client/encode_decode.go @@ -0,0 +1,168 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// user HTTP client encoders and decoders +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package client + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + + user "github.com/tektoncd/hub/api/gen/user" + goahttp "goa.design/goa/v3/http" +) + +// BuildRefreshAccessTokenRequest instantiates a HTTP request object with +// method and path set to call the "user" service "RefreshAccessToken" endpoint +func (c *Client) BuildRefreshAccessTokenRequest(ctx context.Context, v interface{}) (*http.Request, error) { + u := &url.URL{Scheme: c.scheme, Host: c.host, Path: RefreshAccessTokenUserPath()} + req, err := http.NewRequest("POST", u.String(), nil) + if err != nil { + return nil, goahttp.ErrInvalidURL("user", "RefreshAccessToken", u.String(), err) + } + if ctx != nil { + req = req.WithContext(ctx) + } + + return req, nil +} + +// EncodeRefreshAccessTokenRequest returns an encoder for requests sent to the +// user RefreshAccessToken server. +func EncodeRefreshAccessTokenRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error { + return func(req *http.Request, v interface{}) error { + p, ok := v.(*user.RefreshAccessTokenPayload) + if !ok { + return goahttp.ErrInvalidType("user", "RefreshAccessToken", "*user.RefreshAccessTokenPayload", v) + } + { + head := p.RefreshToken + if !strings.Contains(head, " ") { + req.Header.Set("Authorization", "Bearer "+head) + } else { + req.Header.Set("Authorization", head) + } + } + return nil + } +} + +// DecodeRefreshAccessTokenResponse returns a decoder for responses returned by +// the user RefreshAccessToken endpoint. restoreBody controls whether the +// response body should be restored after having been read. +// DecodeRefreshAccessTokenResponse may return the following errors: +// - "internal-error" (type *goa.ServiceError): http.StatusInternalServerError +// - "invalid-token" (type *goa.ServiceError): http.StatusUnauthorized +// - "invalid-scopes" (type *goa.ServiceError): http.StatusForbidden +// - error: internal error +func DecodeRefreshAccessTokenResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) { + return func(resp *http.Response) (interface{}, error) { + if restoreBody { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + defer func() { + resp.Body = ioutil.NopCloser(bytes.NewBuffer(b)) + }() + } else { + defer resp.Body.Close() + } + switch resp.StatusCode { + case http.StatusOK: + var ( + body RefreshAccessTokenResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("user", "RefreshAccessToken", err) + } + err = ValidateRefreshAccessTokenResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("user", "RefreshAccessToken", err) + } + res := NewRefreshAccessTokenResultOK(&body) + return res, nil + case http.StatusInternalServerError: + var ( + body RefreshAccessTokenInternalErrorResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("user", "RefreshAccessToken", err) + } + err = ValidateRefreshAccessTokenInternalErrorResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("user", "RefreshAccessToken", err) + } + return nil, NewRefreshAccessTokenInternalError(&body) + case http.StatusUnauthorized: + var ( + body RefreshAccessTokenInvalidTokenResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("user", "RefreshAccessToken", err) + } + err = ValidateRefreshAccessTokenInvalidTokenResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("user", "RefreshAccessToken", err) + } + return nil, NewRefreshAccessTokenInvalidToken(&body) + case http.StatusForbidden: + var ( + body RefreshAccessTokenInvalidScopesResponseBody + err error + ) + err = decoder(resp).Decode(&body) + if err != nil { + return nil, goahttp.ErrDecodingError("user", "RefreshAccessToken", err) + } + err = ValidateRefreshAccessTokenInvalidScopesResponseBody(&body) + if err != nil { + return nil, goahttp.ErrValidationError("user", "RefreshAccessToken", err) + } + return nil, NewRefreshAccessTokenInvalidScopes(&body) + default: + body, _ := ioutil.ReadAll(resp.Body) + return nil, goahttp.ErrInvalidResponse("user", "RefreshAccessToken", resp.StatusCode, string(body)) + } + } +} + +// unmarshalAccessTokenResponseBodyToUserAccessToken builds a value of type +// *user.AccessToken from a value of type *AccessTokenResponseBody. +func unmarshalAccessTokenResponseBodyToUserAccessToken(v *AccessTokenResponseBody) *user.AccessToken { + res := &user.AccessToken{} + if v.Access != nil { + res.Access = unmarshalTokenResponseBodyToUserToken(v.Access) + } + + return res +} + +// unmarshalTokenResponseBodyToUserToken builds a value of type *user.Token +// from a value of type *TokenResponseBody. +func unmarshalTokenResponseBodyToUserToken(v *TokenResponseBody) *user.Token { + if v == nil { + return nil + } + res := &user.Token{ + Token: *v.Token, + RefreshInterval: *v.RefreshInterval, + ExpiresAt: *v.ExpiresAt, + } + + return res +} diff --git a/api/gen/http/user/client/paths.go b/api/gen/http/user/client/paths.go new file mode 100644 index 0000000000..7646c0fed3 --- /dev/null +++ b/api/gen/http/user/client/paths.go @@ -0,0 +1,13 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// HTTP request path constructors for the user service. +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package client + +// RefreshAccessTokenUserPath returns the URL path to the user service RefreshAccessToken HTTP endpoint. +func RefreshAccessTokenUserPath() string { + return "/user/refresh/accesstoken" +} diff --git a/api/gen/http/user/client/types.go b/api/gen/http/user/client/types.go new file mode 100644 index 0000000000..565a6483a1 --- /dev/null +++ b/api/gen/http/user/client/types.go @@ -0,0 +1,258 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// user HTTP client types +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package client + +import ( + user "github.com/tektoncd/hub/api/gen/user" + goa "goa.design/goa/v3/pkg" +) + +// RefreshAccessTokenResponseBody is the type of the "user" service +// "RefreshAccessToken" endpoint HTTP response body. +type RefreshAccessTokenResponseBody struct { + // User Access JWT + Data *AccessTokenResponseBody `form:"data,omitempty" json:"data,omitempty" xml:"data,omitempty"` +} + +// RefreshAccessTokenInternalErrorResponseBody is the type of the "user" +// service "RefreshAccessToken" endpoint HTTP response body for the +// "internal-error" error. +type RefreshAccessTokenInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// RefreshAccessTokenInvalidTokenResponseBody is the type of the "user" service +// "RefreshAccessToken" endpoint HTTP response body for the "invalid-token" +// error. +type RefreshAccessTokenInvalidTokenResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// RefreshAccessTokenInvalidScopesResponseBody is the type of the "user" +// service "RefreshAccessToken" endpoint HTTP response body for the +// "invalid-scopes" error. +type RefreshAccessTokenInvalidScopesResponseBody struct { + // Name is the name of this class of errors. + Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` + // ID is a unique identifier for this particular occurrence of the problem. + ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"` + // Is the error temporary? + Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"` + // Is the error a timeout? + Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"` + // Is the error a server-side fault? + Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"` +} + +// AccessTokenResponseBody is used to define fields on response body types. +type AccessTokenResponseBody struct { + // Access Token for user + Access *TokenResponseBody `form:"access,omitempty" json:"access,omitempty" xml:"access,omitempty"` +} + +// TokenResponseBody is used to define fields on response body types. +type TokenResponseBody struct { + // JWT + Token *string `form:"token,omitempty" json:"token,omitempty" xml:"token,omitempty"` + // Duration the token will Expire In + RefreshInterval *string `form:"refreshInterval,omitempty" json:"refreshInterval,omitempty" xml:"refreshInterval,omitempty"` + // Time the token will expires at + ExpiresAt *int64 `form:"expiresAt,omitempty" json:"expiresAt,omitempty" xml:"expiresAt,omitempty"` +} + +// NewRefreshAccessTokenResultOK builds a "user" service "RefreshAccessToken" +// endpoint result from a HTTP "OK" response. +func NewRefreshAccessTokenResultOK(body *RefreshAccessTokenResponseBody) *user.RefreshAccessTokenResult { + v := &user.RefreshAccessTokenResult{} + v.Data = unmarshalAccessTokenResponseBodyToUserAccessToken(body.Data) + + return v +} + +// NewRefreshAccessTokenInternalError builds a user service RefreshAccessToken +// endpoint internal-error error. +func NewRefreshAccessTokenInternalError(body *RefreshAccessTokenInternalErrorResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewRefreshAccessTokenInvalidToken builds a user service RefreshAccessToken +// endpoint invalid-token error. +func NewRefreshAccessTokenInvalidToken(body *RefreshAccessTokenInvalidTokenResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// NewRefreshAccessTokenInvalidScopes builds a user service RefreshAccessToken +// endpoint invalid-scopes error. +func NewRefreshAccessTokenInvalidScopes(body *RefreshAccessTokenInvalidScopesResponseBody) *goa.ServiceError { + v := &goa.ServiceError{ + Name: *body.Name, + ID: *body.ID, + Message: *body.Message, + Temporary: *body.Temporary, + Timeout: *body.Timeout, + Fault: *body.Fault, + } + + return v +} + +// ValidateRefreshAccessTokenResponseBody runs the validations defined on +// RefreshAccessTokenResponseBody +func ValidateRefreshAccessTokenResponseBody(body *RefreshAccessTokenResponseBody) (err error) { + if body.Data == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("data", "body")) + } + if body.Data != nil { + if err2 := ValidateAccessTokenResponseBody(body.Data); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateRefreshAccessTokenInternalErrorResponseBody runs the validations +// defined on RefreshAccessToken_internal-error_Response_Body +func ValidateRefreshAccessTokenInternalErrorResponseBody(body *RefreshAccessTokenInternalErrorResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateRefreshAccessTokenInvalidTokenResponseBody runs the validations +// defined on RefreshAccessToken_invalid-token_Response_Body +func ValidateRefreshAccessTokenInvalidTokenResponseBody(body *RefreshAccessTokenInvalidTokenResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateRefreshAccessTokenInvalidScopesResponseBody runs the validations +// defined on RefreshAccessToken_invalid-scopes_Response_Body +func ValidateRefreshAccessTokenInvalidScopesResponseBody(body *RefreshAccessTokenInvalidScopesResponseBody) (err error) { + if body.Name == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("name", "body")) + } + if body.ID == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("id", "body")) + } + if body.Message == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("message", "body")) + } + if body.Temporary == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("temporary", "body")) + } + if body.Timeout == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("timeout", "body")) + } + if body.Fault == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("fault", "body")) + } + return +} + +// ValidateAccessTokenResponseBody runs the validations defined on +// AccessTokenResponseBody +func ValidateAccessTokenResponseBody(body *AccessTokenResponseBody) (err error) { + if body.Access != nil { + if err2 := ValidateTokenResponseBody(body.Access); err2 != nil { + err = goa.MergeErrors(err, err2) + } + } + return +} + +// ValidateTokenResponseBody runs the validations defined on TokenResponseBody +func ValidateTokenResponseBody(body *TokenResponseBody) (err error) { + if body.Token == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("token", "body")) + } + if body.RefreshInterval == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("refreshInterval", "body")) + } + if body.ExpiresAt == nil { + err = goa.MergeErrors(err, goa.MissingFieldError("expiresAt", "body")) + } + return +} diff --git a/api/gen/http/user/server/encode_decode.go b/api/gen/http/user/server/encode_decode.go new file mode 100644 index 0000000000..f9f24352b3 --- /dev/null +++ b/api/gen/http/user/server/encode_decode.go @@ -0,0 +1,134 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// user HTTP server encoders and decoders +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package server + +import ( + "context" + "net/http" + "strings" + + user "github.com/tektoncd/hub/api/gen/user" + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" +) + +// EncodeRefreshAccessTokenResponse returns an encoder for responses returned +// by the user RefreshAccessToken endpoint. +func EncodeRefreshAccessTokenResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { + return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { + res := v.(*user.RefreshAccessTokenResult) + enc := encoder(ctx, w) + body := NewRefreshAccessTokenResponseBody(res) + w.WriteHeader(http.StatusOK) + return enc.Encode(body) + } +} + +// DecodeRefreshAccessTokenRequest returns a decoder for requests sent to the +// user RefreshAccessToken endpoint. +func DecodeRefreshAccessTokenRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) { + return func(r *http.Request) (interface{}, error) { + var ( + refreshToken string + err error + ) + refreshToken = r.Header.Get("Authorization") + if refreshToken == "" { + err = goa.MergeErrors(err, goa.MissingFieldError("Authorization", "header")) + } + if err != nil { + return nil, err + } + payload := NewRefreshAccessTokenPayload(refreshToken) + if strings.Contains(payload.RefreshToken, " ") { + // Remove authorization scheme prefix (e.g. "Bearer") + cred := strings.SplitN(payload.RefreshToken, " ", 2)[1] + payload.RefreshToken = cred + } + + return payload, nil + } +} + +// EncodeRefreshAccessTokenError returns an encoder for errors returned by the +// RefreshAccessToken user endpoint. +func EncodeRefreshAccessTokenError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error { + encodeError := goahttp.ErrorEncoder(encoder, formatter) + return func(ctx context.Context, w http.ResponseWriter, v error) error { + en, ok := v.(ErrorNamer) + if !ok { + return encodeError(ctx, w, v) + } + switch en.ErrorName() { + case "internal-error": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewRefreshAccessTokenInternalErrorResponseBody(res) + } + w.Header().Set("goa-error", "internal-error") + w.WriteHeader(http.StatusInternalServerError) + return enc.Encode(body) + case "invalid-token": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewRefreshAccessTokenInvalidTokenResponseBody(res) + } + w.Header().Set("goa-error", "invalid-token") + w.WriteHeader(http.StatusUnauthorized) + return enc.Encode(body) + case "invalid-scopes": + res := v.(*goa.ServiceError) + enc := encoder(ctx, w) + var body interface{} + if formatter != nil { + body = formatter(res) + } else { + body = NewRefreshAccessTokenInvalidScopesResponseBody(res) + } + w.Header().Set("goa-error", "invalid-scopes") + w.WriteHeader(http.StatusForbidden) + return enc.Encode(body) + default: + return encodeError(ctx, w, v) + } + } +} + +// marshalUserAccessTokenToAccessTokenResponseBody builds a value of type +// *AccessTokenResponseBody from a value of type *user.AccessToken. +func marshalUserAccessTokenToAccessTokenResponseBody(v *user.AccessToken) *AccessTokenResponseBody { + res := &AccessTokenResponseBody{} + if v.Access != nil { + res.Access = marshalUserTokenToTokenResponseBody(v.Access) + } + + return res +} + +// marshalUserTokenToTokenResponseBody builds a value of type +// *TokenResponseBody from a value of type *user.Token. +func marshalUserTokenToTokenResponseBody(v *user.Token) *TokenResponseBody { + if v == nil { + return nil + } + res := &TokenResponseBody{ + Token: v.Token, + RefreshInterval: v.RefreshInterval, + ExpiresAt: v.ExpiresAt, + } + + return res +} diff --git a/api/gen/http/user/server/paths.go b/api/gen/http/user/server/paths.go new file mode 100644 index 0000000000..5495518728 --- /dev/null +++ b/api/gen/http/user/server/paths.go @@ -0,0 +1,13 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// HTTP request path constructors for the user service. +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package server + +// RefreshAccessTokenUserPath returns the URL path to the user service RefreshAccessToken HTTP endpoint. +func RefreshAccessTokenUserPath() string { + return "/user/refresh/accesstoken" +} diff --git a/api/gen/http/user/server/server.go b/api/gen/http/user/server/server.go new file mode 100644 index 0000000000..78326b74e3 --- /dev/null +++ b/api/gen/http/user/server/server.go @@ -0,0 +1,179 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// user HTTP server +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package server + +import ( + "context" + "net/http" + + user "github.com/tektoncd/hub/api/gen/user" + goahttp "goa.design/goa/v3/http" + goa "goa.design/goa/v3/pkg" + "goa.design/plugins/v3/cors" +) + +// Server lists the user service endpoint HTTP handlers. +type Server struct { + Mounts []*MountPoint + RefreshAccessToken http.Handler + CORS http.Handler +} + +// ErrorNamer is an interface implemented by generated error structs that +// exposes the name of the error as defined in the design. +type ErrorNamer interface { + ErrorName() string +} + +// MountPoint holds information about the mounted endpoints. +type MountPoint struct { + // Method is the name of the service method served by the mounted HTTP handler. + Method string + // Verb is the HTTP method used to match requests to the mounted handler. + Verb string + // Pattern is the HTTP request path pattern used to match requests to the + // mounted handler. + Pattern string +} + +// New instantiates HTTP handlers for all the user service endpoints using the +// provided encoder and decoder. The handlers are mounted on the given mux +// using the HTTP verb and path defined in the design. errhandler is called +// whenever a response fails to be encoded. formatter is used to format errors +// returned by the service methods prior to encoding. Both errhandler and +// formatter are optional and can be nil. +func New( + e *user.Endpoints, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) *Server { + return &Server{ + Mounts: []*MountPoint{ + {"RefreshAccessToken", "POST", "/user/refresh/accesstoken"}, + {"CORS", "OPTIONS", "/user/refresh/accesstoken"}, + }, + RefreshAccessToken: NewRefreshAccessTokenHandler(e.RefreshAccessToken, mux, decoder, encoder, errhandler, formatter), + CORS: NewCORSHandler(), + } +} + +// Service returns the name of the service served. +func (s *Server) Service() string { return "user" } + +// Use wraps the server handlers with the given middleware. +func (s *Server) Use(m func(http.Handler) http.Handler) { + s.RefreshAccessToken = m(s.RefreshAccessToken) + s.CORS = m(s.CORS) +} + +// Mount configures the mux to serve the user endpoints. +func Mount(mux goahttp.Muxer, h *Server) { + MountRefreshAccessTokenHandler(mux, h.RefreshAccessToken) + MountCORSHandler(mux, h.CORS) +} + +// MountRefreshAccessTokenHandler configures the mux to serve the "user" +// service "RefreshAccessToken" endpoint. +func MountRefreshAccessTokenHandler(mux goahttp.Muxer, h http.Handler) { + f, ok := handleUserOrigin(h).(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("POST", "/user/refresh/accesstoken", f) +} + +// NewRefreshAccessTokenHandler creates a HTTP handler which loads the HTTP +// request and calls the "user" service "RefreshAccessToken" endpoint. +func NewRefreshAccessTokenHandler( + endpoint goa.Endpoint, + mux goahttp.Muxer, + decoder func(*http.Request) goahttp.Decoder, + encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, + errhandler func(context.Context, http.ResponseWriter, error), + formatter func(err error) goahttp.Statuser, +) http.Handler { + var ( + decodeRequest = DecodeRefreshAccessTokenRequest(mux, decoder) + encodeResponse = EncodeRefreshAccessTokenResponse(encoder) + encodeError = EncodeRefreshAccessTokenError(encoder, formatter) + ) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ctx := context.WithValue(r.Context(), goahttp.AcceptTypeKey, r.Header.Get("Accept")) + ctx = context.WithValue(ctx, goa.MethodKey, "RefreshAccessToken") + ctx = context.WithValue(ctx, goa.ServiceKey, "user") + payload, err := decodeRequest(r) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + res, err := endpoint(ctx, payload) + if err != nil { + if err := encodeError(ctx, w, err); err != nil { + errhandler(ctx, w, err) + } + return + } + if err := encodeResponse(ctx, w, res); err != nil { + errhandler(ctx, w, err) + } + }) +} + +// MountCORSHandler configures the mux to serve the CORS endpoints for the +// service user. +func MountCORSHandler(mux goahttp.Muxer, h http.Handler) { + h = handleUserOrigin(h) + f, ok := h.(http.HandlerFunc) + if !ok { + f = func(w http.ResponseWriter, r *http.Request) { + h.ServeHTTP(w, r) + } + } + mux.Handle("OPTIONS", "/user/refresh/accesstoken", f) +} + +// NewCORSHandler creates a HTTP handler which returns a simple 200 response. +func NewCORSHandler() http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + }) +} + +// handleUserOrigin applies the CORS response headers corresponding to the +// origin for the service user. +func handleUserOrigin(h http.Handler) http.Handler { + origHndlr := h.(http.HandlerFunc) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + origin := r.Header.Get("Origin") + if origin == "" { + // Not a CORS request + origHndlr(w, r) + return + } + if cors.MatchOrigin(origin, "*") { + w.Header().Set("Access-Control-Allow-Origin", origin) + w.Header().Set("Access-Control-Allow-Credentials", "false") + if acrm := r.Header.Get("Access-Control-Request-Method"); acrm != "" { + // We are handling a preflight request + w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT") + w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization") + } + origHndlr(w, r) + return + } + origHndlr(w, r) + return + }) +} diff --git a/api/gen/http/user/server/types.go b/api/gen/http/user/server/types.go new file mode 100644 index 0000000000..daf84a1f5f --- /dev/null +++ b/api/gen/http/user/server/types.go @@ -0,0 +1,154 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// user HTTP server types +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package server + +import ( + user "github.com/tektoncd/hub/api/gen/user" + goa "goa.design/goa/v3/pkg" +) + +// RefreshAccessTokenResponseBody is the type of the "user" service +// "RefreshAccessToken" endpoint HTTP response body. +type RefreshAccessTokenResponseBody struct { + // User Access JWT + Data *AccessTokenResponseBody `form:"data" json:"data" xml:"data"` +} + +// RefreshAccessTokenInternalErrorResponseBody is the type of the "user" +// service "RefreshAccessToken" endpoint HTTP response body for the +// "internal-error" error. +type RefreshAccessTokenInternalErrorResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// RefreshAccessTokenInvalidTokenResponseBody is the type of the "user" service +// "RefreshAccessToken" endpoint HTTP response body for the "invalid-token" +// error. +type RefreshAccessTokenInvalidTokenResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// RefreshAccessTokenInvalidScopesResponseBody is the type of the "user" +// service "RefreshAccessToken" endpoint HTTP response body for the +// "invalid-scopes" error. +type RefreshAccessTokenInvalidScopesResponseBody struct { + // Name is the name of this class of errors. + Name string `form:"name" json:"name" xml:"name"` + // ID is a unique identifier for this particular occurrence of the problem. + ID string `form:"id" json:"id" xml:"id"` + // Message is a human-readable explanation specific to this occurrence of the + // problem. + Message string `form:"message" json:"message" xml:"message"` + // Is the error temporary? + Temporary bool `form:"temporary" json:"temporary" xml:"temporary"` + // Is the error a timeout? + Timeout bool `form:"timeout" json:"timeout" xml:"timeout"` + // Is the error a server-side fault? + Fault bool `form:"fault" json:"fault" xml:"fault"` +} + +// AccessTokenResponseBody is used to define fields on response body types. +type AccessTokenResponseBody struct { + // Access Token for user + Access *TokenResponseBody `form:"access,omitempty" json:"access,omitempty" xml:"access,omitempty"` +} + +// TokenResponseBody is used to define fields on response body types. +type TokenResponseBody struct { + // JWT + Token string `form:"token" json:"token" xml:"token"` + // Duration the token will Expire In + RefreshInterval string `form:"refreshInterval" json:"refreshInterval" xml:"refreshInterval"` + // Time the token will expires at + ExpiresAt int64 `form:"expiresAt" json:"expiresAt" xml:"expiresAt"` +} + +// NewRefreshAccessTokenResponseBody builds the HTTP response body from the +// result of the "RefreshAccessToken" endpoint of the "user" service. +func NewRefreshAccessTokenResponseBody(res *user.RefreshAccessTokenResult) *RefreshAccessTokenResponseBody { + body := &RefreshAccessTokenResponseBody{} + if res.Data != nil { + body.Data = marshalUserAccessTokenToAccessTokenResponseBody(res.Data) + } + return body +} + +// NewRefreshAccessTokenInternalErrorResponseBody builds the HTTP response body +// from the result of the "RefreshAccessToken" endpoint of the "user" service. +func NewRefreshAccessTokenInternalErrorResponseBody(res *goa.ServiceError) *RefreshAccessTokenInternalErrorResponseBody { + body := &RefreshAccessTokenInternalErrorResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewRefreshAccessTokenInvalidTokenResponseBody builds the HTTP response body +// from the result of the "RefreshAccessToken" endpoint of the "user" service. +func NewRefreshAccessTokenInvalidTokenResponseBody(res *goa.ServiceError) *RefreshAccessTokenInvalidTokenResponseBody { + body := &RefreshAccessTokenInvalidTokenResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewRefreshAccessTokenInvalidScopesResponseBody builds the HTTP response body +// from the result of the "RefreshAccessToken" endpoint of the "user" service. +func NewRefreshAccessTokenInvalidScopesResponseBody(res *goa.ServiceError) *RefreshAccessTokenInvalidScopesResponseBody { + body := &RefreshAccessTokenInvalidScopesResponseBody{ + Name: res.Name, + ID: res.ID, + Message: res.Message, + Temporary: res.Temporary, + Timeout: res.Timeout, + Fault: res.Fault, + } + return body +} + +// NewRefreshAccessTokenPayload builds a user service RefreshAccessToken +// endpoint payload. +func NewRefreshAccessTokenPayload(refreshToken string) *user.RefreshAccessTokenPayload { + v := &user.RefreshAccessTokenPayload{} + v.RefreshToken = refreshToken + + return v +} diff --git a/api/gen/rating/endpoints.go b/api/gen/rating/endpoints.go index b04f24111a..6ba0482713 100644 --- a/api/gen/rating/endpoints.go +++ b/api/gen/rating/endpoints.go @@ -44,7 +44,7 @@ func NewGetEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint { var err error sc := security.JWTScheme{ Name: "jwt", - Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh"}, + Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh", "refresh:token"}, RequiredScopes: []string{"rating:read"}, } ctx, err = authJWTFn(ctx, p.Token, &sc) @@ -63,7 +63,7 @@ func NewUpdateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint { var err error sc := security.JWTScheme{ Name: "jwt", - Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh"}, + Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh", "refresh:token"}, RequiredScopes: []string{"rating:write"}, } ctx, err = authJWTFn(ctx, p.Token, &sc) diff --git a/api/gen/user/client.go b/api/gen/user/client.go new file mode 100644 index 0000000000..bfbb126ab8 --- /dev/null +++ b/api/gen/user/client.go @@ -0,0 +1,37 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// user client +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package user + +import ( + "context" + + goa "goa.design/goa/v3/pkg" +) + +// Client is the "user" service client. +type Client struct { + RefreshAccessTokenEndpoint goa.Endpoint +} + +// NewClient initializes a "user" service client given the endpoints. +func NewClient(refreshAccessToken goa.Endpoint) *Client { + return &Client{ + RefreshAccessTokenEndpoint: refreshAccessToken, + } +} + +// RefreshAccessToken calls the "RefreshAccessToken" endpoint of the "user" +// service. +func (c *Client) RefreshAccessToken(ctx context.Context, p *RefreshAccessTokenPayload) (res *RefreshAccessTokenResult, err error) { + var ires interface{} + ires, err = c.RefreshAccessTokenEndpoint(ctx, p) + if err != nil { + return + } + return ires.(*RefreshAccessTokenResult), nil +} diff --git a/api/gen/user/endpoints.go b/api/gen/user/endpoints.go new file mode 100644 index 0000000000..d65a4f3a7a --- /dev/null +++ b/api/gen/user/endpoints.go @@ -0,0 +1,53 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// user endpoints +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package user + +import ( + "context" + + goa "goa.design/goa/v3/pkg" + "goa.design/goa/v3/security" +) + +// Endpoints wraps the "user" service endpoints. +type Endpoints struct { + RefreshAccessToken goa.Endpoint +} + +// NewEndpoints wraps the methods of the "user" service with endpoints. +func NewEndpoints(s Service) *Endpoints { + // Casting service to Auther interface + a := s.(Auther) + return &Endpoints{ + RefreshAccessToken: NewRefreshAccessTokenEndpoint(s, a.JWTAuth), + } +} + +// Use applies the given middleware to all the "user" service endpoints. +func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) { + e.RefreshAccessToken = m(e.RefreshAccessToken) +} + +// NewRefreshAccessTokenEndpoint returns an endpoint function that calls the +// method "RefreshAccessToken" of service "user". +func NewRefreshAccessTokenEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint { + return func(ctx context.Context, req interface{}) (interface{}, error) { + p := req.(*RefreshAccessTokenPayload) + var err error + sc := security.JWTScheme{ + Name: "jwt", + Scopes: []string{"rating:read", "rating:write", "agent:create", "catalog:refresh", "config:refresh", "refresh:token"}, + RequiredScopes: []string{"refresh:token"}, + } + ctx, err = authJWTFn(ctx, p.RefreshToken, &sc) + if err != nil { + return nil, err + } + return s.RefreshAccessToken(ctx, p) + } +} diff --git a/api/gen/user/service.go b/api/gen/user/service.go new file mode 100644 index 0000000000..06be6a504c --- /dev/null +++ b/api/gen/user/service.go @@ -0,0 +1,94 @@ +// Code generated by goa v3.2.2, DO NOT EDIT. +// +// user service +// +// Command: +// $ goa gen github.com/tektoncd/hub/api/design + +package user + +import ( + "context" + + goa "goa.design/goa/v3/pkg" + "goa.design/goa/v3/security" +) + +// The user service exposes endpoint to get user specific specs +type Service interface { + // Refresh the access token of User + RefreshAccessToken(context.Context, *RefreshAccessTokenPayload) (res *RefreshAccessTokenResult, err error) +} + +// Auther defines the authorization functions to be implemented by the service. +type Auther interface { + // JWTAuth implements the authorization logic for the JWT security scheme. + JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error) +} + +// ServiceName is the name of the service as defined in the design. This is the +// same value that is set in the endpoint request contexts under the ServiceKey +// key. +const ServiceName = "user" + +// MethodNames lists the service method names as defined in the design. These +// are the same values that are set in the endpoint request contexts under the +// MethodKey key. +var MethodNames = [1]string{"RefreshAccessToken"} + +// RefreshAccessTokenPayload is the payload type of the user service +// RefreshAccessToken method. +type RefreshAccessTokenPayload struct { + // Refresh Token of User + RefreshToken string +} + +// RefreshAccessTokenResult is the result type of the user service +// RefreshAccessToken method. +type RefreshAccessTokenResult struct { + // User Access JWT + Data *AccessToken +} + +// Access Token for User +type AccessToken struct { + // Access Token for user + Access *Token +} + +// Token includes the JWT, Expire Duration & Time +type Token struct { + // JWT + Token string + // Duration the token will Expire In + RefreshInterval string + // Time the token will expires at + ExpiresAt int64 +} + +// MakeInvalidToken builds a goa.ServiceError from an error. +func MakeInvalidToken(err error) *goa.ServiceError { + return &goa.ServiceError{ + Name: "invalid-token", + ID: goa.NewErrorID(), + Message: err.Error(), + } +} + +// MakeInvalidScopes builds a goa.ServiceError from an error. +func MakeInvalidScopes(err error) *goa.ServiceError { + return &goa.ServiceError{ + Name: "invalid-scopes", + ID: goa.NewErrorID(), + Message: err.Error(), + } +} + +// MakeInternalError builds a goa.ServiceError from an error. +func MakeInternalError(err error) *goa.ServiceError { + return &goa.ServiceError{ + Name: "internal-error", + ID: goa.NewErrorID(), + Message: err.Error(), + } +} diff --git a/api/pkg/service/user/user.go b/api/pkg/service/user/user.go new file mode 100644 index 0000000000..e07fc50afa --- /dev/null +++ b/api/pkg/service/user/user.go @@ -0,0 +1,130 @@ +// Copyright © 2021 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package user + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "fmt" + + "github.com/tektoncd/hub/api/gen/log" + "github.com/tektoncd/hub/api/gen/user" + "github.com/tektoncd/hub/api/pkg/app" + "github.com/tektoncd/hub/api/pkg/db/model" + "github.com/tektoncd/hub/api/pkg/service/auth" + "github.com/tektoncd/hub/api/pkg/token" + "gorm.io/gorm" +) + +type service struct { + *auth.Service + api app.Config +} + +type request struct { + db *gorm.DB + log *log.Logger + user *model.User + defaultScopes []string + jwtConfig *app.JWTConfig +} + +var ( + invalidRefreshToken = user.MakeInvalidToken(fmt.Errorf("invalid refresh token")) + refreshError = user.MakeInternalError(fmt.Errorf("failed to refresh access token")) +) + +// New returns the user service implementation. +func New(api app.Config) user.Service { + return &service{auth.NewService(api, "user"), api} +} + +// Refreshes the access token of User +func (s *service) RefreshAccessToken(ctx context.Context, p *user.RefreshAccessTokenPayload) (*user.RefreshAccessTokenResult, error) { + + user, err := s.User(ctx) + if err != nil { + return nil, err + } + + if user.RefreshTokenChecksum != createChecksum(p.RefreshToken) { + return nil, invalidRefreshToken + } + + req := request{ + db: s.DB(ctx), + log: s.Logger(ctx), + user: user, + defaultScopes: s.api.Data().Default.Scopes, + jwtConfig: s.api.JWTConfig(), + } + + return req.refreshAccessToken() +} + +func (r *request) refreshAccessToken() (*user.RefreshAccessTokenResult, error) { + + scopes, err := r.userScopes() + if err != nil { + return nil, err + } + + req := token.Request{ + User: r.user, + Scopes: scopes, + JWTConfig: r.jwtConfig, + } + + accessToken, accessExpiresAt, err := req.AccessJWT() + if err != nil { + r.log.Error(err) + return nil, refreshError + } + + data := &user.AccessToken{ + Access: &user.Token{ + Token: accessToken, + RefreshInterval: r.jwtConfig.AccessExpiresIn.String(), + ExpiresAt: accessExpiresAt, + }, + } + + return &user.RefreshAccessTokenResult{Data: data}, nil +} + +func (r *request) userScopes() ([]string, error) { + + var userScopes []string = r.defaultScopes + + q := r.db.Preload("Scopes").Where(&model.User{GithubLogin: r.user.GithubLogin}) + + dbUser := &model.User{} + if err := q.Find(dbUser).Error; err != nil { + r.log.Error(err) + return nil, refreshError + } + + for _, s := range dbUser.Scopes { + userScopes = append(userScopes, s.Name) + } + + return userScopes, nil +} + +func createChecksum(token string) string { + hash := sha256.Sum256([]byte(token)) + return hex.EncodeToString(hash[:]) +} diff --git a/api/pkg/service/user/user_http_test.go b/api/pkg/service/user/user_http_test.go new file mode 100644 index 0000000000..e94a7a91ee --- /dev/null +++ b/api/pkg/service/user/user_http_test.go @@ -0,0 +1,126 @@ +// Copyright © 2021 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package user + +import ( + "encoding/json" + "io/ioutil" + "net/http" + "testing" + + "github.com/dgrijalva/jwt-go" + "github.com/ikawaha/goahttpcheck" + "github.com/stretchr/testify/assert" + "github.com/tektoncd/hub/api/gen/http/user/server" + "github.com/tektoncd/hub/api/gen/user" + "github.com/tektoncd/hub/api/pkg/service/auth" + "github.com/tektoncd/hub/api/pkg/testutils" + "github.com/tektoncd/hub/api/pkg/token" + goa "goa.design/goa/v3/pkg" +) + +func RefreshAccessTokenChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { + service := auth.NewService(tc.APIConfig, "admin") + checker := goahttpcheck.New() + checker.Mount(server.NewRefreshAccessTokenHandler, + server.MountRefreshAccessTokenHandler, + user.NewRefreshAccessTokenEndpoint(New(tc), service.JWTAuth)) + return checker +} + +func TestRefreshAccessToken_Http(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + // user refresh token + testUser, refreshToken, err := tc.RefreshTokenForUser("abc") + assert.Equal(t, testUser.GithubLogin, "abc") + assert.NoError(t, err) + + // Mocks the time + jwt.TimeFunc = testutils.Now + token.Now = testutils.Now + + RefreshAccessTokenChecker(tc).Test(t, http.MethodPost, "/user/refresh/accesstoken"). + WithHeader("Authorization", refreshToken).Check(). + HasStatus(200).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + res := &user.RefreshAccessTokenResult{} + marshallErr := json.Unmarshal([]byte(b), &res) + assert.NoError(t, marshallErr) + + // expected access jwt + user, accessToken, err := tc.UserWithScopes("abc", "rating:read", "rating:write") + assert.Equal(t, user.GithubName, "abc") + assert.NoError(t, err) + + assert.Equal(t, accessToken, res.Data.Access.Token) + }) +} + +func TestRefreshAccessToken_Http_ExpiredRefreshToken(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + // user refresh token + testUser, refreshToken, err := tc.RefreshTokenForUser("abc") + assert.Equal(t, testUser.GithubLogin, "abc") + assert.NoError(t, err) + + // Mocks the time + jwt.TimeFunc = testutils.NowAfterDuration(tc.JWTConfig().RefreshExpiresIn) + + RefreshAccessTokenChecker(tc).Test(t, http.MethodPost, "/user/refresh/accesstoken"). + WithHeader("Authorization", refreshToken).Check(). + HasStatus(401).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + err := &goa.ServiceError{} + marshallErr := json.Unmarshal([]byte(b), &err) + assert.NoError(t, marshallErr) + assert.EqualError(t, err, "invalid or expired user token") + }) +} + +func TestRefreshAccessToken_Http_RefreshTokenChecksumIsDifferent(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + // user refresh token + testUser, refreshToken, err := tc.RefreshTokenForUser("foo") + assert.Equal(t, testUser.GithubLogin, "foo") + assert.NoError(t, err) + + // Mocks the time + jwt.TimeFunc = testutils.Now + + RefreshAccessTokenChecker(tc).Test(t, http.MethodPost, "/user/refresh/accesstoken"). + WithHeader("Authorization", refreshToken).Check(). + HasStatus(401).Cb(func(r *http.Response) { + b, readErr := ioutil.ReadAll(r.Body) + assert.NoError(t, readErr) + defer r.Body.Close() + + err := &goa.ServiceError{} + marshallErr := json.Unmarshal([]byte(b), &err) + assert.NoError(t, marshallErr) + assert.EqualError(t, err, "invalid refresh token") + }) +} diff --git a/api/pkg/service/user/user_test.go b/api/pkg/service/user/user_test.go new file mode 100644 index 0000000000..176c3b9c76 --- /dev/null +++ b/api/pkg/service/user/user_test.go @@ -0,0 +1,73 @@ +// Copyright © 2021 The Tekton Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package user + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/tektoncd/hub/api/gen/user" + "github.com/tektoncd/hub/api/pkg/service/auth" + "github.com/tektoncd/hub/api/pkg/testutils" + "github.com/tektoncd/hub/api/pkg/token" +) + +func TestRefreshAccessToken(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + // user refresh token + testUser, refreshToken, err := tc.RefreshTokenForUser("abc") + assert.Equal(t, testUser.GithubLogin, "abc") + assert.NoError(t, err) + + // Mocks the time + token.Now = testutils.Now + + userSvc := New(tc) + ctx := auth.WithUserID(context.Background(), testUser.ID) + payload := &user.RefreshAccessTokenPayload{RefreshToken: refreshToken} + res, err := userSvc.RefreshAccessToken(ctx, payload) + assert.NoError(t, err) + + // expected access jwt for user + user, accessToken, err := tc.UserWithScopes("abc", "rating:read", "rating:write") + assert.Equal(t, user.GithubLogin, "abc") + assert.NoError(t, err) + + accessExpiryTime := testutils.Now().Add(tc.JWTConfig().AccessExpiresIn).Unix() + + assert.Equal(t, accessToken, res.Data.Access.Token) + assert.Equal(t, tc.JWTConfig().AccessExpiresIn.String(), res.Data.Access.RefreshInterval) + assert.Equal(t, accessExpiryTime, res.Data.Access.ExpiresAt) +} + +func TestRefreshAccessToken_RefreshTokenChecksumIsDifferent(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + // user refresh token + testUser, refreshToken, err := tc.RefreshTokenForUser("foo") + assert.Equal(t, testUser.GithubLogin, "foo") + assert.NoError(t, err) + + userSvc := New(tc) + ctx := auth.WithUserID(context.Background(), testUser.ID) + payload := &user.RefreshAccessTokenPayload{RefreshToken: refreshToken} + _, err = userSvc.RefreshAccessToken(ctx, payload) + assert.Error(t, err) + assert.EqualError(t, err, "invalid refresh token") +} diff --git a/api/test/fixtures/users.yaml b/api/test/fixtures/users.yaml index 8b41a33821..6fee571e1b 100644 --- a/api/test/fixtures/users.yaml +++ b/api/test/fixtures/users.yaml @@ -20,6 +20,14 @@ created_at: 2016-01-01 12:30:12 UTC updated_at: 2016-01-01 12:30:12 UTC +- id: 13 + github_name: abc + github_login: abc + type: user + refresh_token_checksum: 7bd024c1d9a3009dd4208891f2ffd49cb5e972c034bce46883a7c1d982ba9b39 + created_at: 2016-01-01 12:30:12 UTC + updated_at: 2016-01-01 12:30:12 UTC + - id: 21 agent_name: agent-001 type: agent