Compare commits

...

3 Commits

3 changed files with 11 additions and 1 deletions

View File

@ -127,5 +127,6 @@ type AccountPinResponse struct {
type AccountPin struct {
Hash string `json:"hash"`
Size uint64 `json:"size"`
MimeType string `json:"mime_type"`
}

View File

@ -197,7 +197,9 @@ func (s *S5API) Routes() (*httprouter.Router, error) {
"GET /s5/account": middleware.ApplyMiddlewares(s.accountInfo, middleware.ProxyMiddleware, authMw),
"GET /s5/account/stats": middleware.ApplyMiddlewares(s.accountStats, middleware.ProxyMiddleware, authMw),
"GET /s5/account/pins.bin": middleware.ApplyMiddlewares(s.accountPinsBinary, middleware.ProxyMiddleware, authMw),
"GET /s5/account/pins": middleware.ApplyMiddlewares(s.accountPins, middleware.ProxyMiddleware, authMw),
"GET /s5/account/pins": middleware.ApplyMiddlewares(s.accountPins, middleware.ProxyMiddleware, defaultCors.Handler, authMw),
"OPTIONS /s5/account/pins": middleware.ApplyMiddlewares(corsOptionsHandler, middleware.ProxyMiddleware, defaultCors.Handler, authMw),
// Upload API
"POST /s5/upload": middleware.ApplyMiddlewares(s.smallFileUpload, middleware.ProxyMiddleware, defaultCors.Handler, authMw),
@ -858,6 +860,7 @@ func (s *S5API) accountPins(jc jape.Context) {
}
pins[i] = AccountPin{
Hash: base64Url,
Size: pin.Upload.Size,
MimeType: pin.Upload.MimeType,
}
}

View File

@ -909,9 +909,15 @@ components:
$ref: '#/components/schemas/AccountPin'
AccountPin:
type: object
required:
- hash
- size
- mime_type
properties:
hash:
type: string
size:
type: integer
mime_type:
type: string
RegistryQueryResponse: