Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/aigateway/src/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type {
ModelProviderServiceConfig_AwsAccessKey,
ModelProviderServiceConfig_AzureOpenAiProviderConfig,
ModelProviderServiceConfig_AzureOpenAiProviderDirectConfig,
ModelProviderServiceConfig_CustomProviderApiKeyHeaderAuth,
ModelProviderServiceConfig_CustomProviderConfig,
ModelProviderServiceConfig_CustomProviderDirectConfig,
ModelProviderServiceConfig_EntraServicePrincipal,
Expand Down
109 changes: 106 additions & 3 deletions packages/aigateway/src/v1/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,13 @@ export interface McpServiceConfig_SourceConnection {
* invocation fails until the source connection is updated.
*/
isDeleted?: boolean | undefined;
/**
* Options needed to build the U2M authorize request, returned as a flat map. When set, it
* includes: `authorization_endpoint` (OAuth authorize URL), `token_endpoint` (token-exchange
* URL), `oauth_scope` (space-separated scopes to request), `client_id` (OAuth client id), and
* `oauth_provider` (the OAuth provider).
*/
options?: Record<string, string> | undefined;
}

/** A caller's per-user OAuth credential for an MCP service. */
Expand Down Expand Up @@ -1021,6 +1028,26 @@ export interface ModelProviderServiceConfig_AzureOpenAiProviderDirectConfig {
| undefined;
}

/**
* Header-based API-key authentication for a custom provider: the secret is
* forwarded on outbound requests under a caller-chosen HTTP header, as
* `<api_key_name>: <api_key_value>`.
*/
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
export interface ModelProviderServiceConfig_CustomProviderApiKeyHeaderAuth {
/**
* HTTP header name that carries the API key on outbound requests (e.g.,
* `Ocp-Apim-Subscription-Key`). The value forwarded under this header is
* supplied via `api_key_value`.
*/
apiKeyName?: string | undefined;
/**
* Secret value forwarded under the `api_key_name` header on outbound
* requests. Supplied as inline plaintext via `ProviderSecret.plaintext`.
*/
apiKeyValue?: ModelProviderServiceConfig_ProviderSecret | undefined;
}

/**
* Custom OpenAI-compatible provider configuration with bearer-token
* authentication.
Expand All @@ -1042,8 +1069,9 @@ export interface ModelProviderServiceConfig_CustomProviderConfig {
}

/**
* Direct form of a custom provider configuration. Set `api_key` to the bearer
* token sent in the `Authorization` header.
* Direct form of a custom provider configuration. Set `api_key` to send the
* secret as an `Authorization` bearer token, or `header_auth` to forward it
* under a caller-chosen HTTP header.
*/
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
export interface ModelProviderServiceConfig_CustomProviderDirectConfig {
Expand All @@ -1065,6 +1093,15 @@ export interface ModelProviderServiceConfig_CustomProviderDirectConfig {
*/
apiKey: ModelProviderServiceConfig_ProviderSecret;
}
| {
$case: 'headerAuth';
/**
* Header-based API-key auth: the secret is forwarded on outbound requests
* under a caller-chosen HTTP header rather than as an `Authorization`
* bearer token. Set this instead of `api_key` for header auth.
*/
headerAuth: ModelProviderServiceConfig_CustomProviderApiKeyHeaderAuth;
}
| undefined;
}

Expand Down Expand Up @@ -1766,10 +1803,12 @@ export const unmarshalMcpServiceConfig_SourceConnectionSchema: z.ZodType<McpServ
.object({
name: z.string().optional(),
is_deleted: z.boolean().optional(),
options: z.record(z.string(), z.string()).optional(),
})
.transform(d => ({
name: d.name,
isDeleted: d.is_deleted,
options: d.options,
}));

export const unmarshalMcpServiceUserMappedCredentialSchema: z.ZodType<McpServiceUserMappedCredential> =
Expand Down Expand Up @@ -2074,6 +2113,20 @@ export const unmarshalModelProviderServiceConfig_AzureOpenAiProviderDirectConfig
: undefined,
}));

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
export const unmarshalModelProviderServiceConfig_CustomProviderApiKeyHeaderAuthSchema: z.ZodType<ModelProviderServiceConfig_CustomProviderApiKeyHeaderAuth> =
z
.object({
api_key_name: z.string().optional(),
api_key_value: z
.lazy(() => unmarshalModelProviderServiceConfig_ProviderSecretSchema)
.optional(),
})
.transform(d => ({
apiKeyName: d.api_key_name,
apiKeyValue: d.api_key_value,
}));

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
export const unmarshalModelProviderServiceConfig_CustomProviderConfigSchema: z.ZodType<ModelProviderServiceConfig_CustomProviderConfig> =
z
Expand All @@ -2100,13 +2153,21 @@ export const unmarshalModelProviderServiceConfig_CustomProviderDirectConfigSchem
api_key: z
.lazy(() => unmarshalModelProviderServiceConfig_ProviderSecretSchema)
.optional(),
header_auth: z
.lazy(
() =>
unmarshalModelProviderServiceConfig_CustomProviderApiKeyHeaderAuthSchema
)
.optional(),
})
.transform(d => ({
baseUrl: d.base_url,
authMode:
d.api_key !== undefined
? {$case: 'apiKey' as const, apiKey: d.api_key}
: undefined,
: d.header_auth !== undefined
? {$case: 'headerAuth' as const, headerAuth: d.header_auth}
: undefined,
}));

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
Expand Down Expand Up @@ -2565,10 +2626,12 @@ export const marshalMcpServiceConfig_SourceConnectionSchema: z.ZodType = z
.object({
name: z.string().optional(),
isDeleted: z.boolean().optional(),
options: z.record(z.string(), z.string()).optional(),
})
.transform(d => ({
name: d.name,
is_deleted: d.isDeleted,
options: d.options,
}));

export const marshalMcpServiceUserMappedCredentialLoginSchema: z.ZodType = z
Expand Down Expand Up @@ -2892,6 +2955,20 @@ export const marshalModelProviderServiceConfig_AzureOpenAiProviderDirectConfigSc
}),
}));

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
export const marshalModelProviderServiceConfig_CustomProviderApiKeyHeaderAuthSchema: z.ZodType =
z
.object({
apiKeyName: z.string().optional(),
apiKeyValue: z
.lazy(() => marshalModelProviderServiceConfig_ProviderSecretSchema)
.optional(),
})
.transform(d => ({
api_key_name: d.apiKeyName,
api_key_value: d.apiKeyValue,
}));

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
export const marshalModelProviderServiceConfig_CustomProviderConfigSchema: z.ZodType =
z
Expand Down Expand Up @@ -2927,12 +3004,22 @@ export const marshalModelProviderServiceConfig_CustomProviderDirectConfigSchema:
() => marshalModelProviderServiceConfig_ProviderSecretSchema
),
}),
z.object({
$case: z.literal('headerAuth'),
headerAuth: z.lazy(
() =>
marshalModelProviderServiceConfig_CustomProviderApiKeyHeaderAuthSchema
),
}),
])
.optional(),
})
.transform(d => ({
base_url: d.baseUrl,
...(d.authMode?.$case === 'apiKey' && {api_key: d.authMode.apiKey}),
...(d.authMode?.$case === 'headerAuth' && {
header_auth: d.authMode.headerAuth,
}),
}));

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
Expand Down Expand Up @@ -3360,6 +3447,7 @@ const mcpServiceConfigFieldMaskSchema: FieldMaskSchema = {
const mcpServiceConfig_SourceConnectionFieldMaskSchema: FieldMaskSchema = {
isDeleted: {wire: 'is_deleted'},
name: {wire: 'name'},
options: {wire: 'options'},
};

const modelProviderServiceFieldMaskSchema: FieldMaskSchema = {
Expand Down Expand Up @@ -3529,6 +3617,16 @@ const modelProviderServiceConfig_AzureOpenAiProviderDirectConfigFieldMaskSchema:
},
};

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
const modelProviderServiceConfig_CustomProviderApiKeyHeaderAuthFieldMaskSchema: FieldMaskSchema =
{
apiKeyName: {wire: 'api_key_name'},
apiKeyValue: {
wire: 'api_key_value',
children: () => modelProviderServiceConfig_ProviderSecretFieldMaskSchema,
},
};

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
const modelProviderServiceConfig_CustomProviderConfigFieldMaskSchema: FieldMaskSchema =
{
Expand All @@ -3547,6 +3645,11 @@ const modelProviderServiceConfig_CustomProviderDirectConfigFieldMaskSchema: Fiel
children: () => modelProviderServiceConfig_ProviderSecretFieldMaskSchema,
},
baseUrl: {wire: 'base_url'},
headerAuth: {
wire: 'header_auth',
children: () =>
modelProviderServiceConfig_CustomProviderApiKeyHeaderAuthFieldMaskSchema,
},
};

// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
Expand Down
5 changes: 5 additions & 0 deletions packages/apps/src/v1/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,7 @@ export interface AppUpdate {
/** Maximum number of app instances. Must be set together with `compute_min_instances`. */
computeMaxInstances?: number | undefined;
gitRepository?: GitRepository | undefined;
telemetryExportDestinations?: TelemetryExportDestination[] | undefined;
/** Forward the user's access token to the app. Requires stopping and starting app compute to take effect. */
forwardUserAccessToken?: boolean | undefined;
}
Expand Down Expand Up @@ -2055,6 +2056,9 @@ export const unmarshalAppUpdateSchema: z.ZodType<AppUpdate> = z
compute_min_instances: z.number().optional(),
compute_max_instances: z.number().optional(),
git_repository: z.lazy(() => unmarshalGitRepositorySchema).optional(),
telemetry_export_destinations: z
.array(z.lazy(() => unmarshalTelemetryExportDestinationSchema))
.optional(),
forward_user_access_token: z.boolean().optional(),
})
.transform(d => ({
Expand All @@ -2068,6 +2072,7 @@ export const unmarshalAppUpdateSchema: z.ZodType<AppUpdate> = z
computeMinInstances: d.compute_min_instances,
computeMaxInstances: d.compute_max_instances,
gitRepository: d.git_repository,
telemetryExportDestinations: d.telemetry_export_destinations,
forwardUserAccessToken: d.forward_user_access_token,
}));

Expand Down
17 changes: 14 additions & 3 deletions packages/features/src/v1/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -887,13 +887,19 @@ export interface CreateStreamRequest {
export interface CronSchedule {
/**
* The cron expression defining the schedule (e.g., "0 0 * * *" for daily at midnight). The
* schedule is interpreted in the UTC time zone. Required when mode is MANUAL (or unset). Left
* empty when mode is DERIVED, where the service computes it (aligned to UTC) from the features'
* window timing and fills it in on the response.
* schedule is interpreted in timezone_id (defaults to UTC). Required when mode is MANUAL (or
* unset). Left empty when mode is DERIVED, where the service computes it (aligned to UTC) from
* the features' window timing and fills it in on the response.
*/
cronExpression?: string | undefined;
/** How the schedule is determined. Defaults to MANUAL when unset. */
mode?: CronSchedule_Mode | undefined;
/**
* A Java timezone ID. The schedule is resolved with respect to this timezone. Defaults to UTC
* when omitted. Can only be configured for MANUAL schedules; DERIVED schedules are always aligned
* to UTC.
*/
timezoneId?: string | undefined;
}

/**
Expand Down Expand Up @@ -2546,10 +2552,12 @@ export const unmarshalCronScheduleSchema: z.ZodType<CronSchedule> = z
.object({
cron_expression: z.string().optional(),
mode: z.string().optional(),
timezone_id: z.string().optional(),
})
.transform(d => ({
cronExpression: d.cron_expression,
mode: d.mode,
timezoneId: d.timezone_id,
}));

export const unmarshalCustomUdfSchema: z.ZodType<CustomUdf> = z
Expand Down Expand Up @@ -3997,10 +4005,12 @@ export const marshalCronScheduleSchema: z.ZodType = z
.object({
cronExpression: z.string().optional(),
mode: z.string().optional(),
timezoneId: z.string().optional(),
})
.transform(d => ({
cron_expression: d.cronExpression,
mode: d.mode,
timezone_id: d.timezoneId,
}));

export const marshalCustomUdfSchema: z.ZodType = z
Expand Down Expand Up @@ -5170,6 +5180,7 @@ const countFunctionFieldMaskSchema: FieldMaskSchema = {
const cronScheduleFieldMaskSchema: FieldMaskSchema = {
cronExpression: {wire: 'cron_expression'},
mode: {wire: 'mode'},
timezoneId: {wire: 'timezone_id'},
};

const customUdfFieldMaskSchema: FieldMaskSchema = {
Expand Down
Loading
Loading