mirror of
https://github.com/project-zot/zot.git
synced 2024-12-16 21:56:37 -05:00
feat: support artifacts search
https://github.com/cncf-tags/wg-artifacts/pull/34 An experiment to make this possible Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
parent
5ae7a028d9
commit
694ec3a782
2 changed files with 15 additions and 0 deletions
|
@ -16,6 +16,14 @@ const (
|
||||||
ExtSearchPrefix = ExtPrefix + ExtSearch
|
ExtSearchPrefix = ExtPrefix + ExtSearch
|
||||||
FullSearchPrefix = RoutePrefix + ExtSearchPrefix
|
FullSearchPrefix = RoutePrefix + ExtSearchPrefix
|
||||||
|
|
||||||
|
// CNCF artifacts search extension.
|
||||||
|
BaseArtifactsPrefix = "/_artifacts"
|
||||||
|
ExtArtifactsPrefix = BaseArtifactsPrefix + "/ext"
|
||||||
|
|
||||||
|
ExtArtifactsSearch = "/search"
|
||||||
|
ExtArtifactsSearchPrefix = ExtArtifactsPrefix + ExtArtifactsSearch
|
||||||
|
FullSearchArtifactsPrefix = RoutePrefix + ExtArtifactsSearchPrefix
|
||||||
|
|
||||||
// mgmt extension.
|
// mgmt extension.
|
||||||
Mgmt = "/mgmt"
|
Mgmt = "/mgmt"
|
||||||
ExtMgmt = ExtPrefix + Mgmt
|
ExtMgmt = ExtPrefix + Mgmt
|
||||||
|
|
|
@ -102,4 +102,11 @@ func SetupSearchRoutes(conf *config.Config, router *mux.Router, storeController
|
||||||
Handler(gqlHandler.NewDefaultServer(gql_generated.NewExecutableSchema(resConfig)))
|
Handler(gqlHandler.NewDefaultServer(gql_generated.NewExecutableSchema(resConfig)))
|
||||||
|
|
||||||
log.Info().Msg("finished setting up search routes")
|
log.Info().Msg("finished setting up search routes")
|
||||||
|
|
||||||
|
extRouter = router.PathPrefix(constants.ExtArtifactsSearchPrefix).Subrouter()
|
||||||
|
extRouter.Use(zcommon.CORSHeadersMiddleware(conf.HTTP.AllowOrigin))
|
||||||
|
extRouter.Use(zcommon.ACHeadersMiddleware(conf, allowedMethods...))
|
||||||
|
extRouter.Use(zcommon.AddExtensionSecurityHeaders())
|
||||||
|
extRouter.Methods(allowedMethods...).
|
||||||
|
Handler(gqlHandler.NewDefaultServer(gql_generated.NewExecutableSchema(resConfig)))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue