Skip to main content

Gitea connections

The gitea connection type represents a Gitea host. It has multiton cardinality and uses the host lookup strategy.

Configure Gitea​

app-config.yaml
connections:
- type: gitea
host: gitea.example.com
baseUrl: https://gitea.example.com
auth:
- method: basic
username: ${GITEA_USERNAME}
password: ${GITEA_PASSWORD}

Connection fields​

FieldTypeRequiredDescription
hoststringYesGitea host matched against the consumer's resource URL.
baseUrlstringNoBase URL of the Gitea instance.

Authentication methods​

MethodFieldTypeRequiredDescription
noneNone——Does not accept authentication fields.
basicusernamestringYesGitea username.
basicpasswordstringYesGitea password.

Use none explicitly when the target permits unauthenticated access.

Lookup and selection​

The consumer supplies a lookup query containing a Gitea URL. The service selects the connection whose host matches the parsed URL host exactly.

When more than one authentication entry is visible to the calling plugin, the first visible entry is selected. Use plugin scoping to supply different credentials to a specific plugin; otherwise, configuration order determines which entry is selected.

Consume a Gitea connection​

const connection = await connections.find({
type: 'gitea',
query: { url: 'https://gitea.example.com/acme/example' },
authMethods: ['basic', 'none'],
});

connection.baseUrl; // string | undefined

if (connection.auth.method === 'basic') {
connection.auth.username; // string
connection.auth.password; // string
}

Return to the built-in connection type index.