mirror of
https://github.com/datarhei/core.git
synced 2025-10-04 07:37:33 +08:00
Add IAM identity alias to API
This commit is contained in:
@@ -1997,6 +1997,9 @@ const docTemplateClusterAPI = `{
|
||||
"identity.User": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"alias": {
|
||||
"type": "string"
|
||||
},
|
||||
"auth": {
|
||||
"$ref": "#/definitions/identity.UserAuth"
|
||||
},
|
||||
|
@@ -1989,6 +1989,9 @@
|
||||
"identity.User": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"alias": {
|
||||
"type": "string"
|
||||
},
|
||||
"auth": {
|
||||
"$ref": "#/definitions/identity.UserAuth"
|
||||
},
|
||||
|
@@ -583,6 +583,8 @@ definitions:
|
||||
type: object
|
||||
identity.User:
|
||||
properties:
|
||||
alias:
|
||||
type: string
|
||||
auth:
|
||||
$ref: '#/definitions/identity.UserAuth'
|
||||
name:
|
||||
|
104
docs/docs.go
104
docs/docs.go
@@ -375,6 +375,92 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v3/cluster/fs/{storage}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"ApiKeyAuth": []
|
||||
}
|
||||
],
|
||||
"description": "List all files on a filesystem. The listing can be ordered by name, size, or date of last modification in ascending or descending order.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"v16.?.?"
|
||||
],
|
||||
"summary": "List all files on a filesystem",
|
||||
"operationId": "cluster-3-list-files",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Name of the filesystem",
|
||||
"name": "storage",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "glob pattern for file names",
|
||||
"name": "glob",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "minimal size of files",
|
||||
"name": "size_min",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "maximal size of files",
|
||||
"name": "size_max",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "minimal last modification time",
|
||||
"name": "lastmod_start",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "maximal last modification time",
|
||||
"name": "lastmod_end",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "none, name, size, lastmod",
|
||||
"name": "sort",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "asc, desc",
|
||||
"name": "order",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/api.FileInfo"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/api.Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v3/cluster/healthy": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -4594,6 +4680,9 @@ const docTemplate = `{
|
||||
"description": "percent 0-100*npcu",
|
||||
"type": "number"
|
||||
},
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"is_throttling": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -5327,6 +5416,12 @@ const docTemplate = `{
|
||||
},
|
||||
"event": {
|
||||
"type": "string"
|
||||
},
|
||||
"level": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -5344,6 +5439,9 @@ const docTemplate = `{
|
||||
"api.FileInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"core_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_modified": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
@@ -5475,6 +5573,9 @@ const docTemplate = `{
|
||||
"api.IAMUser": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"alias": {
|
||||
"type": "string"
|
||||
},
|
||||
"auth": {
|
||||
"$ref": "#/definitions/api.IAMUserAuth"
|
||||
},
|
||||
@@ -6886,6 +6987,9 @@ const docTemplate = `{
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"ttl_sec": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@@ -367,6 +367,92 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v3/cluster/fs/{storage}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"ApiKeyAuth": []
|
||||
}
|
||||
],
|
||||
"description": "List all files on a filesystem. The listing can be ordered by name, size, or date of last modification in ascending or descending order.",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"v16.?.?"
|
||||
],
|
||||
"summary": "List all files on a filesystem",
|
||||
"operationId": "cluster-3-list-files",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Name of the filesystem",
|
||||
"name": "storage",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "glob pattern for file names",
|
||||
"name": "glob",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "minimal size of files",
|
||||
"name": "size_min",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "maximal size of files",
|
||||
"name": "size_max",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "minimal last modification time",
|
||||
"name": "lastmod_start",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"description": "maximal last modification time",
|
||||
"name": "lastmod_end",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "none, name, size, lastmod",
|
||||
"name": "sort",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "asc, desc",
|
||||
"name": "order",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/api.FileInfo"
|
||||
}
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/api.Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v3/cluster/healthy": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -4586,6 +4672,9 @@
|
||||
"description": "percent 0-100*npcu",
|
||||
"type": "number"
|
||||
},
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"is_throttling": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@@ -5319,6 +5408,12 @@
|
||||
},
|
||||
"event": {
|
||||
"type": "string"
|
||||
},
|
||||
"level": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -5336,6 +5431,9 @@
|
||||
"api.FileInfo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"core_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_modified": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
@@ -5467,6 +5565,9 @@
|
||||
"api.IAMUser": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"alias": {
|
||||
"type": "string"
|
||||
},
|
||||
"auth": {
|
||||
"$ref": "#/definitions/api.IAMUserAuth"
|
||||
},
|
||||
@@ -6878,6 +6979,9 @@
|
||||
},
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"ttl_sec": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@@ -174,6 +174,8 @@ definitions:
|
||||
cpu_used:
|
||||
description: percent 0-100*npcu
|
||||
type: number
|
||||
error:
|
||||
type: string
|
||||
is_throttling:
|
||||
type: boolean
|
||||
memory_limit_bytes:
|
||||
@@ -668,6 +670,10 @@ definitions:
|
||||
type: object
|
||||
event:
|
||||
type: string
|
||||
level:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
type: object
|
||||
api.EventFilters:
|
||||
properties:
|
||||
@@ -678,6 +684,8 @@ definitions:
|
||||
type: object
|
||||
api.FileInfo:
|
||||
properties:
|
||||
core_id:
|
||||
type: string
|
||||
last_modified:
|
||||
format: int64
|
||||
type: integer
|
||||
@@ -765,6 +773,8 @@ definitions:
|
||||
type: object
|
||||
api.IAMUser:
|
||||
properties:
|
||||
alias:
|
||||
type: string
|
||||
auth:
|
||||
$ref: '#/definitions/api.IAMUserAuth'
|
||||
name:
|
||||
@@ -1791,6 +1801,8 @@ definitions:
|
||||
type: array
|
||||
token:
|
||||
type: string
|
||||
ttl_sec:
|
||||
type: integer
|
||||
type: object
|
||||
api.SessionsActive:
|
||||
additionalProperties:
|
||||
@@ -2664,6 +2676,63 @@ paths:
|
||||
summary: List of identities in the cluster
|
||||
tags:
|
||||
- v16.?.?
|
||||
/api/v3/cluster/fs/{storage}:
|
||||
get:
|
||||
description: List all files on a filesystem. The listing can be ordered by name,
|
||||
size, or date of last modification in ascending or descending order.
|
||||
operationId: cluster-3-list-files
|
||||
parameters:
|
||||
- description: Name of the filesystem
|
||||
in: path
|
||||
name: storage
|
||||
required: true
|
||||
type: string
|
||||
- description: glob pattern for file names
|
||||
in: query
|
||||
name: glob
|
||||
type: string
|
||||
- description: minimal size of files
|
||||
in: query
|
||||
name: size_min
|
||||
type: integer
|
||||
- description: maximal size of files
|
||||
in: query
|
||||
name: size_max
|
||||
type: integer
|
||||
- description: minimal last modification time
|
||||
in: query
|
||||
name: lastmod_start
|
||||
type: integer
|
||||
- description: maximal last modification time
|
||||
in: query
|
||||
name: lastmod_end
|
||||
type: integer
|
||||
- description: none, name, size, lastmod
|
||||
in: query
|
||||
name: sort
|
||||
type: string
|
||||
- description: asc, desc
|
||||
in: query
|
||||
name: order
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/api.FileInfo'
|
||||
type: array
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/api.Error'
|
||||
security:
|
||||
- ApiKeyAuth: []
|
||||
summary: List all files on a filesystem
|
||||
tags:
|
||||
- v16.?.?
|
||||
/api/v3/cluster/healthy:
|
||||
get:
|
||||
description: Whether the cluster is healthy
|
||||
|
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
type IAMUser struct {
|
||||
Name string `json:"name"`
|
||||
Alias string `json:"alias"`
|
||||
Superuser bool `json:"superuser"`
|
||||
Auth IAMUserAuth `json:"auth"`
|
||||
Policies []IAMPolicy `json:"policies"`
|
||||
@@ -14,6 +15,7 @@ type IAMUser struct {
|
||||
|
||||
func (u *IAMUser) Marshal(user identity.User, policies []access.Policy) {
|
||||
u.Name = user.Name
|
||||
u.Alias = user.Alias
|
||||
u.Superuser = user.Superuser
|
||||
u.Auth = IAMUserAuth{
|
||||
API: IAMUserAuthAPI{
|
||||
@@ -46,6 +48,7 @@ func (u *IAMUser) Marshal(user identity.User, policies []access.Policy) {
|
||||
func (u *IAMUser) Unmarshal() (identity.User, []access.Policy) {
|
||||
iamuser := identity.User{
|
||||
Name: u.Name,
|
||||
Alias: u.Alias,
|
||||
Superuser: u.Superuser,
|
||||
Auth: identity.UserAuth{
|
||||
API: identity.UserAuthAPI{
|
||||
|
Reference in New Issue
Block a user