mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-04 01:48:50 +00:00
chore: Service Account Naming Consistency (#11557)
# Which Problems Are Solved Inconsistent naming of service account, found in the following variations: - Machine User - machine user - Service User - Machine Account - Technical Account - User: Type Machine # How the Problems Are Solved Attentive search and replace. Localizations have been translated using Copilot # Additional Changes Some unused methods have been removed from the Go code. # Additional Context - Closes #11285
This commit is contained in:
Vendored
+5
-5
@@ -2,12 +2,12 @@ declare namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
// Allow any environment variable that matches the pattern
|
||||
[key: `${string}_AUDIENCE`]: string; // The system api url
|
||||
[key: `${string}_SYSTEM_USER_ID`]: string; // The service user id
|
||||
[key: `${string}_SYSTEM_USER_PRIVATE_KEY`]: string; // The service user private key
|
||||
[key: `${string}_SYSTEM_USER_ID`]: string; // The service account id
|
||||
[key: `${string}_SYSTEM_USER_PRIVATE_KEY`]: string; // The service account private key
|
||||
|
||||
AUDIENCE: string; // The fallback system api url
|
||||
SYSTEM_USER_ID: string; // The fallback service user id
|
||||
SYSTEM_USER_PRIVATE_KEY: string; // The fallback service user private key
|
||||
SYSTEM_USER_ID: string; // The fallback service account id
|
||||
SYSTEM_USER_PRIVATE_KEY: string; // The fallback service account private key
|
||||
|
||||
/**
|
||||
* The Zitadel API url
|
||||
@@ -15,7 +15,7 @@ declare namespace NodeJS {
|
||||
ZITADEL_API_URL: string;
|
||||
|
||||
/**
|
||||
* The service user token
|
||||
* The service account token
|
||||
* If ZITADEL_SERVICE_USER_TOKEN is set, its value is used.
|
||||
* If ZITADEL_SERVICE_USER_TOKEN is not set but ZITADEL_SERVICE_USER_TOKEN_FILE is set, the application blocks until the file is created.
|
||||
* As soon as the file exists, its content is read and ZITADEL_SERVICE_USER_TOKEN is set.
|
||||
|
||||
@@ -15,7 +15,7 @@ export function hasSystemUserCredentials(): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if service user token is available for authentication.
|
||||
* Checks if service account token is available for authentication.
|
||||
*
|
||||
* @returns true if ZITADEL_SERVICE_USER_TOKEN is present, false otherwise
|
||||
*/
|
||||
|
||||
@@ -23,11 +23,11 @@ export async function createServiceForHost<T extends ServiceClass>(service: T, s
|
||||
let token;
|
||||
|
||||
// Determine authentication method based on available credentials
|
||||
// Prefer system user JWT if available, fallback to service user token
|
||||
// Prefer system user JWT if available, fallback to service account token
|
||||
if (hasSystemUserCredentials()) {
|
||||
token = await systemAPIToken();
|
||||
} else if (hasServiceUserToken()) {
|
||||
// Use service user token authentication (self-hosted)
|
||||
// Use service account token authentication (self-hosted)
|
||||
token = process.env.ZITADEL_SERVICE_USER_TOKEN;
|
||||
} else {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user