Commit Graph

211 Commits

Author SHA1 Message Date
Daniel Jiang
5f8acc3896 Add middlewares for permission checking for v2 API
When the registry shifts from token auth to basic auth, we'll use the middleware to check permission.
This commit add middlewares for populate the artifact info and check
permission based on request to /v2/* api via security context

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-01-27 12:53:15 +08:00
He Weiwei
b594861658 feat(middleware): add transaction middleware for v2 and v2.0 APIs
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-01-22 05:00:39 +00:00
wang yan
8fae15b803 add immutable tag middleware into new v2 handler
Signed-off-by: wang yan <wangyan@vmware.com>
2020-01-20 22:41:08 +08:00
He Weiwei
33dfa1ea11
feat(beego): upgrade beego to v1.12 which support middleware (#10524)
1. Upgrade beego to v1.12.0
2. Add RequestID middleware to all HTTP requests.
3. Add Orm middleware to v2 and v2.0 APIs.
4. Remove OrmFilter from all HTTP requests.
5. Fix some test cases which cause panic in API controllers.
6. Enable XSRF for test cases of CommonController.
7. Imporve ReadOnly middleware.

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-01-20 16:41:49 +08:00
wang yan
7ebb337e3f add regtoken middleware in new v2 handler
To move the regtoken middlware to new v2 handler framework, it parses the docker pull bearer token and check whether it's a scanner pull.

Signed-off-by: wang yan <wangyan@vmware.com>
2020-01-20 11:02:10 +08:00
wang yan
bffbc4009b add get manifest information middleware in new v2 hanlder
To add a new middleware to resolve the manifest information from request path, then pass
it into the request context for later use.

Signed-off-by: wang yan <wangyan@vmware.com>
2020-01-19 12:31:38 +08:00
wang yan
935303a476 move readonly middleware to new v2 handler
Signed-off-by: wang yan <wangyan@vmware.com>
2020-01-17 11:12:10 +08:00
Wenkai Yin(尹文开)
4f3024191b
Merge pull request #10458 from ywk253100/20013_middleware
Provide a util function to apply middlewares to handler
2020-01-14 17:11:59 +08:00
He Weiwei
c729e3b9e0 feat(swagger): generate apis v2.0 from swagger.yaml
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-01-14 02:20:18 +00:00
Wenkai Yin
c5cc7cf49e Provide a util function to apply middlewares to handler
Provide a util function to apply middlewares to handler

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-01-13 19:27:00 +08:00
Wenkai Yin
1a026a744f Add the registry handlers without the implementation detail
This commit adds several handlers to handle registry requests, some of the handlers aren't implemented yet, will be done later

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-12-24 09:12:20 +08:00