diff --git a/api/design/rating.go b/api/design/rating.go index 08f48aeb4b..c26709744c 100644 --- a/api/design/rating.go +++ b/api/design/rating.go @@ -15,7 +15,6 @@ package design import ( - "github.com/tektoncd/hub/api/design/types" . "goa.design/goa/v3/dsl" ) @@ -29,13 +28,10 @@ var _ = Service("rating", func() { Method("Get", func() { Description("Find user's rating for a resource") - Security(types.JWTAuth, func() { - Scope("rating:read") - }) Payload(func() { Attribute("id", UInt, "ID of a resource") - Token("token", String, "JWT") - Required("id", "token") + Attribute("session", String, "Session ID") + Required("id", "session") }) Result(func() { Attribute("rating", Int, "User rating for resource", func() { @@ -46,7 +42,7 @@ var _ = Service("rating", func() { HTTP(func() { GET("/resource/{id}/rating") - Header("token:Authorization") + Cookie("session:accessToken") Response(StatusOK) Response("not-found", StatusNotFound) @@ -58,22 +54,19 @@ var _ = Service("rating", func() { Method("Update", func() { Description("Update user's rating for a resource") - Security(types.JWTAuth, func() { - Scope("rating:write") - }) Payload(func() { Attribute("id", UInt, "ID of a resource") Attribute("rating", UInt, "User rating for resource", func() { Minimum(0) Maximum(5) }) - Token("token", String, "JWT") - Required("id", "token", "rating") + Attribute("session", String, "Session ID") + Required("id", "rating", "session") }) HTTP(func() { PUT("/resource/{id}/rating") - Header("token:Authorization") + Cookie("session:accessToken") Response(StatusOK) Response("not-found", StatusNotFound) diff --git a/api/gen/http/cli/hub/cli.go b/api/gen/http/cli/hub/cli.go index 4472091759..6898a35214 100644 --- a/api/gen/http/cli/hub/cli.go +++ b/api/gen/http/cli/hub/cli.go @@ -48,7 +48,7 @@ func UsageExamples() string { }' --token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"` + "\n" + os.Args[0] + ` catalog refresh --catalog-name "tekton" --token "Perspiciatis sed voluptatem nulla laborum ut quidem."` + "\n" + os.Args[0] + ` category list` + "\n" + - os.Args[0] + ` rating get --id 16939312758267551472 --token "Est quae rerum autem."` + "\n" + + os.Args[0] + ` rating get --id 16939312758267551472 --session "Est quae rerum autem."` + "\n" + os.Args[0] + ` resource query --name "buildah" --catalogs '[ "tekton", "openshift" @@ -106,14 +106,14 @@ func ParseEndpoint( ratingFlags = flag.NewFlagSet("rating", flag.ContinueOnError) - ratingGetFlags = flag.NewFlagSet("get", flag.ExitOnError) - ratingGetIDFlag = ratingGetFlags.String("id", "REQUIRED", "ID of a resource") - ratingGetTokenFlag = ratingGetFlags.String("token", "REQUIRED", "") + ratingGetFlags = flag.NewFlagSet("get", flag.ExitOnError) + ratingGetIDFlag = ratingGetFlags.String("id", "REQUIRED", "ID of a resource") + ratingGetSessionFlag = ratingGetFlags.String("session", "REQUIRED", "") - ratingUpdateFlags = flag.NewFlagSet("update", flag.ExitOnError) - ratingUpdateBodyFlag = ratingUpdateFlags.String("body", "REQUIRED", "") - ratingUpdateIDFlag = ratingUpdateFlags.String("id", "REQUIRED", "ID of a resource") - ratingUpdateTokenFlag = ratingUpdateFlags.String("token", "REQUIRED", "") + ratingUpdateFlags = flag.NewFlagSet("update", flag.ExitOnError) + ratingUpdateBodyFlag = ratingUpdateFlags.String("body", "REQUIRED", "") + ratingUpdateIDFlag = ratingUpdateFlags.String("id", "REQUIRED", "ID of a resource") + ratingUpdateSessionFlag = ratingUpdateFlags.String("session", "REQUIRED", "") resourceFlags = flag.NewFlagSet("resource", flag.ContinueOnError) @@ -351,10 +351,10 @@ func ParseEndpoint( switch epn { case "get": endpoint = c.Get() - data, err = ratingc.BuildGetPayload(*ratingGetIDFlag, *ratingGetTokenFlag) + data, err = ratingc.BuildGetPayload(*ratingGetIDFlag, *ratingGetSessionFlag) case "update": endpoint = c.Update() - data, err = ratingc.BuildUpdatePayload(*ratingUpdateBodyFlag, *ratingUpdateIDFlag, *ratingUpdateTokenFlag) + data, err = ratingc.BuildUpdatePayload(*ratingUpdateBodyFlag, *ratingUpdateIDFlag, *ratingUpdateSessionFlag) } case "resource": c := resourcec.NewClient(scheme, host, doer, enc, dec, restore) @@ -528,29 +528,29 @@ Additional help: `, os.Args[0]) } func ratingGetUsage() { - fmt.Fprintf(os.Stderr, `%[1]s [flags] rating get -id UINT -token STRING + fmt.Fprintf(os.Stderr, `%[1]s [flags] rating get -id UINT -session STRING Find user's rating for a resource -id UINT: ID of a resource - -token STRING: + -session STRING: Example: - %[1]s rating get --id 16939312758267551472 --token "Est quae rerum autem." + %[1]s rating get --id 16939312758267551472 --session "Est quae rerum autem." `, os.Args[0]) } func ratingUpdateUsage() { - fmt.Fprintf(os.Stderr, `%[1]s [flags] rating update -body JSON -id UINT -token STRING + fmt.Fprintf(os.Stderr, `%[1]s [flags] rating update -body JSON -id UINT -session STRING Update user's rating for a resource -body JSON: -id UINT: ID of a resource - -token STRING: + -session STRING: Example: %[1]s rating update --body '{ "rating": 1 - }' --id 13743472547044967846 --token "Voluptates illo nostrum illum et." + }' --id 13743472547044967846 --session "Voluptates illo nostrum illum et." `, os.Args[0]) } diff --git a/api/gen/http/openapi.json b/api/gen/http/openapi.json index 644a50302b..06a833f6fd 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":["https"]}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"RefreshAll catalog","description":"Refresh all catalogs\n\n**Required security scopes for jwt**:\n * `catalog:refresh`","operationId":"catalog#RefreshAll","parameters":[{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"type":"array","items":{"$ref":"#/definitions/JobResponse"}}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CatalogRefreshAllInternalErrorResponseBody"}}},"schemes":["https"],"security":[{"jwt_header_Authorization":[]}]}},"/catalog/{catalogName}/error":{"get":{"tags":["catalog"],"summary":"CatalogError catalog","description":"List all errors occurred refreshing a catalog\n\n**Required security scopes for jwt**:\n * `catalog:refresh`","operationId":"catalog#CatalogError","parameters":[{"name":"catalogName","in":"path","description":"Name of catalog","required":true,"type":"string"},{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CatalogCatalogErrorResponseBody","required":["data"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CatalogCatalogErrorInternalErrorResponseBody"}}},"schemes":["https"],"security":[{"jwt_header_Authorization":[]}]}},"/catalog/{catalogName}/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refresh a Catalog by it's name\n\n**Required security scopes for jwt**:\n * `catalog:refresh`","operationId":"catalog#Refresh","parameters":[{"name":"catalogName","in":"path","description":"Name of catalog","required":true,"type":"string"},{"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":["https"],"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":["https"]}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind, catalog, categories, platforms and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","required":false,"type":"string","default":""},{"name":"catalogs","in":"query","description":"Catalogs of resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"categories","in":"query","description":"Category associated with a resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"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":"platforms","in":"query","description":"Platforms 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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/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":"pipelinesversion","in":"query","description":"To find resource compatible with a Tekton pipelines version, use this param","required":false,"type":"string","pattern":"^\\d+(?:\\.\\d+){0,2}$"},{"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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/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":["https"],"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":["https"],"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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","responses":{"301":{"description":"Moved Permanently response.","schema":{"$ref":"#/definitions/ResourceListResponseBody"}}},"schemes":["https"]}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download docs/openapi3.json","description":"JSON document containing the API swagger definition","operationId":"swagger#/schema/swagger.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["https"]}},"/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"}],"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":["https"],"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":["https"],"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":["https"]}},"/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":["https"]}}},"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":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"]},"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":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 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"]},"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":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":"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"]},"AdminRefreshConfigResponseBody":{"title":"AdminRefreshConfigResponseBody","type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"41ba391c8baf1fcd3c62c11272b913dc6613f4cf3b1833cfbb32431dc4384c93"}},"example":{"checksum":"41ba391c8baf1fcd3c62c11272b913dc6613f4cf3b1833cfbb32431dc4384c93"},"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":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"]},"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":true},"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":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 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":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":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentRequestBody":{"title":"AdminUpdateAgentRequestBody","type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"abc"},"scopes":{"type":"array","items":{"type":"string","example":"Rem aperiam ipsam sapiente labore assumenda qui."},"description":"Scopes required for Agent","example":["catalog-refresh","agent:create"]}},"example":{"name":"abc","scopes":["catalog-refresh","agent:create"]},"required":["name","scopes"]},"AdminUpdateAgentResponseBody":{"title":"AdminUpdateAgentResponseBody","type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"example":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token"]},"CatalogCatalogErrorInternalErrorResponseBody":{"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":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"CatalogCatalogErrorResponseBody":{"title":"CatalogCatalogErrorResponseBody","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/CatalogErrorsResponseBody"},"description":"Catalog errors","example":[{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"}]}},"example":{"data":[{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"}]},"required":["data"]},"CatalogErrorsResponseBody":{"title":"CatalogErrorsResponseBody","type":"object","properties":{"errors":{"type":"array","items":{"type":"string","example":"Autem aut id."},"description":"Catalog Error message","example":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"]},"type":{"type":"string","description":"Catalog Errror type","example":"warning"}},"description":"CatalogErrors define the errors that occurred during catalog refresh","example":{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},"required":["type","errors"]},"CatalogRefreshAllInternalErrorResponseBody":{"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":false},"required":["name","id","message","temporary","timeout","fault"]},"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":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"]},"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":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":"Resource Not Found 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"]},"CatalogRefreshResponseBody":{"title":"Mediatype identifier: application/vnd.hub.job; view=default","type":"object","properties":{"catalogName":{"type":"string","description":"Name of the catalog","example":"tekton"},"id":{"type":"integer","description":"id of the job","example":1,"format":"int64"},"status":{"type":"string","description":"status of the job","example":"queued"}},"description":"RefreshResponseBody result type (default view)","example":{"catalogName":"tekton","id":1,"status":"queued"},"required":["id","catalogName","status"]},"CatalogResponseBodyMin":{"title":"Mediatype identifier: application/vnd.hub.catalog; view=default","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"]}},"description":"CatalogResponseBody result type (min view) (default view)","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":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":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"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"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}},"example":{"data":[{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}},"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"}},"example":{"id":1,"name":"Image Builder"},"required":["id","name"]},"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"]},"JobResponse":{"title":"Mediatype identifier: application/vnd.hub.job; view=default","type":"object","properties":{"catalogName":{"type":"string","description":"Name of the catalog","example":"tekton"},"id":{"type":"integer","description":"id of the job","example":1,"format":"int64"},"status":{"type":"string","description":"status of the job","example":"queued"}},"description":"The Job type describes a catalog refresh job that is run asynchronously (default view)","example":{"catalogName":"tekton","id":1,"status":"queued"},"required":["id","catalogName","status"]},"PlatformResponseBody":{"title":"PlatformResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of platform","example":1,"format":"int64"},"name":{"type":"string","description":"Name of platform","example":"linux/amd64"}},"example":{"id":1,"name":"linux/amd64"},"required":["id","name"]},"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":true,"timeout":true},"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":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 scope (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"]},"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":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":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":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":true,"timeout":false},"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":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":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":false}},"description":"Invalid User scope (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"]},"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":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":true,"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":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"]},"RatingUpdateRequestBody":{"title":"RatingUpdateRequestBody","type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":3,"minimum":0,"maximum":5}},"example":{"rating":1},"required":["rating"]},"ResourceDataResponseBodyWithoutVersion":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBodyMin"},"categories":{"type":"array","items":{"$ref":"#/definitions/CategoryResponseBody"},"description":"Categories related to resource","example":[{"id":1,"name":"image-build"}]},"hubURLPath":{"type":"string","description":"Url path of the resource in hub","example":"tekton/task/buildah"},"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"},"platforms":{"type":"array","items":{"$ref":"#/definitions/PlatformResponseBody"},"description":"Platforms related to resource","example":[{"id":1,"name":"linux/amd64"}]},"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,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","categories","kind","hubURLPath","latestVersion","tags","platforms","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,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"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,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceVersionDataResponseBodyWithoutResource":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"deprecated":{"type":"boolean","description":"Deprecation status of a version","example":true},"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"},"hubURLPath":{"type":"string","description":"Url path of the resource in hub","example":"tekton/task/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"},"platforms":{"type":"array","items":{"$ref":"#/definitions/PlatformResponseBody"},"description":"Platforms related to resource version","example":[{"id":1,"name":"linux/s390x"}]},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (withoutResource view) (default view)","example":{"deprecated":true,"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","hubURLPath":"tekton/task/buildah","id":1,"minPipelinesVersion":"0.12.1","platforms":[{"id":1,"name":"linux/s390x"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","platforms","hubURLPath"]},"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"}]}},"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"}]}},"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"]}},"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 +{"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":["https"]}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"RefreshAll catalog","description":"Refresh all catalogs\n\n**Required security scopes for jwt**:\n * `catalog:refresh`","operationId":"catalog#RefreshAll","parameters":[{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"type":"array","items":{"$ref":"#/definitions/JobResponse"}}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CatalogRefreshAllInternalErrorResponseBody"}}},"schemes":["https"],"security":[{"jwt_header_Authorization":[]}]}},"/catalog/{catalogName}/error":{"get":{"tags":["catalog"],"summary":"CatalogError catalog","description":"List all errors occurred refreshing a catalog\n\n**Required security scopes for jwt**:\n * `catalog:refresh`","operationId":"catalog#CatalogError","parameters":[{"name":"catalogName","in":"path","description":"Name of catalog","required":true,"type":"string"},{"name":"Authorization","in":"header","description":"JWT","required":true,"type":"string"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/CatalogCatalogErrorResponseBody","required":["data"]}},"500":{"description":"Internal Server Error response.","schema":{"$ref":"#/definitions/CatalogCatalogErrorInternalErrorResponseBody"}}},"schemes":["https"],"security":[{"jwt_header_Authorization":[]}]}},"/catalog/{catalogName}/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refresh a Catalog by it's name\n\n**Required security scopes for jwt**:\n * `catalog:refresh`","operationId":"catalog#Refresh","parameters":[{"name":"catalogName","in":"path","description":"Name of catalog","required":true,"type":"string"},{"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":["https"],"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":["https"]}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind, catalog, categories, platforms and tags","operationId":"resource#Query","parameters":[{"name":"name","in":"query","description":"Name of resource","required":false,"type":"string","default":""},{"name":"catalogs","in":"query","description":"Catalogs of resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"categories","in":"query","description":"Category associated with a resource to filter by","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"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":"platforms","in":"query","description":"Platforms 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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/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":"pipelinesversion","in":"query","description":"To find resource compatible with a Tekton pipelines version, use this param","required":false,"type":"string","pattern":"^\\d+(?:\\.\\d+){0,2}$"},{"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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/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,"type":"integer"}],"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":["https"]},"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,"type":"integer"},{"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":["https"]}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","type":"string","format":"uri"}}}},"schemes":["https"]}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","responses":{"301":{"description":"Moved Permanently response.","schema":{"$ref":"#/definitions/ResourceListResponseBody"}}},"schemes":["https"]}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download docs/openapi3.json","description":"JSON document containing the API swagger definition","operationId":"swagger#/schema/swagger.json","responses":{"200":{"description":"File downloaded","schema":{"type":"file"}}},"schemes":["https"]}},"/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"}],"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":["https"],"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":["https"],"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":["https"]}},"/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":["https"]}}},"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":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"]},"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":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 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"]},"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":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":"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"]},"AdminRefreshConfigResponseBody":{"title":"AdminRefreshConfigResponseBody","type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"41ba391c8baf1fcd3c62c11272b913dc6613f4cf3b1833cfbb32431dc4384c93"}},"example":{"checksum":"41ba391c8baf1fcd3c62c11272b913dc6613f4cf3b1833cfbb32431dc4384c93"},"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":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"]},"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":true},"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":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 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":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":false},"required":["name","id","message","temporary","timeout","fault"]},"AdminUpdateAgentRequestBody":{"title":"AdminUpdateAgentRequestBody","type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"abc"},"scopes":{"type":"array","items":{"type":"string","example":"Rem aperiam ipsam sapiente labore assumenda qui."},"description":"Scopes required for Agent","example":["catalog-refresh","agent:create"]}},"example":{"name":"abc","scopes":["catalog-refresh","agent:create"]},"required":["name","scopes"]},"AdminUpdateAgentResponseBody":{"title":"AdminUpdateAgentResponseBody","type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"example":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token"]},"CatalogCatalogErrorInternalErrorResponseBody":{"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":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"CatalogCatalogErrorResponseBody":{"title":"CatalogCatalogErrorResponseBody","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/definitions/CatalogErrorsResponseBody"},"description":"Catalog errors","example":[{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"}]}},"example":{"data":[{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"}]},"required":["data"]},"CatalogErrorsResponseBody":{"title":"CatalogErrorsResponseBody","type":"object","properties":{"errors":{"type":"array","items":{"type":"string","example":"Autem aut id."},"description":"Catalog Error message","example":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"]},"type":{"type":"string","description":"Catalog Errror type","example":"warning"}},"description":"CatalogErrors define the errors that occurred during catalog refresh","example":{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},"required":["type","errors"]},"CatalogRefreshAllInternalErrorResponseBody":{"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":false},"required":["name","id","message","temporary","timeout","fault"]},"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":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"]},"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":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":"Resource Not Found 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"]},"CatalogRefreshResponseBody":{"title":"Mediatype identifier: application/vnd.hub.job; view=default","type":"object","properties":{"catalogName":{"type":"string","description":"Name of the catalog","example":"tekton"},"id":{"type":"integer","description":"id of the job","example":1,"format":"int64"},"status":{"type":"string","description":"status of the job","example":"queued"}},"description":"RefreshResponseBody result type (default view)","example":{"catalogName":"tekton","id":1,"status":"queued"},"required":["id","catalogName","status"]},"CatalogResponseBodyMin":{"title":"Mediatype identifier: application/vnd.hub.catalog; view=default","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"]}},"description":"CatalogResponseBody result type (min view) (default view)","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":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":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"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"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}},"example":{"data":[{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}},"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"}},"example":{"id":1,"name":"Image Builder"},"required":["id","name"]},"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"]},"JobResponse":{"title":"Mediatype identifier: application/vnd.hub.job; view=default","type":"object","properties":{"catalogName":{"type":"string","description":"Name of the catalog","example":"tekton"},"id":{"type":"integer","description":"id of the job","example":1,"format":"int64"},"status":{"type":"string","description":"status of the job","example":"queued"}},"description":"The Job type describes a catalog refresh job that is run asynchronously (default view)","example":{"catalogName":"tekton","id":1,"status":"queued"},"required":["id","catalogName","status"]},"PlatformResponseBody":{"title":"PlatformResponseBody","type":"object","properties":{"id":{"type":"integer","description":"ID is the unique id of platform","example":1,"format":"int64"},"name":{"type":"string","description":"Name of platform","example":"linux/amd64"}},"example":{"id":1,"name":"linux/amd64"},"required":["id","name"]},"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":true,"timeout":true},"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":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 scope (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"]},"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":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":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":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":true,"timeout":false},"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":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":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":false}},"description":"Invalid User scope (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"]},"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":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":true,"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":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"]},"RatingUpdateRequestBody":{"title":"RatingUpdateRequestBody","type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":3,"minimum":0,"maximum":5}},"example":{"rating":1},"required":["rating"]},"ResourceDataResponseBodyWithoutVersion":{"title":"Mediatype identifier: application/vnd.hub.resource.data; view=default","type":"object","properties":{"catalog":{"$ref":"#/definitions/CatalogResponseBodyMin"},"categories":{"type":"array","items":{"$ref":"#/definitions/CategoryResponseBody"},"description":"Categories related to resource","example":[{"id":1,"name":"image-build"}]},"hubURLPath":{"type":"string","description":"Url path of the resource in hub","example":"tekton/task/buildah"},"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"},"platforms":{"type":"array","items":{"$ref":"#/definitions/PlatformResponseBody"},"description":"Platforms related to resource","example":[{"id":1,"name":"linux/amd64"}]},"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,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]},"required":["id","name","catalog","categories","kind","hubURLPath","latestVersion","tags","platforms","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,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"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,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}]}]},"required":["data"]},"ResourceVersionDataResponseBodyWithoutResource":{"title":"Mediatype identifier: application/vnd.hub.resource.version.data; view=default","type":"object","properties":{"deprecated":{"type":"boolean","description":"Deprecation status of a version","example":true},"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"},"hubURLPath":{"type":"string","description":"Url path of the resource in hub","example":"tekton/task/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"},"platforms":{"type":"array","items":{"$ref":"#/definitions/PlatformResponseBody"},"description":"Platforms related to resource version","example":[{"id":1,"name":"linux/s390x"}]},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information. (withoutResource view) (default view)","example":{"deprecated":true,"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","hubURLPath":"tekton/task/buildah","id":1,"minPipelinesVersion":"0.12.1","platforms":[{"id":1,"name":"linux/s390x"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","platforms","hubURLPath"]},"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"}]}},"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"}]}},"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"]}},"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 0074e1be67..a34e15ba64 100644 --- a/api/gen/http/openapi.yaml +++ b/api/gen/http/openapi.yaml @@ -347,11 +347,7 @@ paths: tags: - rating summary: Get rating - description: |- - Find user's rating for a resource - - **Required security scopes for jwt**: - * `rating:read` + description: Find user's rating for a resource operationId: rating#Get parameters: - name: id @@ -359,11 +355,6 @@ paths: description: ID of a resource required: true type: integer - - name: Authorization - in: header - description: JWT - required: true - type: string responses: "200": description: OK response. @@ -389,17 +380,11 @@ paths: $ref: '#/definitions/RatingGetInternalErrorResponseBody' schemes: - https - security: - - jwt_header_Authorization: [] put: tags: - rating summary: Update rating - description: |- - Update user's rating for a resource - - **Required security scopes for jwt**: - * `rating:write` + description: Update user's rating for a resource operationId: rating#Update parameters: - name: id @@ -407,11 +392,6 @@ paths: 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 @@ -440,8 +420,6 @@ paths: $ref: '#/definitions/RatingUpdateInternalErrorResponseBody' schemes: - https - security: - - jwt_header_Authorization: [] /resource/{id}/versions: get: tags: diff --git a/api/gen/http/openapi3.json b/api/gen/http/openapi3.json index 37ad404ecb..37f436725c 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":"https://api.hub.tekton.dev"}],"paths":{"/":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status","responses":{"200":{"description":"OK response.","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"}]}}}}}}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"RefreshAll catalog","description":"Refresh all catalogs","operationId":"catalog#RefreshAll","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Job"},"example":[{"catalogName":"tekton","id":1,"status":"queued"},{"catalogName":"tekton","id":1,"status":"queued"}]},"example":[{"catalogName":"tekton","id":1,"status":"queued"},{"catalogName":"tekton","id":1,"status":"queued"},{"catalogName":"tekton","id":1,"status":"queued"},{"catalogName":"tekton","id":1,"status":"queued"}]}}},"500":{"description":"internal-error: Internal Server Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh","refresh:token"]}]}},"/catalog/{catalogName}/error":{"get":{"tags":["catalog"],"summary":"CatalogError catalog","description":"List all errors occurred refreshing a catalog","operationId":"catalog#CatalogError","parameters":[{"name":"catalogName","in":"path","description":"Name of catalog","required":true,"schema":{"type":"string","description":"Name of catalog","example":"tekton"},"example":"tekton"}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogErrorResponseBody"},"example":{"data":[{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"}]}}}},"500":{"description":"internal-error: Internal Server Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh","refresh:token"]}]}},"/catalog/{catalogName}/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refresh a Catalog by it's name","operationId":"catalog#Refresh","parameters":[{"name":"catalogName","in":"path","description":"Name of catalog","required":true,"schema":{"type":"string","description":"Name of catalog","example":"tekton"},"example":"tekton"}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"},"example":{"catalogName":"tekton","id":1,"status":"queued"}}}},"404":{"description":"not-found: Resource Not Found Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal-error: Internal Server Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}}}},"500":{"description":"internal-error: Internal Server Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind, catalog, categories, platforms 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":"catalogs","in":"query","description":"Catalogs of resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Unde quia quia blanditiis nam dolorem."},"description":"Catalogs of resource to filter by","example":["tekton","openshift"]},"example":["tekton","openshift"]},{"name":"categories","in":"query","description":"Category associated with a resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Eos laborum et nesciunt et temporibus."},"description":"Category associated with a resource to filter by","example":["build","tools"]},"example":["build","tools"]},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Officia quis aliquid rerum perspiciatis voluptatem."},"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":"Quae vel et."},"description":"Tags associated with a resource to filter by","example":["image","build"]},"example":["image","build"]},{"name":"platforms","in":"query","description":"Platforms associated with a resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Omnis quaerat."},"description":"Platforms associated with a resource to filter by","example":["linux/s390x","linux/amd64"]},"example":["linux/s390x","linux/amd64"]},{"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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://douglasebert.info/jessie","format":"uri"},"example":"http://predovichahn.info/isidro"}}}}}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://mantehegmann.com/ward_towne","format":"uri"},"example":"http://kozeyschaefer.info/randal"}}}}}},"/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":"pipelinesversion","in":"query","description":"To find resource compatible with a Tekton pipelines version, use this param","allowEmptyValue":true,"schema":{"type":"string","description":"To find resource compatible with a Tekton pipelines version, use this param","example":"0.21.0","pattern":"^\\d+(?:\\.\\d+){0,2}$"},"example":"0.21.0"},{"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":"pipeline"},{"name":"name","in":"path","description":"Name of resource","required":true,"schema":{"type":"string","description":"Name of resource","example":"buildah"},"example":"buildah"}],"responses":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://smitham.biz/isac","format":"uri"},"example":"http://wizafranecki.biz/orie.funk"}}}}}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://parkergusikowski.info/zack_hartmann","format":"uri"},"example":"http://schmeler.biz/payton"}}}}}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://botsford.net/theron","format":"uri"},"example":"http://connellyschaefer.biz/elody_schumm"}}}}}},"/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":1487680364023662723},"example":15108684595389472227}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetResponseBody"},"example":{"rating":4}}}},"401":{"description":"invalid-token: Invalid User token","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"invalid-scopes: Invalid User scope","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not-found: Resource Not Found Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal-error: Internal server error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":11575953008413914708},"example":17027828275307537165}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRequestBody"},"example":{"rating":1}}}},"responses":{"200":{"description":"OK response."},"401":{"description":"invalid-token: Invalid User token","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"invalid-scopes: Invalid User scope","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not-found: Resource Not Found Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal-error: Internal server error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://volkman.net/abdiel","format":"uri"},"example":"http://fahey.org/elta"}}}}}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","responses":{"301":{"description":"Moved Permanently response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}}}}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download docs/openapi3.json","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","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshConfigResponseBody"},"example":{"checksum":"41ba391c8baf1fcd3c62c11272b913dc6613f4cf3b1833cfbb32431dc4384c93"}}}},"401":{"description":"invalid-token: Invalid User token","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"invalid-scopes: Invalid Token scopes ","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal-error: Internal server error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":"abc","scopes":["catalog-refresh","agent:create"]}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentResponseBody"},"example":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}}},"400":{"description":"invalid-payload: Invalid request body","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid-token: Invalid User token","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"invalid-scopes: Invalid Token scopes ","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal-error: Internal server error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":"OK response.","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"}]}}}}}}},"/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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}}}},"500":{"description":"internal-error: Internal Server Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"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"},"provider":{"type":"string","description":"Provider of catalog","example":"github"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]},"url":{"type":"string","description":"URL of catalog","example":"https://github.com/tektoncd/hub"}},"example":{"id":1,"name":"Tekton","provider":"github","type":"community","url":"https://github.com/tektoncd/hub"},"required":["id","name","type","url","provider"]},"CatalogErrorResponseBody":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CatalogErrors"},"description":"Catalog errors","example":[{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"}]}},"example":{"data":[{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"}]},"required":["data"]},"CatalogErrors":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string","example":"Aspernatur eos dolores adipisci vel."},"description":"Catalog Error message","example":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"]},"type":{"type":"string","description":"Catalog Errror type","example":"warning"}},"description":"CatalogErrors define the errors that occurred during catalog refresh","example":{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},"required":["type","errors"]},"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"}},"example":{"id":1,"name":"Image Builder"},"required":["id","name"]},"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":false}},"description":"Invalid request body","example":{"id":"3F1FKVRR","message":"Value of ID must be an integer","name":"bad_request"},"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":{"catalogName":{"type":"string","description":"Name of the catalog","example":"tekton"},"id":{"type":"integer","description":"id of the job","example":1},"status":{"type":"string","description":"status of the job","example":"queued"}},"example":{"catalogName":"tekton","id":1,"status":"queued"},"required":["id","catalogName","status"]},"ListResponseBody":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"example":[{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}},"example":{"data":[{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}},"RefreshConfigResponseBody":{"type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"41ba391c8baf1fcd3c62c11272b913dc6613f4cf3b1833cfbb32431dc4384c93"}},"example":{"checksum":"41ba391c8baf1fcd3c62c11272b913dc6613f4cf3b1833cfbb32431dc4384c93"},"required":["checksum"]},"ResourceData":{"type":"object","properties":{"catalog":{"$ref":"#/components/schemas/Catalog"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"description":"Categories related to resource","example":[{"id":1,"name":"image-build"}]},"hubURLPath":{"type":"string","description":"Url path of the resource in hub","example":"tekton/task/buildah"},"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"},"platforms":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"description":"Platforms related to resource","example":[{"id":1,"name":"linux/amd64"}]},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"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,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","categories","kind","hubURLPath","latestVersion","tags","platforms","rating","versions"]},"ResourceDataCollection":{"type":"array","items":{"$ref":"#/components/schemas/ResourceData"},"example":[{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceVersionData":{"type":"object","properties":{"deprecated":{"type":"boolean","description":"Deprecation status of a version","example":true},"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"},"hubURLPath":{"type":"string","description":"Url path of the resource in hub","example":"tekton/task/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"},"platforms":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"description":"Platforms related to resource version","example":[{"id":1,"name":"linux/s390x"}]},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"deprecated":true,"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","hubURLPath":"tekton/task/buildah","id":1,"minPipelinesVersion":"0.12.1","platforms":[{"id":1,"name":"linux/s390x"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"categories":[{"id":1,"name":"Build Tools"}],"id":1,"kind":"task","name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"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/main/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","platforms","resource","hubURLPath"]},"Resources":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceDataCollection"}},"example":{"data":[{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"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"},{"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"}]}},"UpdateAgentRequestBody":{"type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"abc"},"scopes":{"type":"array","items":{"type":"string","example":"Quia eos ipsum aperiam nam numquam rerum."},"description":"Scopes required for Agent","example":["catalog-refresh","agent:create"]}},"example":{"name":"abc","scopes":["catalog-refresh","agent:create"]},"required":["name","scopes"]},"UpdateAgentResponseBody":{"type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"example":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token"]},"UpdateRequestBody":{"type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":4,"minimum":0,"maximum":5}},"example":{"rating":4},"required":["rating"]}},"securitySchemes":{"jwt_header_Authorization":{"type":"http","description":"Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint.","scheme":"bearer"}}},"tags":[{"name":"swagger","description":"The swagger service serves the API swagger definition."},{"name":"admin","description":"Admin service"},{"name":"catalog","description":"The Catalog Service exposes endpoints to interact with catalogs"},{"name":"category","description":"The category service provides details about category"},{"name":"rating","description":"The rating service exposes endpoints to read and write user's rating for resources"},{"name":"resource","description":"The resource service provides details about all kind of resources"},{"name":"status","description":"Describes the status of each service"}]} \ 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":"https://api.hub.tekton.dev"}],"paths":{"/":{"get":{"tags":["status"],"summary":"Status status","description":"Return status of the services","operationId":"status#Status","responses":{"200":{"description":"OK response.","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"}]}}}}}}},"/catalog/refresh":{"post":{"tags":["catalog"],"summary":"RefreshAll catalog","description":"Refresh all catalogs","operationId":"catalog#RefreshAll","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Job"},"example":[{"catalogName":"tekton","id":1,"status":"queued"},{"catalogName":"tekton","id":1,"status":"queued"}]},"example":[{"catalogName":"tekton","id":1,"status":"queued"},{"catalogName":"tekton","id":1,"status":"queued"},{"catalogName":"tekton","id":1,"status":"queued"},{"catalogName":"tekton","id":1,"status":"queued"}]}}},"500":{"description":"internal-error: Internal Server Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh","refresh:token"]}]}},"/catalog/{catalogName}/error":{"get":{"tags":["catalog"],"summary":"CatalogError catalog","description":"List all errors occurred refreshing a catalog","operationId":"catalog#CatalogError","parameters":[{"name":"catalogName","in":"path","description":"Name of catalog","required":true,"schema":{"type":"string","description":"Name of catalog","example":"tekton"},"example":"tekton"}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogErrorResponseBody"},"example":{"data":[{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"}]}}}},"500":{"description":"internal-error: Internal Server Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"jwt_header_Authorization":["rating:read","rating:write","agent:create","catalog:refresh","config:refresh","refresh:token"]}]}},"/catalog/{catalogName}/refresh":{"post":{"tags":["catalog"],"summary":"Refresh catalog","description":"Refresh a Catalog by it's name","operationId":"catalog#Refresh","parameters":[{"name":"catalogName","in":"path","description":"Name of catalog","required":true,"schema":{"type":"string","description":"Name of catalog","example":"tekton"},"example":"tekton"}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"},"example":{"catalogName":"tekton","id":1,"status":"queued"}}}},"404":{"description":"not-found: Resource Not Found Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal-error: Internal Server Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}}}},"500":{"description":"internal-error: Internal Server Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/query":{"get":{"tags":["resource"],"summary":"Query resource","description":"Find resources by a combination of name, kind, catalog, categories, platforms 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":"catalogs","in":"query","description":"Catalogs of resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Omnis quaerat."},"description":"Catalogs of resource to filter by","example":["tekton","openshift"]},"example":["tekton","openshift"]},{"name":"categories","in":"query","description":"Category associated with a resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Nulla fugiat."},"description":"Category associated with a resource to filter by","example":["build","tools"]},"example":["build","tools"]},{"name":"kinds","in":"query","description":"Kinds of resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Animi neque est voluptatem id rerum reprehenderit."},"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":"Tempora et ut quas mollitia nesciunt delectus."},"description":"Tags associated with a resource to filter by","example":["image","build"]},"example":["image","build"]},{"name":"platforms","in":"query","description":"Platforms associated with a resource to filter by","allowEmptyValue":true,"schema":{"type":"array","items":{"type":"string","example":"Quidem asperiores quis."},"description":"Platforms associated with a resource to filter by","example":["linux/s390x","linux/amd64"]},"example":["linux/s390x","linux/amd64"]},{"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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://goyette.com/christelle_conroy","format":"uri"},"example":"http://champlin.com/zion"}}}}}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://bergnaum.org/sarina","format":"uri"},"example":"http://bogisich.com/marian"}}}}}},"/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":"pipelinesversion","in":"query","description":"To find resource compatible with a Tekton pipelines version, use this param","allowEmptyValue":true,"schema":{"type":"string","description":"To find resource compatible with a Tekton pipelines version, use this param","example":"0.21.0","pattern":"^\\d+(?:\\.\\d+){0,2}$"},"example":"0.21.0"},{"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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://blockhowe.name/meta.mcclure","format":"uri"},"example":"http://watsicanitzsche.com/henri.schulist"}}}}}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://klein.org/ruby","format":"uri"},"example":"http://kutch.name/garnet.johnston"}}}}}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://lemke.org/eliseo","format":"uri"},"example":"http://raucummings.org/brant"}}}}}},"/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":1487680364023662723},"example":15108684595389472227},{"name":"accessToken","in":"cookie","description":"Session ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Session ID","example":"Et est unde quia quia blanditiis nam."},"example":"Eos eos laborum et."}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetResponseBody"},"example":{"rating":4}}}},"401":{"description":"invalid-token: Invalid User token","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"invalid-scopes: Invalid User scope","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not-found: Resource Not Found Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal-error: Internal server error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"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":17672047292764765802},"example":9442720562234952332},{"name":"accessToken","in":"cookie","description":"Session ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Session ID","example":"Ut officia quis aliquid rerum perspiciatis."},"example":"Asperiores quae vel et."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRequestBody"},"example":{"rating":1}}}},"responses":{"200":{"description":"OK response."},"401":{"description":"invalid-token: Invalid User token","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"invalid-scopes: Invalid User scope","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"not-found: Resource Not Found Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal-error: Internal server error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/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":{"302":{"description":"Found response.","headers":{"location":{"description":"Redirect URL","required":true,"schema":{"type":"string","description":"Redirect URL","example":"http://spinka.net/amely","format":"uri"},"example":"http://breitenberg.biz/estefania.stoltenberg"}}}}}},"/resources":{"get":{"tags":["resource"],"summary":"List resource","description":"List all resources sorted by rating and name","operationId":"resource#List","responses":{"301":{"description":"Moved Permanently response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resources"},"example":{"data":[{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]}}}}}}},"/schema/swagger.json":{"get":{"tags":["swagger"],"summary":"Download docs/openapi3.json","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","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshConfigResponseBody"},"example":{"checksum":"41ba391c8baf1fcd3c62c11272b913dc6613f4cf3b1833cfbb32431dc4384c93"}}}},"401":{"description":"invalid-token: Invalid User token","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"invalid-scopes: Invalid Token scopes ","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal-error: Internal server error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":"abc","scopes":["catalog-refresh","agent:create"]}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentResponseBody"},"example":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}}}},"400":{"description":"invalid-payload: Invalid request body","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"invalid-token: Invalid User token","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"invalid-scopes: Invalid Token scopes ","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal-error: Internal server error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"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":"OK response.","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"}]}}}}}}},"/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.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponseBody"},"example":{"data":[{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}}}},"500":{"description":"internal-error: Internal Server Error","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"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"},"provider":{"type":"string","description":"Provider of catalog","example":"github"},"type":{"type":"string","description":"Type of catalog","example":"community","enum":["official","community"]},"url":{"type":"string","description":"URL of catalog","example":"https://github.com/tektoncd/hub"}},"example":{"id":1,"name":"Tekton","provider":"github","type":"community","url":"https://github.com/tektoncd/hub"},"required":["id","name","type","url","provider"]},"CatalogErrorResponseBody":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CatalogErrors"},"description":"Catalog errors","example":[{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"}]}},"example":{"data":[{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"}]},"required":["data"]},"CatalogErrors":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string","example":"Aspernatur eos dolores adipisci vel."},"description":"Catalog Error message","example":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"]},"type":{"type":"string","description":"Catalog Errror type","example":"warning"}},"description":"CatalogErrors define the errors that occurred during catalog refresh","example":{"errors":["Resource tekton.dev/v1beta1, Kind=Task - buildah has no display name","Resource tekton.dev/v1beta1, Kind=task - curl has no display name"],"type":"warning"},"required":["type","errors"]},"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"}},"example":{"id":1,"name":"Image Builder"},"required":["id","name"]},"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":false}},"description":"Invalid request body","example":{"id":"3F1FKVRR","message":"Value of ID must be an integer","name":"bad_request"},"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":{"catalogName":{"type":"string","description":"Name of the catalog","example":"tekton"},"id":{"type":"integer","description":"id of the job","example":1},"status":{"type":"string","description":"status of the job","example":"queued"}},"example":{"catalogName":"tekton","id":1,"status":"queued"},"required":["id","catalogName","status"]},"ListResponseBody":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"example":[{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}},"example":{"data":[{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"},{"id":1,"name":"Image Builder"}]}},"RefreshConfigResponseBody":{"type":"object","properties":{"checksum":{"type":"string","description":"Config file checksum","example":"41ba391c8baf1fcd3c62c11272b913dc6613f4cf3b1833cfbb32431dc4384c93"}},"example":{"checksum":"41ba391c8baf1fcd3c62c11272b913dc6613f4cf3b1833cfbb32431dc4384c93"},"required":["checksum"]},"ResourceData":{"type":"object","properties":{"catalog":{"$ref":"#/components/schemas/Catalog"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"description":"Categories related to resource","example":[{"id":1,"name":"image-build"}]},"hubURLPath":{"type":"string","description":"Url path of the resource in hub","example":"tekton/task/buildah"},"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"},"platforms":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"description":"Platforms related to resource","example":[{"id":1,"name":"linux/amd64"}]},"rating":{"type":"number","description":"Rating of resource","example":4.3,"format":"double"},"tags":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"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,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},"required":["id","name","catalog","categories","kind","hubURLPath","latestVersion","tags","platforms","rating","versions"]},"ResourceDataCollection":{"type":"array","items":{"$ref":"#/components/schemas/ResourceData"},"example":[{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]}]},"ResourceVersionData":{"type":"object","properties":{"deprecated":{"type":"boolean","description":"Deprecation status of a version","example":true},"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"},"hubURLPath":{"type":"string","description":"Url path of the resource in hub","example":"tekton/task/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"},"platforms":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"description":"Platforms related to resource version","example":[{"id":1,"name":"linux/s390x"}]},"rawURL":{"type":"string","description":"Raw URL of resource's yaml file of the version","example":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml","format":"uri"}},"description":"The Version result type describes resource's version information.","example":{"deprecated":true,"description":"Buildah task builds source into a container image and then pushes it to a container registry.","displayName":"Buildah","hubURLPath":"tekton/task/buildah","id":1,"minPipelinesVersion":"0.12.1","platforms":[{"id":1,"name":"linux/s390x"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/task/buildah/0.1/buildah.yaml","resource":{"catalog":{"id":1,"type":"community"},"categories":[{"id":1,"name":"Build Tools"}],"id":1,"kind":"task","name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"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/main/task/buildah/0.1/buildah.yaml"},"required":["id","version","displayName","description","minPipelinesVersion","rawURL","webURL","updatedAt","platforms","resource","hubURLPath"]},"Resources":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ResourceDataCollection"}},"example":{"data":[{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"rating":4.3,"tags":[{"id":1,"name":"image-build"}],"versions":[{"id":1,"version":"0.1"},{"id":2,"version":"0.2"}]},{"catalog":{"id":1,"name":"tekton","type":"community"},"categories":[{"id":1,"name":"image-build"}],"hubURLPath":"tekton/task/buildah","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","platforms":[{"id":1,"name":"linux/amd64"}],"rawURL":"https://raw.githubusercontent.com/tektoncd/catalog/main/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/main/task/buildah/0.1/buildah.yaml"},"name":"buildah","platforms":[{"id":1,"name":"linux/amd64"}],"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"},{"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"}]}},"UpdateAgentRequestBody":{"type":"object","properties":{"name":{"type":"string","description":"Name of Agent","example":"abc"},"scopes":{"type":"array","items":{"type":"string","example":"Quia eos ipsum aperiam nam numquam rerum."},"description":"Scopes required for Agent","example":["catalog-refresh","agent:create"]}},"example":{"name":"abc","scopes":["catalog-refresh","agent:create"]},"required":["name","scopes"]},"UpdateAgentResponseBody":{"type":"object","properties":{"token":{"type":"string","description":"Agent JWT","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"}},"example":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1Nzc4ODAzMDAsImlhdCI6MTU3Nzg4MDAwMCwiaWQiOjExLCJpc3MiOiJUZWt0b24gSHViIiwic2NvcGVzIjpbInJhdGluZzpyZWFkIiwicmF0aW5nOndyaXRlIiwiYWdlbnQ6Y3JlYXRlIl0sInR5cGUiOiJhY2Nlc3MtdG9rZW4ifQ.6pDmziSKkoSqI1f0rc4-AqVdcfY0Q8wA-tSLzdTCLgM"},"required":["token"]},"UpdateRequestBody":{"type":"object","properties":{"rating":{"type":"integer","description":"User rating for resource","example":4,"minimum":0,"maximum":5}},"example":{"rating":4},"required":["rating"]}},"securitySchemes":{"jwt_header_Authorization":{"type":"http","description":"Secures endpoint by requiring a valid JWT retrieved via the /auth/login endpoint.","scheme":"bearer"}}},"tags":[{"name":"swagger","description":"The swagger service serves the API swagger definition."},{"name":"admin","description":"Admin service"},{"name":"catalog","description":"The Catalog Service exposes endpoints to interact with catalogs"},{"name":"category","description":"The category service provides details about category"},{"name":"rating","description":"The rating service exposes endpoints to read and write user's rating for resources"},{"name":"resource","description":"The resource service provides details about all kind of resources"},{"name":"status","description":"Describes the status of each service"}]} \ No newline at end of file diff --git a/api/gen/http/openapi3.yaml b/api/gen/http/openapi3.yaml index 9bcabe4d74..558766be92 100644 --- a/api/gen/http/openapi3.yaml +++ b/api/gen/http/openapi3.yaml @@ -234,7 +234,7 @@ paths: type: array items: type: string - example: Unde quia quia blanditiis nam dolorem. + example: Omnis quaerat. description: Catalogs of resource to filter by example: - tekton @@ -250,7 +250,7 @@ paths: type: array items: type: string - example: Eos laborum et nesciunt et temporibus. + example: Nulla fugiat. description: Category associated with a resource to filter by example: - build @@ -266,7 +266,7 @@ paths: type: array items: type: string - example: Officia quis aliquid rerum perspiciatis voluptatem. + example: Animi neque est voluptatem id rerum reprehenderit. description: Kinds of resource to filter by example: - task @@ -282,7 +282,7 @@ paths: type: array items: type: string - example: Quae vel et. + example: Tempora et ut quas mollitia nesciunt delectus. description: Tags associated with a resource to filter by example: - image @@ -298,7 +298,7 @@ paths: type: array items: type: string - example: Omnis quaerat. + example: Quidem asperiores quis. description: Platforms associated with a resource to filter by example: - linux/s390x @@ -324,11 +324,11 @@ paths: type: string description: Strategy used to find matching resources default: contains - example: exact + example: contains enum: - exact - contains - example: contains + example: exact responses: "302": description: Found response. @@ -339,9 +339,9 @@ paths: schema: type: string description: Redirect URL - example: http://douglasebert.info/jessie + example: http://goyette.com/christelle_conroy format: uri - example: http://predovichahn.info/isidro + example: http://champlin.com/zion /resource/{catalog}/{kind}/{name}: get: tags: @@ -383,7 +383,7 @@ paths: enum: - task - pipeline - example: pipeline + example: task - name: name in: path description: Name of resource @@ -403,9 +403,9 @@ paths: schema: type: string description: Redirect URL - example: http://smitham.biz/isac + example: http://blockhowe.name/meta.mcclure format: uri - example: http://wizafranecki.biz/orie.funk + example: http://watsicanitzsche.com/henri.schulist /resource/{catalog}/{kind}/{name}/{version}: get: tags: @@ -464,9 +464,9 @@ paths: schema: type: string description: Redirect URL - example: http://parkergusikowski.info/zack_hartmann + example: http://klein.org/ruby format: uri - example: http://schmeler.biz/payton + example: http://kutch.name/garnet.johnston /resource/{id}: get: tags: @@ -494,9 +494,9 @@ paths: schema: type: string description: Redirect URL - example: http://botsford.net/theron + example: http://lemke.org/eliseo format: uri - example: http://connellyschaefer.biz/elody_schumm + example: http://raucummings.org/brant /resource/{id}/rating: get: tags: @@ -514,6 +514,16 @@ paths: description: ID of a resource example: 1487680364023662723 example: 15108684595389472227 + - name: accessToken + in: cookie + description: Session ID + allowEmptyValue: true + required: true + schema: + type: string + description: Session ID + example: Et est unde quia quia blanditiis nam. + example: Eos eos laborum et. responses: "200": description: OK response. @@ -547,14 +557,6 @@ paths: application/vnd.goa.error: schema: $ref: '#/components/schemas/Error' - security: - - jwt_header_Authorization: - - rating:read - - rating:write - - agent:create - - catalog:refresh - - config:refresh - - refresh:token put: tags: - rating @@ -569,8 +571,18 @@ paths: schema: type: integer description: ID of a resource - example: 11575953008413914708 - example: 17027828275307537165 + example: 17672047292764765802 + example: 9442720562234952332 + - name: accessToken + in: cookie + description: Session ID + allowEmptyValue: true + required: true + schema: + type: string + description: Session ID + example: Ut officia quis aliquid rerum perspiciatis. + example: Asperiores quae vel et. requestBody: required: true content: @@ -606,14 +618,6 @@ paths: application/vnd.goa.error: schema: $ref: '#/components/schemas/Error' - security: - - jwt_header_Authorization: - - rating:read - - rating:write - - agent:create - - catalog:refresh - - config:refresh - - refresh:token /resource/{id}/versions: get: tags: @@ -641,9 +645,9 @@ paths: schema: type: string description: Redirect URL - example: http://volkman.net/abdiel + example: http://spinka.net/amely format: uri - example: http://fahey.org/elta + example: http://breitenberg.biz/estefania.stoltenberg /resource/version/{versionID}: get: tags: @@ -671,9 +675,9 @@ paths: schema: type: string description: Redirect URL - example: http://mantehegmann.com/ward_towne + example: http://bergnaum.org/sarina format: uri - example: http://kozeyschaefer.info/randal + example: http://bogisich.com/marian /resources: get: tags: diff --git a/api/gen/http/rating/client/cli.go b/api/gen/http/rating/client/cli.go index b1db49c157..fd8044b094 100644 --- a/api/gen/http/rating/client/cli.go +++ b/api/gen/http/rating/client/cli.go @@ -18,7 +18,7 @@ import ( // BuildGetPayload builds the payload for the rating Get endpoint from CLI // flags. -func BuildGetPayload(ratingGetID string, ratingGetToken string) (*rating.GetPayload, error) { +func BuildGetPayload(ratingGetID string, ratingGetSession string) (*rating.GetPayload, error) { var err error var id uint { @@ -29,20 +29,20 @@ func BuildGetPayload(ratingGetID string, ratingGetToken string) (*rating.GetPayl return nil, fmt.Errorf("invalid value for id, must be UINT") } } - var token string + var session string { - token = ratingGetToken + session = ratingGetSession } v := &rating.GetPayload{} v.ID = id - v.Token = token + v.Session = session return v, nil } // BuildUpdatePayload builds the payload for the rating Update endpoint from // CLI flags. -func BuildUpdatePayload(ratingUpdateBody string, ratingUpdateID string, ratingUpdateToken string) (*rating.UpdatePayload, error) { +func BuildUpdatePayload(ratingUpdateBody string, ratingUpdateID string, ratingUpdateSession string) (*rating.UpdatePayload, error) { var err error var body UpdateRequestBody { @@ -69,15 +69,15 @@ func BuildUpdatePayload(ratingUpdateBody string, ratingUpdateID string, ratingUp return nil, fmt.Errorf("invalid value for id, must be UINT") } } - var token string + var session string { - token = ratingUpdateToken + session = ratingUpdateSession } v := &rating.UpdatePayload{ Rating: body.Rating, } v.ID = id - v.Token = token + v.Session = session return v, nil } diff --git a/api/gen/http/rating/client/encode_decode.go b/api/gen/http/rating/client/encode_decode.go index f9afc30bed..280bd7dc30 100644 --- a/api/gen/http/rating/client/encode_decode.go +++ b/api/gen/http/rating/client/encode_decode.go @@ -13,7 +13,6 @@ import ( "io/ioutil" "net/http" "net/url" - "strings" rating "github.com/tektoncd/hub/api/gen/rating" goahttp "goa.design/goa/v3/http" @@ -53,12 +52,11 @@ func EncodeGetRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Re return goahttp.ErrInvalidType("rating", "Get", "*rating.GetPayload", v) } { - head := p.Token - if !strings.Contains(head, " ") { - req.Header.Set("Authorization", "Bearer "+head) - } else { - req.Header.Set("Authorization", head) - } + v := p.Session + req.AddCookie(&http.Cookie{ + Name: "accessToken", + Value: v, + }) } return nil } @@ -200,12 +198,11 @@ func EncodeUpdateRequest(encoder func(*http.Request) goahttp.Encoder) func(*http return goahttp.ErrInvalidType("rating", "Update", "*rating.UpdatePayload", v) } { - head := p.Token - if !strings.Contains(head, " ") { - req.Header.Set("Authorization", "Bearer "+head) - } else { - req.Header.Set("Authorization", head) - } + v := p.Session + req.AddCookie(&http.Cookie{ + Name: "accessToken", + Value: v, + }) } body := NewUpdateRequestBody(p) if err := encoder(req).Encode(&body); err != nil { diff --git a/api/gen/http/rating/server/encode_decode.go b/api/gen/http/rating/server/encode_decode.go index 17df489893..ed5b2acfa4 100644 --- a/api/gen/http/rating/server/encode_decode.go +++ b/api/gen/http/rating/server/encode_decode.go @@ -13,7 +13,6 @@ import ( "io" "net/http" "strconv" - "strings" rating "github.com/tektoncd/hub/api/gen/rating" goahttp "goa.design/goa/v3/http" @@ -37,9 +36,10 @@ func EncodeGetResponse(encoder func(context.Context, http.ResponseWriter) goahtt func DecodeGetRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) { return func(r *http.Request) (interface{}, error) { var ( - id uint - token string - err error + id uint + session string + err error + c *http.Cookie params = mux.Vars(r) ) @@ -51,19 +51,16 @@ func DecodeGetRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Dec } id = uint(v) } - token = r.Header.Get("Authorization") - if token == "" { - err = goa.MergeErrors(err, goa.MissingFieldError("Authorization", "header")) + c, err = r.Cookie("accessToken") + if err == http.ErrNoCookie { + err = goa.MergeErrors(err, goa.MissingFieldError("accessToken", "cookie")) + } else { + session = c.Value } if err != nil { return nil, err } - payload := NewGetPayload(id, token) - if strings.Contains(payload.Token, " ") { - // Remove authorization scheme prefix (e.g. "Bearer") - cred := strings.SplitN(payload.Token, " ", 2)[1] - payload.Token = cred - } + payload := NewGetPayload(id, session) return payload, nil } @@ -167,8 +164,9 @@ func DecodeUpdateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp. } var ( - id uint - token string + id uint + session string + c *http.Cookie params = mux.Vars(r) ) @@ -180,19 +178,16 @@ func DecodeUpdateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp. } id = uint(v) } - token = r.Header.Get("Authorization") - if token == "" { - err = goa.MergeErrors(err, goa.MissingFieldError("Authorization", "header")) + c, err = r.Cookie("accessToken") + if err == http.ErrNoCookie { + err = goa.MergeErrors(err, goa.MissingFieldError("accessToken", "cookie")) + } else { + session = c.Value } if err != nil { return nil, err } - payload := NewUpdatePayload(&body, id, token) - if strings.Contains(payload.Token, " ") { - // Remove authorization scheme prefix (e.g. "Bearer") - cred := strings.SplitN(payload.Token, " ", 2)[1] - payload.Token = cred - } + payload := NewUpdatePayload(&body, id, session) return payload, nil } diff --git a/api/gen/http/rating/server/types.go b/api/gen/http/rating/server/types.go index 03225f4c42..862fae3601 100644 --- a/api/gen/http/rating/server/types.go +++ b/api/gen/http/rating/server/types.go @@ -292,21 +292,21 @@ func NewUpdateInvalidScopesResponseBody(res *goa.ServiceError) *UpdateInvalidSco } // NewGetPayload builds a rating service Get endpoint payload. -func NewGetPayload(id uint, token string) *rating.GetPayload { +func NewGetPayload(id uint, session string) *rating.GetPayload { v := &rating.GetPayload{} v.ID = id - v.Token = token + v.Session = session return v } // NewUpdatePayload builds a rating service Update endpoint payload. -func NewUpdatePayload(body *UpdateRequestBody, id uint, token string) *rating.UpdatePayload { +func NewUpdatePayload(body *UpdateRequestBody, id uint, session string) *rating.UpdatePayload { v := &rating.UpdatePayload{ Rating: *body.Rating, } v.ID = id - v.Token = token + v.Session = session return v } diff --git a/api/gen/rating/endpoints.go b/api/gen/rating/endpoints.go index ac0c2abac0..9a42f0482f 100644 --- a/api/gen/rating/endpoints.go +++ b/api/gen/rating/endpoints.go @@ -11,7 +11,6 @@ import ( "context" goa "goa.design/goa/v3/pkg" - "goa.design/goa/v3/security" ) // Endpoints wraps the "rating" service endpoints. @@ -22,11 +21,9 @@ type Endpoints struct { // NewEndpoints wraps the methods of the "rating" service with endpoints. func NewEndpoints(s Service) *Endpoints { - // Casting service to Auther interface - a := s.(Auther) return &Endpoints{ - Get: NewGetEndpoint(s, a.JWTAuth), - Update: NewUpdateEndpoint(s, a.JWTAuth), + Get: NewGetEndpoint(s), + Update: NewUpdateEndpoint(s), } } @@ -38,38 +35,18 @@ func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) { // NewGetEndpoint returns an endpoint function that calls the method "Get" of // service "rating". -func NewGetEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint { +func NewGetEndpoint(s Service) goa.Endpoint { return func(ctx context.Context, req interface{}) (interface{}, error) { p := req.(*GetPayload) - var err error - sc := security.JWTScheme{ - Name: "jwt", - 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) - if err != nil { - return nil, err - } return s.Get(ctx, p) } } // NewUpdateEndpoint returns an endpoint function that calls the method // "Update" of service "rating". -func NewUpdateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint { +func NewUpdateEndpoint(s Service) goa.Endpoint { return func(ctx context.Context, req interface{}) (interface{}, error) { p := req.(*UpdatePayload) - var err error - sc := security.JWTScheme{ - Name: "jwt", - 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) - if err != nil { - return nil, err - } return nil, s.Update(ctx, p) } } diff --git a/api/gen/rating/service.go b/api/gen/rating/service.go index c1da1736d5..2b8f5720d0 100644 --- a/api/gen/rating/service.go +++ b/api/gen/rating/service.go @@ -11,7 +11,6 @@ import ( "context" goa "goa.design/goa/v3/pkg" - "goa.design/goa/v3/security" ) // The rating service exposes endpoints to read and write user's rating for @@ -23,12 +22,6 @@ type Service interface { Update(context.Context, *UpdatePayload) (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. @@ -43,8 +36,8 @@ var MethodNames = [2]string{"Get", "Update"} type GetPayload struct { // ID of a resource ID uint - // JWT - Token string + // Session ID + Session string } // GetResult is the result type of the rating service Get method. @@ -59,8 +52,8 @@ type UpdatePayload struct { ID uint // User rating for resource Rating uint - // JWT - Token string + // Session ID + Session string } // MakeNotFound builds a goa.ServiceError from an error. diff --git a/api/pkg/auth/service/auth.go b/api/pkg/auth/service/auth.go index 4280975eb4..d9edc554a6 100644 --- a/api/pkg/auth/service/auth.go +++ b/api/pkg/auth/service/auth.go @@ -62,6 +62,20 @@ type Service interface { HubAuthenticate(res http.ResponseWriter, req *http.Request) } +type cookie struct { + Name string + Value string + MaxAge int + Path string + HttpOnly bool +} + +const ( + RefreshToken = "refreshToken" + AccessToken = "accessToken" + Path = "/" +) + // New returns the auth service implementation. func New(api app.Config) Service { return &service{ @@ -192,6 +206,26 @@ func (s *service) HubAuthenticate(res http.ResponseWriter, req *http.Request) { return } + //Add cookie and response and send it to in header + refreshToken := cookie{ + Name: RefreshToken, + Value: userTokens.Data.Refresh.Token, + MaxAge: int(r.jwtConfig.RefreshExpiresIn.Seconds()), + Path: Path, + HttpOnly: true, + } + + accessToken := cookie{ + Name: AccessToken, + Value: userTokens.Data.Access.Token, + MaxAge: int(r.jwtConfig.AccessExpiresIn.Seconds()), + Path: Path, + HttpOnly: true, + } + + refreshToken.createCookie(res) + accessToken.createCookie(res) + res.WriteHeader(http.StatusOK) if err := json.NewEncoder(res).Encode(userTokens); err != nil { r.log.Error(err) @@ -229,3 +263,15 @@ func List(res http.ResponseWriter, req *http.Request) { return } } + +func (c cookie) createCookie(res http.ResponseWriter) { + + cookie := &http.Cookie{ + Name: c.Name, + Value: c.Value, + MaxAge: c.MaxAge, + Path: c.Path, + HttpOnly: c.HttpOnly, + } + http.SetCookie(res, cookie) +} diff --git a/api/pkg/service/rating/rating.go b/api/pkg/service/rating/rating.go index 68514803da..5ae041da43 100644 --- a/api/pkg/service/rating/rating.go +++ b/api/pkg/service/rating/rating.go @@ -23,6 +23,7 @@ import ( "github.com/tektoncd/hub/api/pkg/app" "github.com/tektoncd/hub/api/pkg/db/model" "github.com/tektoncd/hub/api/pkg/service/validator" + "goa.design/goa/v3/security" "gorm.io/gorm" ) @@ -50,10 +51,21 @@ func New(api app.Config) rating.Service { // Find user's rating for a resource func (s *service) Get(ctx context.Context, p *rating.GetPayload) (*rating.GetResult, error) { + // Required scope to get the user rating for a resource + requiredScope := &security.JWTScheme{ + RequiredScopes: []string{"rating:read"}, + } + + //Verify and validate the required scopes + newctx, err := s.JWTAuth(ctx, p.Session, requiredScope) + if err != nil { + return &rating.GetResult{Rating: 0}, err + } + req := request{ - db: s.DB(ctx), - log: s.Logger(ctx), - userID: validator.UserID(ctx), + db: s.DB(newctx), + log: s.Logger(newctx), + userID: validator.UserID(newctx), } return req.getRating(p.ID) @@ -62,10 +74,22 @@ func (s *service) Get(ctx context.Context, p *rating.GetPayload) (*rating.GetRes // Update user's rating for a resource func (s *service) Update(ctx context.Context, p *rating.UpdatePayload) error { + // Required scope to get the user rating for a resource + requiredScope := &security.JWTScheme{ + RequiredScopes: []string{"rating:write"}, + } + + //Verify and validate the required scopes + newctx, err := s.JWTAuth(ctx, p.Session, requiredScope) + + if err != nil { + return err + } + req := request{ - db: s.DB(ctx), - log: s.Logger(ctx), - userID: validator.UserID(ctx), + db: s.DB(newctx), + log: s.Logger(newctx), + userID: validator.UserID(newctx), } return req.updateRating(p.ID, p.Rating) diff --git a/api/pkg/service/rating/rating_http_test.go b/api/pkg/service/rating/rating_http_test.go index 9ed3a6a518..9695104f29 100644 --- a/api/pkg/service/rating/rating_http_test.go +++ b/api/pkg/service/rating/rating_http_test.go @@ -26,17 +26,15 @@ import ( "github.com/tektoncd/hub/api/gen/http/rating/server" "github.com/tektoncd/hub/api/gen/rating" "github.com/tektoncd/hub/api/pkg/db/model" - "github.com/tektoncd/hub/api/pkg/service/validator" "github.com/tektoncd/hub/api/pkg/testutils" goa "goa.design/goa/v3/pkg" ) func GetChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { - service := validator.NewService(tc.APIConfig, "rating") checker := goahttpcheck.New() checker.Mount(server.NewGetHandler, server.MountGetHandler, - rating.NewGetEndpoint(New(tc), service.JWTAuth)) + rating.NewGetEndpoint(New(tc))) return checker } @@ -45,7 +43,7 @@ func TestGet_Http_InvalidToken(t *testing.T) { testutils.LoadFixtures(t, tc.FixturePath()) GetChecker(tc).Test(t, http.MethodGet, "/resource/1/rating"). - WithHeader("Authorization", "invalidToken").Check(). + WithCookie("accessToken", "invalidToken").Check(). HasStatus(401).Cb(func(r *http.Response) { b, readErr := ioutil.ReadAll(r.Body) assert.NoError(t, readErr) @@ -73,7 +71,7 @@ func TestGet_Http_ExpiredToken(t *testing.T) { jwt.TimeFunc = testutils.NowAfterDuration(tc.JWTConfig().AccessExpiresIn) GetChecker(tc).Test(t, http.MethodGet, "/resource/1/rating"). - WithHeader("Authorization", accessToken).Check(). + WithCookie("accessToken", accessToken).Check(). HasStatus(401).Cb(func(r *http.Response) { b, readErr := ioutil.ReadAll(r.Body) assert.NoError(t, readErr) @@ -100,7 +98,7 @@ func TestGet_Http_InvalidScopes(t *testing.T) { jwt.TimeFunc = testutils.Now GetChecker(tc).Test(t, http.MethodGet, "/resource/1/rating"). - WithHeader("Authorization", accessToken).Check(). + WithCookie("accessToken", accessToken).Check(). HasStatus(403).Cb(func(r *http.Response) { b, readErr := ioutil.ReadAll(r.Body) assert.NoError(t, readErr) @@ -127,7 +125,7 @@ func TestGet_Http(t *testing.T) { jwt.TimeFunc = testutils.Now GetChecker(tc).Test(t, http.MethodGet, "/resource/1/rating"). - WithHeader("Authorization", accessToken).Check(). + WithCookie("accessToken", accessToken).Check(). HasStatus(200).Cb(func(r *http.Response) { b, readErr := ioutil.ReadAll(r.Body) assert.NoError(t, readErr) @@ -154,7 +152,7 @@ func TestGet_Http_RatingNotFound(t *testing.T) { jwt.TimeFunc = testutils.Now GetChecker(tc).Test(t, http.MethodGet, "/resource/3/rating"). - WithHeader("Authorization", accessToken).Check(). + WithCookie("accessToken", accessToken).Check(). HasStatus(200).Cb(func(r *http.Response) { b, readErr := ioutil.ReadAll(r.Body) assert.NoError(t, readErr) @@ -181,7 +179,7 @@ func TestGet_Http_ResourceNotFound(t *testing.T) { jwt.TimeFunc = testutils.Now GetChecker(tc).Test(t, http.MethodGet, "/resource/99/rating"). - WithHeader("Authorization", accessToken).Check(). + WithCookie("accessToken", accessToken).Check(). HasStatus(404).Cb(func(r *http.Response) { b, readErr := ioutil.ReadAll(r.Body) assert.NoError(t, readErr) @@ -195,11 +193,10 @@ func TestGet_Http_ResourceNotFound(t *testing.T) { } func UpdateChecker(tc *testutils.TestConfig) *goahttpcheck.APIChecker { - service := validator.NewService(tc.APIConfig, "rating") checker := goahttpcheck.New() checker.Mount(server.NewUpdateHandler, server.MountUpdateHandler, - rating.NewUpdateEndpoint(New(tc), service.JWTAuth)) + rating.NewUpdateEndpoint(New(tc))) return checker } @@ -218,7 +215,7 @@ func TestUpdate_Http(t *testing.T) { data := []byte(`{"rating": 5}`) UpdateChecker(tc).Test(t, http.MethodPut, "/resource/3/rating"). - WithHeader("Authorization", accessToken). + WithCookie("accessToken", accessToken). WithBody(data).Check(). HasStatus(200) @@ -244,7 +241,7 @@ func TestUpdate_Http_Existing(t *testing.T) { data := []byte(`{"rating": 2}`) UpdateChecker(tc).Test(t, http.MethodPut, "/resource/1/rating"). - WithHeader("Authorization", accessToken). + WithCookie("accessToken", accessToken). WithBody(data).Check(). HasStatus(200) @@ -270,7 +267,7 @@ func TestUpdate_Http_ResourceNotFound(t *testing.T) { data := []byte(`{"rating": 2}`) UpdateChecker(tc).Test(t, http.MethodPut, "/resource/99/rating"). - WithHeader("Authorization", accessToken). + WithCookie("accessToken", accessToken). WithBody(data).Check(). HasStatus(404).Cb(func(r *http.Response) { b, readErr := ioutil.ReadAll(r.Body) diff --git a/api/pkg/service/rating/rating_test.go b/api/pkg/service/rating/rating_test.go index dfd5b7186d..e240039664 100644 --- a/api/pkg/service/rating/rating_test.go +++ b/api/pkg/service/rating/rating_test.go @@ -18,6 +18,7 @@ import ( "context" "testing" + "github.com/golang-jwt/jwt" "github.com/stretchr/testify/assert" "github.com/tektoncd/hub/api/gen/rating" "github.com/tektoncd/hub/api/pkg/service/validator" @@ -29,13 +30,18 @@ func TestGet(t *testing.T) { testutils.LoadFixtures(t, tc.FixturePath()) // user with rating:read scope - user, _, err := tc.UserWithScopes("foo", "foo@bar.com", "rating:read") + user, accessToken, err := tc.UserWithScopes("foo", "foo@bar.com", "rating:read") + assert.Equal(t, user.Email, "foo@bar.com") assert.NoError(t, err) + // Mocks the time + jwt.TimeFunc = testutils.Now + ratingSvc := New(tc) + ctx := validator.WithUserID(context.Background(), user.ID) - payload := &rating.GetPayload{ID: 1} + payload := &rating.GetPayload{ID: 1, Session: accessToken} rat, err := ratingSvc.Get(ctx, payload) assert.NoError(t, err) assert.Equal(t, 5, rat.Rating) @@ -46,13 +52,16 @@ func TestGet_RatingNotFound(t *testing.T) { testutils.LoadFixtures(t, tc.FixturePath()) // user with rating:read scope - user, _, err := tc.UserWithScopes("foo", "foo@bar.com", "rating:read") + user, accessToken, err := tc.UserWithScopes("foo", "foo@bar.com", "rating:read") assert.Equal(t, user.Email, "foo@bar.com") assert.NoError(t, err) + // Mocks the time + jwt.TimeFunc = testutils.Now + ratingSvc := New(tc) ctx := validator.WithUserID(context.Background(), user.ID) - payload := &rating.GetPayload{ID: 3} + payload := &rating.GetPayload{ID: 3, Session: accessToken} rat, err := ratingSvc.Get(ctx, payload) assert.NoError(t, err) assert.Equal(t, -1, rat.Rating) @@ -63,13 +72,16 @@ func TestGet_ResourceNotFound(t *testing.T) { testutils.LoadFixtures(t, tc.FixturePath()) // user with rating:read scope - user, _, err := tc.UserWithScopes("foo", "foo@bar.com", "rating:read") + user, accessToken, err := tc.UserWithScopes("foo", "foo@bar.com", "rating:read") assert.Equal(t, user.Email, "foo@bar.com") assert.NoError(t, err) + // Mocks the time + jwt.TimeFunc = testutils.Now + ratingSvc := New(tc) ctx := validator.WithUserID(context.Background(), user.ID) - payload := &rating.GetPayload{ID: 99} + payload := &rating.GetPayload{ID: 99, Session: accessToken} _, err = ratingSvc.Get(ctx, payload) assert.Error(t, err) assert.EqualError(t, err, "resource not found") @@ -80,13 +92,16 @@ func TestUpdate(t *testing.T) { testutils.LoadFixtures(t, tc.FixturePath()) // user with rating:write scope - user, _, err := tc.UserWithScopes("foo", "foo@bar.com", "rating:write") + user, accessToken, err := tc.UserWithScopes("foo", "foo@bar.com", "rating:write") assert.Equal(t, user.Email, "foo@bar.com") assert.NoError(t, err) + // Mocks the time + jwt.TimeFunc = testutils.Now + ratingSvc := New(tc) ctx := validator.WithUserID(context.Background(), user.ID) - payload := &rating.UpdatePayload{ID: 1, Rating: 3} + payload := &rating.UpdatePayload{ID: 1, Rating: 3, Session: accessToken} err = ratingSvc.Update(ctx, payload) assert.NoError(t, err) } @@ -96,13 +111,16 @@ func TestUpdate_ResourceNotFound(t *testing.T) { testutils.LoadFixtures(t, tc.FixturePath()) // user with rating:write scope - user, _, err := tc.UserWithScopes("foo", "foo@bar.com", "rating:write") + user, accessToken, err := tc.UserWithScopes("foo", "foo@bar.com", "rating:write") assert.Equal(t, user.Email, "foo@bar.com") assert.NoError(t, err) + // Mocks the time + jwt.TimeFunc = testutils.Now + ratingSvc := New(tc) ctx := validator.WithUserID(context.Background(), user.ID) - payload := &rating.UpdatePayload{ID: 99, Rating: 3} + payload := &rating.UpdatePayload{ID: 99, Rating: 3, Session: accessToken} err = ratingSvc.Update(ctx, payload) assert.Error(t, err) assert.EqualError(t, err, "resource not found") diff --git a/api/pkg/testutils/utils.go b/api/pkg/testutils/utils.go index cb9d4cc295..df315630b9 100644 --- a/api/pkg/testutils/utils.go +++ b/api/pkg/testutils/utils.go @@ -17,6 +17,7 @@ package testutils import ( "bytes" "encoding/json" + "net/http" "time" "github.com/tektoncd/hub/api/pkg/db/model" @@ -76,6 +77,16 @@ func (tc *TestConfig) UserWithScopes(name, email string, scopes ...string) (*mod return user, accessToken, nil } +// It returns a cookie object +func (tc *TestConfig) CreateCookie(name, value string) *http.Cookie { + return &http.Cookie{ + Name: name, + Value: value, + MaxAge: 300, + Path: "/", + } +} + // RefreshTokenForUser returns refresh JWT for user with refresh:token scope // User will have same github login and github name in db func (tc *TestConfig) RefreshTokenForUser(name, email string) (*model.User, string, error) { @@ -143,3 +154,25 @@ func (tc *TestConfig) AddScopesForUser(userID uint, scopes []string) error { } return nil } + +// AccessTokenForUser returns access JWT for user with access:token scope +// User will have same github login and github name in db +func (tc *TestConfig) AccessTokenForUser(name, email string) (*model.User, string, error) { + + user := &model.User{Type: model.NormalUserType, Email: email} + if err := tc.DB().Where(&model.User{Email: email}). + FirstOrCreate(user).Error; err != nil { + return nil, "", err + } + + token.Now = Now + + req := token.Request{User: user, JWTConfig: tc.JWTConfig(), Provider: "github"} + accessToken, _, err := req.AccessJWT() + + if err != nil { + return nil, "", err + } + + return user, accessToken, nil +} diff --git a/api/pkg/user/app/app.go b/api/pkg/user/app/app.go index 9e3a13df84..279b8e7840 100644 --- a/api/pkg/user/app/app.go +++ b/api/pkg/user/app/app.go @@ -64,3 +64,11 @@ type RefreshToken struct { // Refresh Token for user Refresh *Token `json:"refresh"` } + +type ClearCookies struct { + Data bool +} + +type ExitingAccessToken struct { + Data string `json:"token"` +} diff --git a/api/pkg/user/base.go b/api/pkg/user/base.go index 34ab4d2939..4a3ea8b5fe 100644 --- a/api/pkg/user/base.go +++ b/api/pkg/user/base.go @@ -30,6 +30,8 @@ func User(r *mux.Router, api app.Config) { } s.HandleFunc("/info", jwt.JWTAuth(userSvc.Info)) + s.HandleFunc("/logout", userSvc.Logout) s.HandleFunc("/refresh/accesstoken", jwt.JWTAuth(userSvc.RefreshAccessToken)) s.HandleFunc("/refresh/refreshtoken", jwt.JWTAuth(userSvc.NewRefreshToken)) + s.HandleFunc("/accesstoken", jwt.JWTAuth(userSvc.GetAccessToken)) } diff --git a/api/pkg/user/service/service.go b/api/pkg/user/service/service.go index 22445e7e87..de2d86ff29 100644 --- a/api/pkg/user/service/service.go +++ b/api/pkg/user/service/service.go @@ -43,10 +43,33 @@ type JWTScheme struct { func (s *UserService) JWTAuth(handler http.HandlerFunc) http.HandlerFunc { return func(res http.ResponseWriter, req *http.Request) { - jwt := req.Header.Get("Authorization") + accessCookie, err1 := req.Cookie("accessToken") + refreshCookie, err2 := req.Cookie("refreshToken") - if len(jwt) > 6 && strings.ToUpper(jwt[0:7]) == "BEARER " { - jwt = jwt[7:] + if err1 == http.ErrNoCookie && err2 == http.ErrNoCookie { + http.Error(res, err1.Error(), http.StatusUnauthorized) + return + } + + var defalutJWT string + if accessCookie == nil { + defalutJWT = refreshCookie.Value + } else { + defalutJWT = accessCookie.Value + } + + var jwt string + switch req.RequestURI { + case "/user/info": + jwt = accessCookie.Value + case "/user/refresh/accesstoken": + jwt = refreshCookie.Value + case "/user/refresh/refreshtoken": + jwt = refreshCookie.Value + case "/user/accesstoken", "/user/logout": + jwt = accessCookie.Value + default: + jwt = defalutJWT } claims, err := token.Verify(jwt, s.JwtConfig.SigningKey) @@ -62,7 +85,7 @@ func (s *UserService) JWTAuth(handler http.HandlerFunc) http.HandlerFunc { if req.RequestURI == "/user/info" { scheme.RequiredScopes = []string{"rating:read", "rating:write"} - } else if req.RequestURI == "/refresh/accesstoken" || req.RequestURI == "/refresh/refreshtoken" { + } else if req.RequestURI == "/refresh/accesstoken" || req.RequestURI == "/user/logout" || req.RequestURI == "/refresh/refreshtoken" { scheme.RequiredScopes = []string{"rating:read", "rating:write", "refresh:token"} } @@ -201,10 +224,6 @@ func (s *UserService) validateRefreshToken(id int, token string) (*model.User, e return nil, err } - if len(token) > 6 && strings.ToUpper(token[0:7]) == "BEARER " { - token = token[7:] - } - if user.RefreshTokenChecksum != createChecksum(token) { return nil, invalidRefreshToken } diff --git a/api/pkg/user/service/user.go b/api/pkg/user/service/user.go index dd121d47ef..729cf7c873 100644 --- a/api/pkg/user/service/user.go +++ b/api/pkg/user/service/user.go @@ -23,6 +23,7 @@ import ( "github.com/tektoncd/hub/api/gen/log" "github.com/tektoncd/hub/api/pkg/app" + auth "github.com/tektoncd/hub/api/pkg/auth/service" "github.com/tektoncd/hub/api/pkg/db/model" "github.com/tektoncd/hub/api/pkg/token" userApp "github.com/tektoncd/hub/api/pkg/user/app" @@ -48,6 +49,8 @@ type Service interface { Info(res http.ResponseWriter, req *http.Request) RefreshAccessToken(res http.ResponseWriter, req *http.Request) NewRefreshToken(res http.ResponseWriter, req *http.Request) + GetAccessToken(res http.ResponseWriter, req *http.Request) + Logout(res http.ResponseWriter, req *http.Request) } var ( @@ -64,7 +67,6 @@ func New(api app.Config) Service { } } -// Get the user Info func (s *UserService) Info(res http.ResponseWriter, req *http.Request) { id := req.Header.Get("UserID") @@ -128,7 +130,12 @@ func (s *UserService) RefreshAccessToken(res http.ResponseWriter, req *http.Requ return } - refreshToken := req.Header.Get("Authorization") + cookie, err := req.Cookie(auth.RefreshToken) + if err != nil { + http.Error(res, err.Error(), http.StatusUnauthorized) + } + refreshToken := cookie.Value + user, err := s.validateRefreshToken(userId, refreshToken) if err != nil { r.log.Error(err) @@ -136,7 +143,7 @@ func (s *UserService) RefreshAccessToken(res http.ResponseWriter, req *http.Requ return } - result, err := s.newRequest(user, provider).refreshAccessToken() + result, err := s.newRequest(user, provider).refreshAccessToken(res, req) if err != nil { http.Error(res, err.Error(), http.StatusInternalServerError) return @@ -150,26 +157,34 @@ func (s *UserService) RefreshAccessToken(res http.ResponseWriter, req *http.Requ } -func (r *request) refreshAccessToken() (*userApp.RefreshAccessTokenResult, error) { +func (r *request) refreshAccessToken(res http.ResponseWriter, req *http.Request) (*userApp.RefreshAccessTokenResult, error) { scopes, err := r.userScopes() if err != nil { return nil, err } - req := token.Request{ + request := token.Request{ User: r.user, Scopes: scopes, JWTConfig: r.jwtConfig, Provider: r.provider, } - accessToken, accessExpiresAt, err := req.AccessJWT() + accessToken, accessExpiresAt, err := request.AccessJWT() if err != nil { r.log.Error(err) return nil, refreshError } + http.SetCookie(res, &http.Cookie{ + Name: auth.AccessToken, + Value: accessToken, + MaxAge: int(r.jwtConfig.AccessExpiresIn.Seconds()), + Path: "/", + HttpOnly: true, + }) + data := &userApp.AccessToken{ Access: &userApp.Token{ Token: accessToken, @@ -185,6 +200,13 @@ func (s *UserService) NewRefreshToken(res http.ResponseWriter, req *http.Request id := req.Header.Get("UserID") provider := req.Header.Get("Provider") + cookie, err := req.Cookie("refreshToken") + if err != nil { + http.Error(res, err.Error(), http.StatusUnauthorized) + } + + refreshToken := cookie.Value + r := request{ db: s.DB(context.Background()), log: s.Logger(context.Background()), @@ -200,7 +222,6 @@ func (s *UserService) NewRefreshToken(res http.ResponseWriter, req *http.Request return } - refreshToken := req.Header.Get("Authorization") user, err := s.validateRefreshToken(userId, refreshToken) if err != nil { r.log.Error(err) @@ -208,7 +229,8 @@ func (s *UserService) NewRefreshToken(res http.ResponseWriter, req *http.Request return } - result, err := s.newRequest(user, provider).newRefreshToken() + // result, err := s.newRequest(user, provider).newRefreshToken() + result, err := s.newRequest(user, provider).newRefreshToken(res, req) if err != nil { http.Error(res, err.Error(), http.StatusInternalServerError) return @@ -222,15 +244,15 @@ func (s *UserService) NewRefreshToken(res http.ResponseWriter, req *http.Request } -func (r *request) newRefreshToken() (*userApp.NewRefreshTokenResult, error) { +func (r *request) newRefreshToken(res http.ResponseWriter, req *http.Request) (*userApp.NewRefreshTokenResult, error) { - req := token.Request{ + request := token.Request{ User: r.user, JWTConfig: r.jwtConfig, Provider: r.provider, } - refreshToken, refreshExpiresAt, err := req.RefreshJWT() + refreshToken, refreshExpiresAt, err := request.RefreshJWT() if err != nil { r.log.Error(err) return nil, refreshError @@ -242,6 +264,14 @@ func (r *request) newRefreshToken() (*userApp.NewRefreshTokenResult, error) { return nil, refreshError } + http.SetCookie(res, &http.Cookie{ + Name: auth.RefreshToken, + Value: refreshToken, + MaxAge: int(r.jwtConfig.RefreshExpiresIn.Seconds()), + Path: "/", + HttpOnly: true, + }) + data := &userApp.RefreshToken{ Refresh: &userApp.Token{ Token: refreshToken, @@ -252,3 +282,47 @@ func (r *request) newRefreshToken() (*userApp.NewRefreshTokenResult, error) { return &userApp.NewRefreshTokenResult{Data: data}, nil } + +func (s *UserService) GetAccessToken(res http.ResponseWriter, req *http.Request) { + + c, err := req.Cookie("accessToken") + if err == http.ErrNoCookie { + http.Error(res, err.Error(), http.StatusUnauthorized) + return + } + + accessToken := c.Value + + result := userApp.ExitingAccessToken{Data: accessToken} + + res.WriteHeader(http.StatusOK) + if err := json.NewEncoder(res).Encode(result); err != nil { + http.Error(res, err.Error(), http.StatusBadRequest) + return + } +} + +func (s *UserService) Logout(res http.ResponseWriter, req *http.Request) { + + // Unset the cookie + deleteCookie(res, auth.AccessToken) + deleteCookie(res, auth.RefreshToken) + + result := userApp.ClearCookies{Data: true} + + res.WriteHeader(http.StatusOK) + if err := json.NewEncoder(res).Encode(result); err != nil { + http.Error(res, err.Error(), http.StatusBadRequest) + return + } +} + +func deleteCookie(res http.ResponseWriter, name string) { + cookie := &http.Cookie{ + Name: name, + MaxAge: -1, + Path: "/", + HttpOnly: true, + } + http.SetCookie(res, cookie) +} diff --git a/api/pkg/user/service/user_test.go b/api/pkg/user/service/user_test.go index aad89dbb1d..bf90901815 100644 --- a/api/pkg/user/service/user_test.go +++ b/api/pkg/user/service/user_test.go @@ -42,6 +42,8 @@ func TestInfo(t *testing.T) { if err != nil { t.Fatal(err) } + // add cookie in the request with accessToken name + req.AddCookie(tc.CreateCookie("accessToken", accessToken)) res := httptest.NewRecorder() @@ -50,13 +52,14 @@ func TestInfo(t *testing.T) { JwtConfig: tc.JWTConfig(), } - req.Header.Set("Authorization", accessToken) handler := http.HandlerFunc(jwt.JWTAuth(userSvc.Info)) + assert.NoError(t, err) handler.ServeHTTP(res, req) var u *userApp.InfoResult + err = json.Unmarshal(res.Body.Bytes(), &u) assert.NoError(t, err) @@ -81,6 +84,9 @@ func TestRefreshAccessToken(t *testing.T) { t.Fatal(err) } + // add cookie in the request with refreshToken name + req.AddCookie(tc.CreateCookie("refreshToken", refreshToken)) + res := httptest.NewRecorder() userSvc := New(tc) @@ -88,7 +94,6 @@ func TestRefreshAccessToken(t *testing.T) { JwtConfig: tc.JWTConfig(), } - req.Header.Set("Authorization", refreshToken) handler := http.HandlerFunc(jwt.JWTAuth(userSvc.RefreshAccessToken)) assert.NoError(t, err) @@ -126,6 +131,10 @@ func TestRefreshAccessToken_RefreshTokenChecksumIsDifferent(t *testing.T) { if err != nil { t.Fatal(err) } + + // add cookie in the request with refreshToken name + req.AddCookie(tc.CreateCookie("refreshToken", refreshToken)) + res := httptest.NewRecorder() userSvc := New(tc) @@ -133,7 +142,7 @@ func TestRefreshAccessToken_RefreshTokenChecksumIsDifferent(t *testing.T) { JwtConfig: tc.JWTConfig(), } - req.Header.Set("Authorization", refreshToken) + // req.Header.Set("Authorization", refreshToken) handler := http.HandlerFunc(jwt.JWTAuth(userSvc.RefreshAccessToken)) handler.ServeHTTP(res, req) @@ -157,6 +166,9 @@ func TestNewRefreshToken(t *testing.T) { t.Fatal(err) } + // add cookie in the request with accessToken name + req.AddCookie(tc.CreateCookie("refreshToken", refreshToken)) + res := httptest.NewRecorder() userSvc := New(tc) @@ -164,7 +176,6 @@ func TestNewRefreshToken(t *testing.T) { JwtConfig: tc.JWTConfig(), } - req.Header.Set("Authorization", refreshToken) handler := http.HandlerFunc(jwt.JWTAuth(userSvc.NewRefreshToken)) assert.NoError(t, err) @@ -192,6 +203,7 @@ func TestNewRefreshToken_RefreshTokenChecksumIsDifferent(t *testing.T) { // user refresh token testUser, refreshToken, err := tc.RefreshTokenForUser("foo", "foo@bar.com") + assert.Equal(t, testUser.Email, "foo@bar.com") assert.NoError(t, err) @@ -202,6 +214,10 @@ func TestNewRefreshToken_RefreshTokenChecksumIsDifferent(t *testing.T) { if err != nil { t.Fatal(err) } + + // add cookie in the request with accessToken name + req.AddCookie(tc.CreateCookie("refreshToken", refreshToken)) + res := httptest.NewRecorder() userSvc := New(tc) @@ -209,9 +225,88 @@ func TestNewRefreshToken_RefreshTokenChecksumIsDifferent(t *testing.T) { JwtConfig: tc.JWTConfig(), } - req.Header.Set("Authorization", refreshToken) handler := http.HandlerFunc(jwt.JWTAuth(userSvc.NewRefreshToken)) handler.ServeHTTP(res, req) assert.Equal(t, res.Body.String(), "invalid refresh token\n") } + +func TestLogout(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + testUser, accessToken, err := tc.UserWithScopes("abc", "abc@bar.com", "rating:read", "rating:write") + assert.Equal(t, testUser.Email, "abc@bar.com") + assert.NoError(t, err) + + // Mocks the time + jwt.TimeFunc = testutils.Now + + req, err := http.NewRequest("GET", "/user/logout", nil) + if err != nil { + t.Fatal(err) + } + + // add cookie in the request with accessToken name + req.AddCookie(tc.CreateCookie("accessToken", accessToken)) + + res := httptest.NewRecorder() + + userSvc := New(tc) + jwt := UserService{ + JwtConfig: tc.JWTConfig(), + } + + handler := http.HandlerFunc(jwt.JWTAuth(userSvc.Logout)) + + assert.NoError(t, err) + + handler.ServeHTTP(res, req) + + var u *userApp.ClearCookies + + err = json.Unmarshal(res.Body.Bytes(), &u) + assert.NoError(t, err) + + assert.Equal(t, true, u.Data) +} + +func TestGetAccessToken(t *testing.T) { + tc := testutils.Setup(t) + testutils.LoadFixtures(t, tc.FixturePath()) + + testUser, accessToken, err := tc.UserWithScopes("abc", "abc@bar.com", "rating:read", "rating:write") + assert.Equal(t, testUser.Email, "abc@bar.com") + assert.NoError(t, err) + + // Mocks the time + jwt.TimeFunc = testutils.Now + + req, err := http.NewRequest("GET", "/user/accesstoken", nil) + if err != nil { + t.Fatal(err) + } + + // add cookie in the request with accessToken name + req.AddCookie(tc.CreateCookie("accessToken", accessToken)) + + res := httptest.NewRecorder() + + userSvc := New(tc) + jwt := UserService{ + JwtConfig: tc.JWTConfig(), + } + + handler := http.HandlerFunc(jwt.JWTAuth(userSvc.GetAccessToken)) + + assert.NoError(t, err) + + handler.ServeHTTP(res, req) + + var u *userApp.ExitingAccessToken + + err = json.Unmarshal(res.Body.Bytes(), &u) + assert.NoError(t, err) + + assert.Equal(t, accessToken, u.Data) +} diff --git a/ui/package-lock.json b/ui/package-lock.json index 50f2f5268f..31c520c205 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -16,7 +16,10 @@ "@testing-library/user-event": "^14.1.1", "@types/enzyme": "^3.10.12", "@types/enzyme-adapter-react-16": "^1.0.6", + "@types/express": "^4.17.13", + "@types/http-proxy-middleware": "^1.0.0", "@types/jest": "^27.4.1", + "@types/js-cookie": "^3.0.0", "@types/node": "^17.0.26", "@types/react-dom": "^18.0.1", "@types/react-router-dom": "^5.1.6", @@ -24,6 +27,7 @@ "@types/react-test-renderer": "^18.0.0", "axios": "^0.26.1", "fuzzysort": "^1.2.1", + "http-proxy-middleware": "^2.0.1", "mobx": "^6.5.0", "mobx-react": "^6.3.1", "mobx-state-tree": "^5.1.3", @@ -3928,6 +3932,15 @@ "@babel/types": "^7.3.0" } }, + "node_modules/@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, "node_modules/@types/cheerio": { "version": "0.22.21", "resolved": "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.21.tgz", @@ -3936,6 +3949,14 @@ "@types/node": "*" } }, + "node_modules/@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/enzyme": { "version": "3.10.12", "resolved": "https://registry.npmjs.org/@types/enzyme/-/enzyme-3.10.12.tgz", @@ -3967,6 +3988,27 @@ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==" }, + "node_modules/@types/express": { + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", + "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, "node_modules/@types/glob": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.4.tgz", @@ -4002,6 +4044,23 @@ "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.2.tgz", "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==" }, + "node_modules/@types/http-proxy": { + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz", + "integrity": "sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/http-proxy-middleware": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/http-proxy-middleware/-/http-proxy-middleware-1.0.0.tgz", + "integrity": "sha512-/s8lFX6rT43hSPqjjD8KNuu0SkPKY7uIdR6u9DCxVqCRhAvfKxGbVOixJsAT2mdpSnCyrGFAGoB39KFh6tmRxw==", + "deprecated": "This is a stub types definition. http-proxy-middleware provides its own type definitions, so you do not need this installed.", + "dependencies": { + "http-proxy-middleware": "*" + } + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", @@ -4169,6 +4228,11 @@ "node": ">=8" } }, + "node_modules/@types/js-cookie": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-3.0.2.tgz", + "integrity": "sha512-6+0ekgfusHftJNYpihfkMu8BWdeHs9EOJuGcSofErjstGPfPGEu9yTu4t460lTzzAMl2cM5zngQJqPMHbbnvYA==" + }, "node_modules/@types/json-schema": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", @@ -4187,6 +4251,11 @@ "@types/unist": "*" } }, + "node_modules/@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" + }, "node_modules/@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -4222,12 +4291,23 @@ "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.5.tgz", "integrity": "sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ==" }, + "node_modules/@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "node_modules/@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + }, "node_modules/@types/react": { - "version": "16.9.49", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.49.tgz", - "integrity": "sha512-DtLFjSj0OYAdVLBbyjhuV9CdGVHCkHn2R+xr3XkBvK2rS1Y1tkc14XSGjYgm5Fjjr90AxH9tiSzc1pCFMGO06g==", + "version": "16.14.26", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.26.tgz", + "integrity": "sha512-c/5CYyciOO4XdFcNhZW1O2woVx86k4T+DO2RorHZL7EhitkNQgSD/SgpdZJAUJa/qjVgOmTM44gHkAdZSXeQuQ==", "dependencies": { "@types/prop-types": "*", + "@types/scheduler": "*", "csstype": "^3.0.2" } }, @@ -4287,6 +4367,15 @@ "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" }, + "node_modules/@types/serve-static": { + "version": "1.13.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", + "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, "node_modules/@types/source-list-map": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz", @@ -6147,15 +6236,6 @@ "node": ">=8" } }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "optional": true, - "dependencies": { - "file-uri-to-path": "1.0.0" - } - }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -10269,12 +10349,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==" }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "optional": true - }, "node_modules/filesize": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz", @@ -10719,19 +10793,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -11526,130 +11587,37 @@ } }, "node_modules/http-proxy-middleware": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", - "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", - "dependencies": { - "http-proxy": "^1.17.0", - "is-glob": "^4.0.0", - "lodash": "^4.17.11", - "micromatch": "^3.1.10" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/http-proxy-middleware/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", + "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" + "@types/http-proxy": "^1.17.8", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "is-plain-obj": "^3.0.0", + "micromatch": "^4.0.2" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/http-proxy-middleware/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dependencies": { - "is-extendable": "^0.1.0" + "node": ">=12.0.0" }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/http-proxy-middleware/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/http-proxy-middleware/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dependencies": { - "is-extendable": "^0.1.0" + "peerDependencies": { + "@types/express": "^4.17.13" }, - "engines": { - "node": ">=0.10.0" + "peerDependenciesMeta": { + "@types/express": { + "optional": true + } } }, - "node_modules/http-proxy-middleware/node_modules/is-number": { + "node_modules/http-proxy-middleware/node_modules/is-plain-obj": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dependencies": { - "kind-of": "^3.0.2" - }, + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", + "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/http-proxy-middleware/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/http-proxy-middleware/node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/http-proxy-middleware/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "node": ">=10" }, - "engines": { - "node": ">=0.10.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/https-browserify": { @@ -17180,12 +17148,6 @@ "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=" }, - "node_modules/nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", - "optional": true - }, "node_modules/nanoid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz", @@ -24084,24 +24046,6 @@ "node": ">=0.10.0" } }, - "node_modules/watchpack-chokidar2/node_modules/fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "dependencies": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - }, - "engines": { - "node": ">= 4.0" - } - }, "node_modules/watchpack-chokidar2/node_modules/glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -24549,24 +24493,6 @@ "node": ">=6" } }, - "node_modules/webpack-dev-server/node_modules/fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "dependencies": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - }, - "engines": { - "node": ">= 4.0" - } - }, "node_modules/webpack-dev-server/node_modules/glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -24587,6 +24513,20 @@ "node": ">=0.10.0" } }, + "node_modules/webpack-dev-server/node_modules/http-proxy-middleware": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", + "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", + "dependencies": { + "http-proxy": "^1.17.0", + "is-glob": "^4.0.0", + "lodash": "^4.17.11", + "micromatch": "^3.1.10" + }, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/webpack-dev-server/node_modules/import-local": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", @@ -28533,6 +28473,15 @@ "@babel/types": "^7.3.0" } }, + "@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, "@types/cheerio": { "version": "0.22.21", "resolved": "https://registry.npmjs.org/@types/cheerio/-/cheerio-0.22.21.tgz", @@ -28541,6 +28490,14 @@ "@types/node": "*" } }, + "@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "requires": { + "@types/node": "*" + } + }, "@types/enzyme": { "version": "3.10.12", "resolved": "https://registry.npmjs.org/@types/enzyme/-/enzyme-3.10.12.tgz", @@ -28572,6 +28529,27 @@ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==" }, + "@types/express": { + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", + "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.28", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", + "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, "@types/glob": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.4.tgz", @@ -28607,6 +28585,22 @@ "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.2.tgz", "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==" }, + "@types/http-proxy": { + "version": "1.17.9", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz", + "integrity": "sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw==", + "requires": { + "@types/node": "*" + } + }, + "@types/http-proxy-middleware": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/http-proxy-middleware/-/http-proxy-middleware-1.0.0.tgz", + "integrity": "sha512-/s8lFX6rT43hSPqjjD8KNuu0SkPKY7uIdR6u9DCxVqCRhAvfKxGbVOixJsAT2mdpSnCyrGFAGoB39KFh6tmRxw==", + "requires": { + "http-proxy-middleware": "*" + } + }, "@types/istanbul-lib-coverage": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", @@ -28733,6 +28727,11 @@ } } }, + "@types/js-cookie": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-3.0.2.tgz", + "integrity": "sha512-6+0ekgfusHftJNYpihfkMu8BWdeHs9EOJuGcSofErjstGPfPGEu9yTu4t460lTzzAMl2cM5zngQJqPMHbbnvYA==" + }, "@types/json-schema": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", @@ -28751,6 +28750,11 @@ "@types/unist": "*" } }, + "@types/mime": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" + }, "@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -28786,12 +28790,23 @@ "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.5.tgz", "integrity": "sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ==" }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" + }, + "@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + }, "@types/react": { - "version": "16.9.49", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.49.tgz", - "integrity": "sha512-DtLFjSj0OYAdVLBbyjhuV9CdGVHCkHn2R+xr3XkBvK2rS1Y1tkc14XSGjYgm5Fjjr90AxH9tiSzc1pCFMGO06g==", + "version": "16.14.26", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.14.26.tgz", + "integrity": "sha512-c/5CYyciOO4XdFcNhZW1O2woVx86k4T+DO2RorHZL7EhitkNQgSD/SgpdZJAUJa/qjVgOmTM44gHkAdZSXeQuQ==", "requires": { "@types/prop-types": "*", + "@types/scheduler": "*", "csstype": "^3.0.2" } }, @@ -28851,6 +28866,15 @@ "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" }, + "@types/serve-static": { + "version": "1.13.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", + "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", + "requires": { + "@types/mime": "^1", + "@types/node": "*" + } + }, "@types/source-list-map": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz", @@ -30273,15 +30297,6 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "optional": true }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -33529,12 +33544,6 @@ } } }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "optional": true - }, "filesize": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz", @@ -33907,12 +33916,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "optional": true - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -34534,110 +34537,21 @@ } }, "http-proxy-middleware": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", - "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz", + "integrity": "sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==", "requires": { - "http-proxy": "^1.17.0", - "is-glob": "^4.0.0", - "lodash": "^4.17.11", - "micromatch": "^3.1.10" + "@types/http-proxy": "^1.17.8", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "is-plain-obj": "^3.0.0", + "micromatch": "^4.0.2" }, "dependencies": { - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-number": { + "is-plain-obj": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz", + "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==" } } }, @@ -38785,12 +38699,6 @@ "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=" }, - "nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", - "optional": true - }, "nanoid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz", @@ -44224,16 +44132,6 @@ } } }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } - }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -44817,16 +44715,6 @@ "locate-path": "^3.0.0" } }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } - }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -44846,6 +44734,17 @@ } } }, + "http-proxy-middleware": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", + "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", + "requires": { + "http-proxy": "^1.17.0", + "is-glob": "^4.0.0", + "lodash": "^4.17.11", + "micromatch": "^3.1.10" + } + }, "import-local": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", diff --git a/ui/package.json b/ui/package.json index 899e882f8c..5ba50e652a 100644 --- a/ui/package.json +++ b/ui/package.json @@ -2,6 +2,7 @@ "name": "ui", "version": "0.1.0", "private": true, + "module": "commonjs", "dependencies": { "@patternfly/patternfly": "^4.185.1", "@patternfly/react-core": "^4.202.16", @@ -23,6 +24,10 @@ "mobx-react": "^6.3.1", "mobx-state-tree": "^5.1.3", "moment": "^2.29.2", + "@types/express": "^4.17.13", + "@types/http-proxy-middleware": "^1.0.0", + "@types/js-cookie": "^3.0.0", + "http-proxy-middleware": "^2.0.1", "mst-persist": "^0.1.3", "react": "^16.13.1", "react-dom": "^16.14.0", diff --git a/ui/src/api/index.ts b/ui/src/api/index.ts index 3e436d9103..831cbbcc0d 100644 --- a/ui/src/api/index.ts +++ b/ui/src/api/index.ts @@ -1,5 +1,5 @@ import axios from 'axios'; -import { API_URL, AUTH_BASE_URL, API_VERSION } from '../config/constants'; +import { API_URL, API_VERSION } from '../config/constants'; import { ICategory } from '../store/category'; import { IResource, IVersion } from '../store/resource'; import { ITokenInfo, IUserProfile } from '../store/auth'; @@ -7,7 +7,6 @@ import { ICatalog } from '../store/catalog'; import { IProvider } from '../store/provider'; interface Token { - token: string; refreshInterval: string; expiresAt: number; } @@ -21,6 +20,14 @@ export interface AuthResponse { data: TokenData; } +export interface AccessTokenResponse { + data: string; +} + +export interface LogoutResponse { + data: boolean; +} + export interface Rating { rating: number; } @@ -34,12 +41,14 @@ export interface Api { authentication(authCode: string): Promise; readme(resourceKey: string, version: string): Promise; yaml(resourceKey: string, version: string): Promise; - getRating(resourceId: number, token: string): Promise; - setRating(resourceId: number, token: string, rating: number): Promise; - getRefreshToken(refreshToken: string): Promise; - getAccessToken(accessToken: string): Promise; - profile(token: string): Promise; + getRating(resourceId: number): Promise; + setRating(resourceId: number, rating: number): Promise; + getRefreshToken(): Promise; + getAccessToken(): Promise; + profile(): Promise; providers(): Promise; + logout(): Promise; + accessToken(): Promise; } export class Hub implements Api { @@ -70,7 +79,7 @@ export class Hub implements Api { async authentication(authCode: string) { try { return axios - .post(`${AUTH_BASE_URL}/auth/login?code=${authCode}`) + .post(`/auth/login?code=${authCode}`) .then((response) => response.data) .catch((err) => Promise.reject(err.response)); } catch (err) { @@ -119,14 +128,10 @@ export class Hub implements Api { } } - async getRating(resourceId: number, token: string) { + async getRating(resourceId: number) { try { return axios - .get(`${API_URL}/resource/${resourceId}/rating`, { - headers: { - Authorization: `Bearer ${token}` - } - }) + .get(`/resource/${resourceId}/rating`) .then((response) => response.data) .catch((err) => Promise.reject(err.response)); } catch (err) { @@ -134,18 +139,10 @@ export class Hub implements Api { } } - async setRating(resourceId: number, token: string, rating: number) { + async setRating(resourceId: number, rating: number) { try { return axios - .put( - `${API_URL}/resource/${resourceId}/rating`, - { rating: rating }, - { - headers: { - Authorization: `Bearer ${token}` - } - } - ) + .put(`/resource/${resourceId}/rating`, { rating: rating }) .then((response) => response.data) .catch((err) => Promise.reject(err.response)); } catch (err) { @@ -153,14 +150,11 @@ export class Hub implements Api { } } - async getRefreshToken(refreshToken: string) { + async getRefreshToken() { try { return axios({ method: 'post', - url: `${AUTH_BASE_URL}/user/refresh/refreshtoken`, - headers: { - Authorization: `Bearer ${refreshToken}` - } + url: `/user/refresh/refreshtoken` }) .then((response) => response.data) .catch((err) => Promise.reject(err.response)); @@ -169,14 +163,11 @@ export class Hub implements Api { } } - async getAccessToken(refreshToken: string) { + async getAccessToken() { try { return axios({ method: 'post', - url: `${AUTH_BASE_URL}/user/refresh/accesstoken`, - headers: { - Authorization: `Bearer ${refreshToken}` - } + url: `/user/refresh/accesstoken` }) .then((response) => response.data) .catch((err) => Promise.reject(err.response)); @@ -185,14 +176,10 @@ export class Hub implements Api { } } - async profile(token: string) { + async profile() { try { return axios - .get(`${AUTH_BASE_URL}/user/info`, { - headers: { - Authorization: `Bearer ${token}` - } - }) + .get(`/user/info`) .then((response) => response.data) .catch((err) => Promise.reject(err.response)); } catch (err) { @@ -202,9 +189,31 @@ export class Hub implements Api { async providers() { try { - return axios.get(`${AUTH_BASE_URL}/auth/providers`).then((response) => response.data); + return axios.get(`/auth/providers`).then((response) => response.data); } catch (err) { return err.response; } } + + async logout() { + try { + return axios + .post(`/user/logout `) + .then((response) => response.data) + .catch((err) => Promise.reject(err.response)); + } catch (err) { + return err; + } + } + + async accessToken() { + try { + return axios + .post(`/user/accesstoken`) + .then((response) => response.data) + .catch((err) => Promise.reject(err.response)); + } catch (err) { + return err; + } + } } diff --git a/ui/src/api/testutil.ts b/ui/src/api/testutil.ts index c1cb97e856..54b2105acc 100644 --- a/ui/src/api/testutil.ts +++ b/ui/src/api/testutil.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import { ICategory } from '../store/category'; import { IResource, IVersion } from '../store/resource'; import { ITokenInfo, IUserProfile } from '../store/auth'; -import { Api, AuthResponse } from './'; +import { Api, AuthResponse, AccessTokenResponse, LogoutResponse } from './'; import { ICatalog } from '../store/catalog'; import { IProvider } from '../store/provider'; @@ -130,4 +130,19 @@ export class FakeHub implements Api { setTimeout(() => resolve(ret()), 1000); }); } + + async logout() { + const data = `${this.dataDir}/provider.json`; + const ret = () => JSON.parse(fs.readFileSync(data).toString()); + return new Promise((resolve) => { + setTimeout(() => resolve(ret()), 1000); + }); + } + async accessToken() { + const data = `${this.dataDir}/existing_token.json`; + const ret = () => JSON.parse(fs.readFileSync(data).toString()); + return new Promise((resolve) => { + setTimeout(() => resolve(ret()), 1000); + }); + } } diff --git a/ui/src/containers/UserProfile/index.tsx b/ui/src/containers/UserProfile/index.tsx index 970ef04c6e..7d875958f2 100644 --- a/ui/src/containers/UserProfile/index.tsx +++ b/ui/src/containers/UserProfile/index.tsx @@ -21,6 +21,7 @@ const UserProfile: React.FC = observer(() => { useEffect(() => { user.getProfile(); + user.accessToken(); }, [user.profile.userName]); const triggerInterval = useCallback(() => { @@ -32,9 +33,6 @@ const UserProfile: React.FC = observer(() => { // To get a new refresh token // Update the refresh token before 20 seconds of current refresh token's expiry time const tempRefreshId = window.setInterval(() => { - if (!user.isAuthenticated) { - clearInterval(tempRefreshId); - } user.updateRefreshToken(); }, refreshTokenInterval - 20000); setRefreshId(tempRefreshId); @@ -45,9 +43,6 @@ const UserProfile: React.FC = observer(() => { // To get a new access token // Update the access token before 10 seconds of current access token's expiry time const tempAccessId = window.setInterval(() => { - if (!user.isAuthenticated) { - clearInterval(tempAccessId); - } user.updateAccessToken(); }, accessTokenInterval - 10000); setAccessId(tempAccessId); @@ -63,11 +58,13 @@ const UserProfile: React.FC = observer(() => { const hubLogout = () => { user.logout(); - localStorage.clear(); clearInterval(refreshId); clearInterval(accessId); - }; + setTimeout(() => { + localStorage.clear(); + }, 1000); + }; const onToggle = (isOpen: React.SetStateAction) => set(isOpen); const dropdownItems = [ @@ -76,7 +73,7 @@ const UserProfile: React.FC = observer(() => { setIsModalOpen(!isModalOpen)}> Copy Hub Token , - + hubLogout()}> Logout ]; @@ -104,7 +101,7 @@ const UserProfile: React.FC = observer(() => {
- {user.accessTokenInfo.token} + {user.existingToken.token}
diff --git a/ui/src/setupProxy.js b/ui/src/setupProxy.js new file mode 100644 index 0000000000..67be50c8c0 --- /dev/null +++ b/ui/src/setupProxy.js @@ -0,0 +1,16 @@ +const {createProxyMiddleware} = require('http-proxy-middleware'); + +module.exports = function (app) { + app.use( + createProxyMiddleware(['/auth', '/user'], { + target: 'http://localhost:4200', + changeOrigin: true + }) + ); + app.use( + createProxyMiddleware(['/resource/**/rating'], { + target: 'http://localhost:8000', + changeOrigin: true + }) + ); +}; diff --git a/ui/src/store/auth.ts b/ui/src/store/auth.ts index 4933a52e38..da60e7cdbd 100644 --- a/ui/src/store/auth.ts +++ b/ui/src/store/auth.ts @@ -8,6 +8,10 @@ export const TokenInfo = types.model('TokenInfo', { refreshInterval: types.optional(types.string, '') }); +export const ExistingToken = types.model('ExistingToken', { + token: types.optional(types.string, '') +}); + export const UserProfile = types.model('UserProfile', { userName: types.optional(types.string, ''), name: types.optional(types.string, ''), @@ -23,6 +27,7 @@ export const Error = types.model('Error', { export type IUserProfile = Instance; export type ITokenInfo = Instance; export type IError = Instance; +export type IExistingToken = Instance; export interface AuthCodeProps { code: string; @@ -37,6 +42,7 @@ export const AuthStore = types accessTokenInfo: types.optional(TokenInfo, {}), refreshTokenInfo: types.optional(TokenInfo, {}), profile: types.optional(UserProfile, {}), + existingToken: types.optional(ExistingToken, {}), isLoading: true, isAuthenticated: false, userRating: types.optional(types.number, 0), @@ -46,12 +52,10 @@ export const AuthStore = types }) .actions((self) => ({ addAccessTokenInfo(item: ITokenInfo) { - self.accessTokenInfo.token = item.token; self.accessTokenInfo.expiresAt = item.expiresAt; self.accessTokenInfo.refreshInterval = item.refreshInterval; }, addRefreshTokenInfo(item: ITokenInfo) { - self.refreshTokenInfo.token = item.token; self.refreshTokenInfo.expiresAt = item.expiresAt; self.refreshTokenInfo.refreshInterval = item.refreshInterval; }, @@ -60,6 +64,9 @@ export const AuthStore = types self.profile.name = item.name; self.profile.avatarUrl = item.avatarUrl; }, + addaccessToken(item: ITokenInfo) { + self.existingToken.token = item.token; + }, setIsAuthenticated(l: boolean) { self.isAuthenticated = l; }, @@ -90,11 +97,6 @@ export const AuthStore = types error.customMessage = ''; } self.authErr = error; - }, - logout() { - self.isAuthenticated = false; - self.isLoading = false; - self.userRating = 0; } })) .views((self) => ({ @@ -115,24 +117,42 @@ export const AuthStore = types self.addAccessTokenInfo(userDetails.access); self.addRefreshTokenInfo(userDetails.refresh); + localStorage.setItem('isLoggedIn', 'true'); + self.setIsAuthenticated(true); if (historyBack) { historyBack(); } } catch (err) { - if (err === undefined) { + const error: IError = { + status: err.status, + serverMessage: titleCase(err.data), + customMessage: '' + }; + self.setErrorMessage(error); + self.authErr = error; + } + self.setLoading(false); + }), + + logout: flow(function* () { + try { + const { api } = self; + const json = yield api.logout(); + if (json.Data === true) { self.isAuthenticated = false; - } else { - const error: IError = { - status: err.status, - serverMessage: titleCase(err.data), - customMessage: '' - }; - self.setErrorMessage(error); - self.authErr = error; + self.isLoading = false; + self.userRating = 0; } + } catch (err) { + const error: IError = { + status: err.status, + serverMessage: titleCase(err.data), + customMessage: '' + }; + self.setErrorMessage(error); + self.authErr = error; } - self.setLoading(false); }), getRating: flow(function* (resourceId: number) { @@ -141,22 +161,18 @@ export const AuthStore = types const { api } = self; if (self.isAuthenticated) { - const json = yield api.getRating(resourceId, self.accessTokenInfo.token); + const json = yield api.getRating(resourceId); self.setUserRating(json.rating); } } catch (err) { - if (err === undefined) { - self.isAuthenticated = false; - } else { - const error: IError = { - status: err.status, - serverMessage: titleCase(err.data.message), - customMessage: '' - }; - self.isAuthenticated = false; - self.setErrorMessage(error); - self.ratingErr = error; - } + const error: IError = { + status: err.status, + serverMessage: titleCase(err.data.message), + customMessage: '' + }; + self.isAuthenticated = false; + self.setErrorMessage(error); + self.ratingErr = error; } self.setLoading(false); }), @@ -168,7 +184,7 @@ export const AuthStore = types const { api } = self; if (self.isAuthenticated) { - yield api.setRating(resourceId, self.accessTokenInfo.token, rating); + yield api.setRating(resourceId, rating); self.setUserRating(rating); } } catch (err) { @@ -188,21 +204,19 @@ export const AuthStore = types try { const { api } = self; - const refresh = yield api.getRefreshToken(self.refreshTokenInfo.token); + const refresh = yield api.getRefreshToken(); const newRefreshToken = refresh.data; + self.addRefreshTokenInfo(newRefreshToken.refresh); + localStorage.refreshTokenExpiryTime = newRefreshToken.refresh.expiresAt; } catch (err) { - if (err === undefined) { - self.isAuthenticated = false; - } else { - const error: IError = { - status: err.status, - serverMessage: titleCase(err.data), - customMessage: 'Refresh token has been expired please login again !' - }; - self.setErrorMessage(error); - self.setIsAuthenticated(false); - } + const error: IError = { + status: err.status, + serverMessage: titleCase(err.data), + customMessage: 'Refresh token has been expired please login again !' + }; + self.setErrorMessage(error); + self.setIsAuthenticated(false); } }), @@ -210,24 +224,23 @@ export const AuthStore = types try { const { api } = self; - const access = yield api.getAccessToken(self.refreshTokenInfo.token); + const access = yield api.getAccessToken(); const newAccessToken = access.data; + self.addAccessTokenInfo(newAccessToken.access); + + localStorage.accessTokenExpiryTime = newAccessToken.access.expiresAt; } catch (err) { - if (err === undefined) { - self.isAuthenticated = false; - } else { - const error: IError = { - status: err.status, - serverMessage: titleCase(err.data), - customMessage: 'Refresh token has been expired please login again !' - }; - self.setErrorMessage(error); - self.setIsAuthenticated(false); - setTimeout(() => { - localStorage.clear(); - }, 1000); - } + const error: IError = { + status: err.status, + serverMessage: titleCase(err.data), + customMessage: 'Refresh token has been expired please login again !' + }; + self.setErrorMessage(error); + self.setIsAuthenticated(false); + setTimeout(() => { + localStorage.clear(); + }, 1000); } }), @@ -235,21 +248,34 @@ export const AuthStore = types try { const { api } = self; - const access = yield api.profile(self.accessTokenInfo.token); + const access = yield api.profile(); const userdata = access.data; self.addUserProfile(userdata); } catch (err) { - if (err === undefined) { - self.isAuthenticated = false; - } else { - const error: IError = { - status: err.status, - serverMessage: titleCase(err.data), - customMessage: 'Access token has been expired please login again !' - }; - self.setErrorMessage(error); - self.setIsAuthenticated(false); - } + const error: IError = { + status: err.status, + serverMessage: titleCase(err.data), + customMessage: 'Access token has been expired please login again !' + }; + self.setErrorMessage(error); + self.setIsAuthenticated(false); + } + }), + + accessToken: flow(function* () { + try { + const { api } = self; + + const access = yield api.accessToken(); + + self.addaccessToken(access); + } catch (err) { + const error: IError = { + status: err.status, + serverMessage: titleCase(err.data), + customMessage: 'Access token has been expired please login again !' + }; + self.setErrorMessage(error); } }) })); diff --git a/ui/src/store/testdata/existing_token.json b/ui/src/store/testdata/existing_token.json new file mode 100644 index 0000000000..48f24517a6 --- /dev/null +++ b/ui/src/store/testdata/existing_token.json @@ -0,0 +1,3 @@ +{ + "data": "eyJhbGciOiWQicmF0aW5nOnJlYWQiLCJyYXRpbmc6d3JpdGUiXSwidHlwZSI6ImFjY2Vzcy10b2tlbiJ9.IDFQ5RHbWp8LlawDYKHJJQ5PNv79F8evf2M4dOWdg1E" +} \ No newline at end of file diff --git a/ui/src/store/testdata/logout.json b/ui/src/store/testdata/logout.json new file mode 100644 index 0000000000..66c9b06f23 --- /dev/null +++ b/ui/src/store/testdata/logout.json @@ -0,0 +1,3 @@ +{ + "data" : true +} \ No newline at end of file diff --git a/ui/tsconfig.json b/ui/tsconfig.json index fbce9be234..95cafdfcf7 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -22,5 +22,6 @@ }, "include": [ "src" - ] + ], + "exclude": ["src/setupProxy.js"] }