Skip to content

Commit

Permalink
feat: API to save external links as attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
LIlGG committed Jul 24, 2024
1 parent 2a807b7 commit 5b4f691
Show file tree
Hide file tree
Showing 343 changed files with 839 additions and 377 deletions.
86 changes: 69 additions & 17 deletions api-docs/openapi/v3_0/aggregated.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.1",
"info": {
"title": "Halo",
"version": "2.17.0-SNAPSHOT"
"version": "2.18.0-SNAPSHOT"
},
"servers": [
{
Expand Down Expand Up @@ -2250,6 +2250,36 @@
]
}
},
"/apis/api.console.halo.run/v1alpha1/attachments/external-transfer": {
"post": {
"operationId": "ExternalTransferAttachment",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExternalTransferRequest"
}
}
},
"required": true
},
"responses": {
"default": {
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
},
"description": "default response"
}
},
"tags": [
"AttachmentV1alpha1Console"
]
}
},
"/apis/api.console.halo.run/v1alpha1/attachments/upload": {
"post": {
"operationId": "UploadAttachment",
Expand Down Expand Up @@ -17046,6 +17076,28 @@
}
}
},
"ExternalTransferRequest": {
"required": [
"externalUrl",
"policyName"
],
"type": "object",
"properties": {
"externalUrl": {
"type": "string",
"format": "uri"
},
"filename": {
"type": "string"
},
"groupName": {
"type": "string"
},
"policyName": {
"type": "string"
}
}
},
"FileReverseProxyProvider": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -19726,12 +19778,12 @@
},
"visible": {
"type": "string",
"default": "PUBLIC",
"enum": [
"PUBLIC",
"INTERNAL",
"PRIVATE"
],
"default": "PUBLIC"
]
}
}
},
Expand Down Expand Up @@ -19861,6 +19913,15 @@
}
}
},
"ReasonAttributes": {
"type": "object",
"properties": {
"empty": {
"type": "boolean"
}
},
"description": "Attributes used to transfer data"
},
"ReasonList": {
"required": [
"first",
Expand Down Expand Up @@ -19971,13 +20032,7 @@
"type": "object",
"properties": {
"attributes": {
"type": "object",
"properties": {
"empty": {
"type": "boolean"
}
},
"description": "Attributes used to transfer data"
"$ref": "#/components/schemas/ReasonAttributes"
},
"author": {
"type": "string"
Expand Down Expand Up @@ -21207,11 +21262,8 @@
"data": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string",
"format": "byte"
}
"type": "string",
"format": "byte"
}
},
"kind": {
Expand Down Expand Up @@ -21626,12 +21678,12 @@
},
"visible": {
"type": "string",
"default": "PUBLIC",
"enum": [
"PUBLIC",
"INTERNAL",
"PRIVATE"
],
"default": "PUBLIC"
]
}
}
},
Expand Down
62 changes: 57 additions & 5 deletions api-docs/openapi/v3_0/apis_console.api_v1alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.1",
"info": {
"title": "Halo",
"version": "2.17.0-SNAPSHOT"
"version": "2.18.0-SNAPSHOT"
},
"servers": [
{
Expand Down Expand Up @@ -117,6 +117,36 @@
]
}
},
"/apis/api.console.halo.run/v1alpha1/attachments/external-transfer": {
"post": {
"operationId": "ExternalTransferAttachment",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExternalTransferRequest"
}
}
},
"required": true
},
"responses": {
"default": {
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
},
"description": "default response"
}
},
"tags": [
"AttachmentV1alpha1Console"
]
}
},
"/apis/api.console.halo.run/v1alpha1/attachments/upload": {
"post": {
"operationId": "UploadAttachment",
Expand Down Expand Up @@ -4053,6 +4083,28 @@
}
}
},
"ExternalTransferRequest": {
"required": [
"externalUrl",
"policyName"
],
"type": "object",
"properties": {
"externalUrl": {
"type": "string",
"format": "uri"
},
"filename": {
"type": "string"
},
"groupName": {
"type": "string"
},
"policyName": {
"type": "string"
}
}
},
"GrantRequest": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -5141,12 +5193,12 @@
},
"visible": {
"type": "string",
"default": "PUBLIC",
"enum": [
"PUBLIC",
"INTERNAL",
"PRIVATE"
],
"default": "PUBLIC"
]
}
}
},
Expand Down Expand Up @@ -5652,12 +5704,12 @@
},
"visible": {
"type": "string",
"default": "PUBLIC",
"enum": [
"PUBLIC",
"INTERNAL",
"PRIVATE"
],
"default": "PUBLIC"
]
}
}
},
Expand Down
17 changes: 7 additions & 10 deletions api-docs/openapi/v3_0/apis_extension.api_v1alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.1",
"info": {
"title": "Halo",
"version": "2.17.0-SNAPSHOT"
"version": "2.18.0-SNAPSHOT"
},
"servers": [
{
Expand Down Expand Up @@ -10668,12 +10668,12 @@
},
"visible": {
"type": "string",
"default": "PUBLIC",
"enum": [
"PUBLIC",
"INTERNAL",
"PRIVATE"
],
"default": "PUBLIC"
]
}
}
},
Expand Down Expand Up @@ -11475,11 +11475,8 @@
"data": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string",
"format": "byte"
}
"type": "string",
"format": "byte"
}
},
"kind": {
Expand Down Expand Up @@ -11858,12 +11855,12 @@
},
"visible": {
"type": "string",
"default": "PUBLIC",
"enum": [
"PUBLIC",
"INTERNAL",
"PRIVATE"
],
"default": "PUBLIC"
]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion api-docs/openapi/v3_0/apis_public.api_v1alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.1",
"info": {
"title": "Halo",
"version": "2.17.0-SNAPSHOT"
"version": "2.18.0-SNAPSHOT"
},
"servers": [
{
Expand Down
6 changes: 3 additions & 3 deletions api-docs/openapi/v3_0/apis_uc.api_v1alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.1",
"info": {
"title": "Halo",
"version": "2.17.0-SNAPSHOT"
"version": "2.18.0-SNAPSHOT"
},
"servers": [
{
Expand Down Expand Up @@ -1582,12 +1582,12 @@
},
"visible": {
"type": "string",
"default": "PUBLIC",
"enum": [
"PUBLIC",
"INTERNAL",
"PRIVATE"
],
"default": "PUBLIC"
]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,15 @@ Mono<Attachment> upload(@NonNull String policyName,
*/
Mono<URI> getSharedURL(Attachment attachment, Duration ttl);

/**
* Transfer external links to attachments.
*
* @param externalUrl external url
* @param policyName policy name
* @param groupName group name
* @param filename filename
* @return attachment
*/
Mono<Attachment> externalTransfer(@NonNull URI externalUrl, @NonNull String policyName,
String groupName, String filename);
}
Loading

0 comments on commit 5b4f691

Please sign in to comment.