Restructure token store by remote id
This commit is contained in:
+123
-41
@@ -42,14 +42,125 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"remote": {
|
||||
"scope_permissions": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["name", "org", "repo"],
|
||||
"required": ["a", "A", "i", "m", "n", "o", "p", "r", "u"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"a": {
|
||||
"$ref": "#/$defs/scope_value",
|
||||
"description": "activitypub"
|
||||
},
|
||||
"A": {
|
||||
"$ref": "#/$defs/scope_value",
|
||||
"description": "admin"
|
||||
},
|
||||
"i": {
|
||||
"$ref": "#/$defs/scope_value",
|
||||
"description": "issue"
|
||||
},
|
||||
"m": {
|
||||
"$ref": "#/$defs/scope_value",
|
||||
"description": "misc"
|
||||
},
|
||||
"n": {
|
||||
"$ref": "#/$defs/scope_value",
|
||||
"description": "notification"
|
||||
},
|
||||
"o": {
|
||||
"$ref": "#/$defs/scope_value",
|
||||
"description": "organization"
|
||||
},
|
||||
"p": {
|
||||
"$ref": "#/$defs/scope_value",
|
||||
"description": "package"
|
||||
},
|
||||
"r": {
|
||||
"$ref": "#/$defs/scope_value",
|
||||
"description": "repository"
|
||||
},
|
||||
"u": {
|
||||
"$ref": "#/$defs/scope_value",
|
||||
"description": "user"
|
||||
}
|
||||
}
|
||||
},
|
||||
"org_permissions": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["o", "a", "w", "r", "c"],
|
||||
"properties": {
|
||||
"o": {
|
||||
"$ref": "#/$defs/flag_value",
|
||||
"description": "owner"
|
||||
},
|
||||
"a": {
|
||||
"$ref": "#/$defs/flag_value",
|
||||
"description": "admin"
|
||||
},
|
||||
"w": {
|
||||
"$ref": "#/$defs/flag_value",
|
||||
"description": "write"
|
||||
},
|
||||
"r": {
|
||||
"$ref": "#/$defs/flag_value",
|
||||
"description": "read"
|
||||
},
|
||||
"c": {
|
||||
"$ref": "#/$defs/flag_value",
|
||||
"description": "create repository"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repo_permissions": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["o", "a", "w", "r"],
|
||||
"properties": {
|
||||
"o": {
|
||||
"$ref": "#/$defs/flag_value",
|
||||
"description": "owner"
|
||||
},
|
||||
"a": {
|
||||
"$ref": "#/$defs/flag_value",
|
||||
"description": "admin"
|
||||
},
|
||||
"w": {
|
||||
"$ref": "#/$defs/flag_value",
|
||||
"description": "write"
|
||||
},
|
||||
"r": {
|
||||
"$ref": "#/$defs/flag_value",
|
||||
"description": "read"
|
||||
}
|
||||
}
|
||||
},
|
||||
"scope_value": {
|
||||
"enum": ["w", "r", "-", "?", "!"]
|
||||
},
|
||||
"flag_value": {
|
||||
"enum": ["+", "-", "?", "!"]
|
||||
},
|
||||
"token": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["id", "value", "server", "org", "repo"],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
"minLength": 1,
|
||||
"description": "Git remote name, for example r1 or r1a."
|
||||
},
|
||||
"value": {
|
||||
"type": "string",
|
||||
"description": "Token secret. May be empty only in a manual skeleton."
|
||||
},
|
||||
"server": {
|
||||
"$ref": "#/$defs/server"
|
||||
},
|
||||
"user": {
|
||||
"type": "string",
|
||||
"description": "User/login used in the authenticated remote URL."
|
||||
},
|
||||
"org": {
|
||||
"type": "string"
|
||||
@@ -57,49 +168,20 @@
|
||||
"repo": {
|
||||
"type": "string"
|
||||
},
|
||||
"org_perm": {
|
||||
"type": "string",
|
||||
"pattern": "^[+?!-]{5}$"
|
||||
},
|
||||
"repo_perm": {
|
||||
"type": "string",
|
||||
"pattern": "^[+?!-]{4}$"
|
||||
}
|
||||
}
|
||||
},
|
||||
"token": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["token_id", "value", "server", "remotes"],
|
||||
"properties": {
|
||||
"token_id": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"value": {
|
||||
"type": "string"
|
||||
},
|
||||
"server": {
|
||||
"$ref": "#/$defs/server"
|
||||
},
|
||||
"user": {
|
||||
"type": "string"
|
||||
},
|
||||
"valid": {
|
||||
"type": "string"
|
||||
},
|
||||
"scope": {
|
||||
"type": "string",
|
||||
"pattern": "^[rw?!-]{9}$"
|
||||
},
|
||||
"expires_at": {
|
||||
"type": "string"
|
||||
},
|
||||
"remotes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/remote"
|
||||
}
|
||||
"scope": {
|
||||
"$ref": "#/$defs/scope_permissions"
|
||||
},
|
||||
"org_perm": {
|
||||
"$ref": "#/$defs/org_permissions"
|
||||
},
|
||||
"repo_perm": {
|
||||
"$ref": "#/$defs/repo_permissions"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user