Skip to content

Commit bbf4a38

Browse files
author
edge-katanomi-app2[bot]
committed
📚 Sync docs from alaudadevops/connectors-operator on c909fef091eb9590035e61e1e2e192dd1bd036fb
Source: add docs to describe connectors api by proxy (#294) Author: chengjingtao Ref: refs/heads/main Commit: c909fef091eb9590035e61e1e2e192dd1bd036fb This commit automatically syncs documentation changes from the source-docs repository. 🔗 View source commit: https://github.com/alaudadevops/connectors-operator/commit/c909fef091eb9590035e61e1e2e192dd1bd036fb 🤖 Synced on 2025-11-10 07:44:15 UTC
1 parent 8c265fd commit bbf4a38

File tree

7 files changed

+229
-83
lines changed

7 files changed

+229
-83
lines changed

‎.github/SYNC_INFO.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Documentation Sync Information
22

3-
- **Last synced**: 2025-11-07 08:50:22 UTC
3+
- **Last synced**: 2025-11-10 07:44:15 UTC
44
- **Source repository**: alaudadevops/connectors-operator
5-
- **Source commit**: [7e55b6fbcddf4534f95817450833ffc488029a09](https://github.com/alaudadevops/connectors-operator/commit/7e55b6fbcddf4534f95817450833ffc488029a09)
5+
- **Source commit**: [c909fef091eb9590035e61e1e2e192dd1bd036fb](https://github.com/alaudadevops/connectors-operator/commit/c909fef091eb9590035e61e1e2e192dd1bd036fb)
66
- **Triggered by**: edge-katanomi-app2[bot]
7-
- **Workflow run**: [#46](https://github.com/alaudadevops/connectors-operator/actions/runs/19163120541)
7+
- **Workflow run**: [#47](https://github.com/alaudadevops/connectors-operator/actions/runs/19224399099)
88

99
## Files synced:
1010
- docs/
1.56 MB
Loading

‎docs/en/connectors/architecture/index.mdx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,16 @@ More information: [Connectors Proxy](../concepts/connectors_proxy.mdx)
6060

6161
Developers can conveniently access resources within tools via the `Connectors API` without needing to concern themselves with specific tool addresses and authentication details.
6262

63+
The system supports two ways to access tool resources through the API:
64+
65+
- **Original Tool API**: When the ConnectorClass provides Proxy Service capabilities, clients can directly access the tool's original API through the Connector API. The system automatically forwards requests to the tool's Proxy Service, completes authentication injection, and returns the original data from the tool.
66+
- **Custom API**: Use custom APIs provided for the ConnectorClass, which offer extended capabilities beyond the tool's original API.
67+
6368
This API is very useful in practical applications, such as:
6469

6570
- Retrieving the list of tags for container images when creating applications
6671
- Getting the list of branches (References) for a code repository during a Git Clone operation
72+
- Accessing tool-specific APIs directly when the ConnectorClass supports Proxy Service
6773

6874
The implementation of the `Connectors API` is based on the underlying capabilities provided by the `ConnectorClass API`.
6975

‎docs/en/connectors/concepts/connector.mdx‎

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,35 @@ status:
241241
url: http://c-harbor.default.svc.cluster.local/namespaces/default/connectors/harbor
242242
```
243243

244+
## Status Information
244245

246+
The status information of the Connector is recorded in the `status` field, containing proxy address, API address, and conditions:
245247

246-
## Status Information
248+
- `status.conditions`: Conditions of the Connector.
249+
- `status.proxy`: Proxy address of the Connector.
250+
- `status.api`: API address of the Connector.
251+
252+
**Proxy Address**
253+
254+
The `proxy` field contains the proxy address of the Connector.
255+
256+
- `status.proxy.httpAddress.url`: The HTTP address of the proxy for the current Connector.
257+
258+
You can use this address with existing tool clients to access the tool in a secretless manner within the cluster. For more information, refer to [Connector Proxy](#connector_proxy).
259+
260+
If the ConnectorClass has no proxy capability, the `status.proxy` field will be empty.
247261

248-
The status information of the Connector is recorded in the `status` field, containing the following content:
262+
**API Address**
263+
264+
The `api` field contains the API address of the Connector.
265+
266+
- `status.api.path`: The API relative path for the current Connector (relative to the cluster ingress access entrypoint).
267+
268+
You can use this path outside the cluster to access the tool's original API through the current Connector. For more information, refer to [Connector API](./connector_api.mdx).
269+
270+
**Conditions**
271+
272+
The `conditions` type includes:
249273

250274
- `ConnectorClassReady`: Indicates whether the connector type is correct.
251275
- `SecretReady`: Indicates whether the authentication information is correctly configured.
@@ -326,8 +350,6 @@ status:
326350
message: ""
327351
```
328352

329-
For more information on conditions, please refer to `Connector Conditions`.
330-
331353
## Examples
332354

333355
### Git Connector with Basic Authentication

‎docs/en/connectors/concepts/connector_api.mdx‎

Lines changed: 115 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,105 @@
22
created: '2024-12-01'
33
title: Connector API
44
weight: 50
5-
sourceSHA: 787a9663c2b07bba63b2648088abf865fb2f475cfe27d1f24fd23a68b9cca2fd
65
---
76

87
# Connector API
98

109
## Overview
1110

12-
After integrating access tools within the cluster, a RESTful API can be provided for the current ConnectorClass to conveniently acquire resources within the tool. These APIs will be uniformly exposed through the Connector API, allowing users to obtain resources from the tool pointed to by the current Connector.
11+
After integrating tools within the cluster, a RESTful API can be provided for the current Connector to conveniently acquire resources from the tool. These APIs are uniformly exposed through the Connector API, allowing users to obtain resources from the tool pointed to by the current Connector.
1312

14-
The Connectors system provides a complete set of extension mechanisms, making it easier for developers to extend the API capabilities of ConnectorClass.
13+
The Connectors system supports two ways to access tool resources through the API:
1514

16-
The Connectors API offers a unified request entry point. When a client initiates a resource request for the tool pointed to by a specific Connector, the system will forward the request to the corresponding API address of the ConnectorClass, which in turn will forward the request to the tool's API address to retrieve resources within the tool.
15+
- **Original Tool API**: Access the tool's original API through the Proxy Service
16+
- **Custom API**: Use a custom API provided for the ConnectorClass
1717

18-
For example:
18+
When using the Connectors API, clients do not need to manage the tool's original authentication credentials. They only need to have permissions to access the Connector. The permissions for API requests to the tool are determined by the permissions of the credentials (Secret) configured in the Connector.
19+
20+
## Connector API Address and Authentication
1921

20-
- Retrieve the Reference list of a specific repository under the Git Connector.
21-
- Retrieve the Tag list of a specific artifact repository under the OIC Connector.
22+
### API Address
2223

23-
## API Definition
24+
The Connector API address consists of three parts:
2425

25-
**API Address**
26+
- Platform API or cluster ingress access entry point
27+
- Connector API relative path
28+
- Requested tool's original API path or custom API path
2629

27-
`/connectors/v1alpha1/namespaces/{namespace}/connectors/{name}/resources/{resource-name}`
30+
After creating a Connector in the cluster, the Connector automatically records the current Connector's API path in `<connector>.status.api.path`. Note that this path is a relative path to the cluster access entry point.
2831

29-
- `namespace`: The namespace where the current Connector resides.
30-
- `name`: The name of the current Connector.
31-
- `resource-name`: The name of the resource being requested, which can be understood by consulting the documentation of the corresponding ConnectorClass.
32+
The final Connector API address is: `{platform_api_address}/{<connector>.status.api.path}/{api-path}`
3233

33-
**Authentication and Authorization**
34+
::: info
35+
In Alauda Container Platform, the API access entry point is typically `{platform_address}/clusters-rewrite/{cluster_name}`.
36+
:::
3437

35-
Authentication complies with Kubernetes authentication standards, completed through Kubernetes' authentication and authorization mechanisms. The requesting user must have read permissions for the corresponding `connector`.
38+
### Authentication and Authorization
39+
40+
Authentication complies with Kubernetes authentication standards and is completed through Kubernetes' authentication and authorization mechanisms. The requesting user must have read permissions for the corresponding `Connector`. Currently, only Bearer Token authentication is supported.
3641

3742
When making the final request to the tool, the Secret information specified by the Connector will be used for authentication.
3843

39-
**Query Parameters**
44+
For more information about Kubernetes API authentication, refer to the [Kubernetes Authentication documentation](https://kubernetes.io/docs/reference/access-authn-authz/authentication).
45+
46+
## Accessing Original Tool API
47+
48+
When your ConnectorClass provides Proxy Service capabilities, you can directly access the tool's original API through the Connector API.
49+
50+
For example, if the tool's original API address is `/api/v4/projects`, you can access it through the Connector API. Assuming you have a Connector named `gitlab-connector` in the `default` namespace, and the Connector's API path is `/connectors/v1alpha1/default/gitlab-connector/path`, the request would be:
51+
52+
```bash
53+
K8S_TOKEN=xxxx
54+
55+
curl -H "Authorization: Bearer ${K8S_TOKEN}" "https://platform.example.com/connectors/v1alpha1/default/gitlab-connector/path/api/v4/projects"
56+
```
57+
58+
The Proxy Service capabilities can be configured through the `ConnectorClass` specification. For configuration details, refer to [ConnectorClass Proxy](./connectorclass.mdx#connectorclass_proxy). For a deeper understanding of the `Connectors Proxy` concept, refer to [Connectors Proxy](./connectors_proxy.mdx).
59+
60+
## Custom API
61+
62+
When the tool's original API cannot meet your requirements or the ConnectorClass does not provide Proxy Service capabilities, you can provide a custom API service for the current ConnectorClass to meet your needs.
63+
64+
The custom API service can be configured through the `spec.api` field of the ConnectorClass, allowing the Connectors system to discover and use it. For configuration details, refer to [ConnectorClass API](./connectorclass.mdx#connectorclass_api).
65+
66+
Additionally, to enable the system to identify that the API is a custom API, you need to configure the OpenAPI description through the `spec.api.openapi` field.
67+
68+
### API Definition
4069

41-
Determined by the specific ConnectorClass API.
70+
#### API Path
4271

43-
**Pagination Information**
72+
The API path provided by the custom API can be freely defined in the extended API service. The recommended format is `/<connectorclass-name>/xxx`.
4473

45-
Indicated by query parameters.
74+
Combined with the API address and authentication described above, here is a request example. Assuming you have a Connector named `git-connector` in the `default` namespace, and the custom API path is `/git/gitrefs`, the request would be:
4675

47-
| Parameter Name | Type | Required | Description |
48-
| ------------------ | ----- | -------- | ------------ |
49-
| page | int | false | Page number |
50-
| itemsPerPage | int | false | Number of items per page |
76+
```bash
77+
K8S_TOKEN=xxxx
5178

52-
**Response Information**
79+
curl -H "Authorization: Bearer ${K8S_TOKEN}" "https://platform.example.com/connectors/v1alpha1/default/git-connector/git/gitrefs"
80+
```
81+
82+
#### Query Parameters
83+
84+
Query parameters are determined by the specific [ConnectorClass API Specification](./connectorclass_api_spec.mdx).
85+
86+
#### Pagination
5387

54-
When returning a list, the structure will be as follows:
88+
Pagination information is indicated by query parameters:
5589

56-
| Field Name | Type | Required | Description |
57-
| -------------------| ---------- | -------- | ------------------------------------------ |
58-
| listMeta | ListMeta | true | Metadata of the list |
90+
| Parameter Name | Type | Required | Description |
91+
| -------------- | ---- | -------- | -------------------------- |
92+
| page | int | false | Page number |
93+
| itemsPerPage | int | false | Number of items per page |
94+
95+
#### Response Format
96+
97+
When returning a list, the response structure is as follows:
98+
99+
| Field Name | Type | Required | Description |
100+
| ------------------ | --------- | -------- | --------------------------------------------------------------------------- |
101+
| listMeta | ListMeta | true | Metadata of the list |
59102
| listMeta.totalItems| int | true | Total number of requested resources, usable by the client to analyze pagination information |
60-
| items | \[] | true | Data items in the list; the data structure is determined by the ConnectorClass API |
103+
| items | [] | true | Data items in the list; the data structure is determined by the ConnectorClass API |
61104

62105
```json
63106
{
@@ -88,8 +131,50 @@ For example:
88131

89132
Field definitions and enumeration values are consistent with [k8s status](https://pkg.go.dev/k8s.io/[email protected]/pkg/apis/meta/v1#Status).
90133

91-
## ConnectorClass API Extension Specification
134+
### OpenAPI Description
135+
136+
In addition to providing a custom API service, you need to configure the OpenAPI description information in the `spec.api.openapi` field of the ConnectorClass to enable the system to identify that the API is a custom API.
137+
138+
Example:
139+
140+
```yaml
141+
kind: ConnectorClass
142+
metadata:
143+
name: gitlab
144+
spec:
145+
api:
146+
ref: # Reference to the custom API service
147+
name: connectors-gitlab-api
148+
namespace: connectors-system
149+
openapi:
150+
openapi: "3.0.1"
151+
info:
152+
title: GitLab Custom API
153+
version: "1.0.0"
154+
paths:
155+
/gitlab/custom-api: # Custom API defined in the connectors-gitlab-api service
156+
get:
157+
x-provider-type: api # Indicates this API is a custom API
158+
summary: Request custom API
159+
responses:
160+
"200":
161+
description: Custom API response
162+
```
163+
164+
The system will automatically forward the custom API to the [ConnectorClass API Address](./connectorclass.mdx#connectorclass_api_address) based on the `spec.api.openapi` description.
165+
166+
For configuration details about `spec.api.openapi`, refer to [ConnectorClass OpenAPI Description](./connectorclass.mdx#api_openapi). For more usage examples, refer to [Using Connectors API in Dynamic Forms](#dynamic-form-using-connectors-api).
167+
168+
### ConnectorClass API Extension Specification
92169

93170
Developers can extend the API capabilities for ConnectorClass to provide users with richer resource retrieval capabilities.
94171

95172
Refer to the [ConnectorClass API Extension Specification](./connectorclass_api_spec.mdx).
173+
174+
## Using Connectors API in Dynamic Forms \{#dynamic-form-using-connectors-api}
175+
176+
The Connector API can be provided to UI clients, especially for dynamic form scenarios where UI clients can flexibly configure the API requests to be called.
177+
178+
To enable this, you need to configure the OpenAPI description information through the `spec.api.openapi` field of the ConnectorClass, which works together with the dynamic form DSL to implement frontend dynamic form rendering.
179+
180+
The dynamic form description is typically provided in the [Resource Interface](./resource_interface.mdx). For more details, refer to [Resource Interface](./resource_interface.mdx).

0 commit comments

Comments
 (0)