Merge pull request #29202 from 04kash/scaffolder-task-granular-permissions
Scaffolder task granular permissions
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
"@backstage/catalog-model": "workspace:^",
|
||||
"@backstage/errors": "workspace:^",
|
||||
"@backstage/integration": "workspace:^",
|
||||
"@backstage/plugin-permission-common": "workspace:^",
|
||||
"@backstage/plugin-scaffolder-common": "workspace:^",
|
||||
"@backstage/types": "workspace:^",
|
||||
"@isomorphic-git/pgp-plugin": "^0.0.7",
|
||||
|
||||
@@ -10,6 +10,7 @@ import { JsonObject } from '@backstage/types';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { LoggerService } from '@backstage/backend-plugin-api';
|
||||
import { Observable } from '@backstage/types';
|
||||
import { PermissionCriteria } from '@backstage/plugin-permission-common';
|
||||
import { Schema } from 'jsonschema';
|
||||
import { ScmIntegrationRegistry } from '@backstage/integration';
|
||||
import { ScmIntegrations } from '@backstage/integration';
|
||||
@@ -374,6 +375,7 @@ export interface TaskBroker {
|
||||
order: 'asc' | 'desc';
|
||||
field: string;
|
||||
}[];
|
||||
permissionFilters?: PermissionCriteria<TaskFilters>;
|
||||
}): Promise<{
|
||||
tasks: SerializedTask[];
|
||||
totalTasks?: number;
|
||||
@@ -453,6 +455,25 @@ export interface TaskContext {
|
||||
// @public
|
||||
export type TaskEventType = 'completion' | 'log' | 'cancelled' | 'recovered';
|
||||
|
||||
// @public
|
||||
export type TaskFilter = {
|
||||
key: string;
|
||||
values?: string[];
|
||||
};
|
||||
|
||||
// @public
|
||||
export type TaskFilters =
|
||||
| {
|
||||
anyOf: TaskFilter[];
|
||||
}
|
||||
| {
|
||||
allOf: TaskFilter[];
|
||||
}
|
||||
| {
|
||||
not: TaskFilter;
|
||||
}
|
||||
| TaskFilter;
|
||||
|
||||
// @public
|
||||
export type TaskSecrets = Record<string, string> & {
|
||||
backstageToken?: string;
|
||||
|
||||
@@ -18,6 +18,8 @@ export type {
|
||||
TaskSecrets,
|
||||
SerializedTask,
|
||||
SerializedTaskEvent,
|
||||
TaskFilter,
|
||||
TaskFilters,
|
||||
TaskBroker,
|
||||
TaskBrokerDispatchOptions,
|
||||
TaskBrokerDispatchResult,
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import { BackstageCredentials } from '@backstage/backend-plugin-api';
|
||||
import { PermissionCriteria } from '@backstage/plugin-permission-common';
|
||||
import { TaskSpec } from '@backstage/plugin-scaffolder-common';
|
||||
import { JsonObject, Observable } from '@backstage/types';
|
||||
import { UpdateTaskCheckpointOptions } from '@backstage/plugin-scaffolder-node/alpha';
|
||||
@@ -105,6 +106,25 @@ export type TaskBrokerDispatchOptions = {
|
||||
createdBy?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* TaskFilter
|
||||
* @public
|
||||
*/
|
||||
export type TaskFilter = {
|
||||
key: string;
|
||||
values?: string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* TaskFilters
|
||||
* @public
|
||||
*/
|
||||
export type TaskFilters =
|
||||
| { anyOf: TaskFilter[] }
|
||||
| { allOf: TaskFilter[] }
|
||||
| { not: TaskFilter }
|
||||
| TaskFilter;
|
||||
|
||||
/**
|
||||
* Task
|
||||
*
|
||||
@@ -183,6 +203,7 @@ export interface TaskBroker {
|
||||
offset?: number;
|
||||
};
|
||||
order?: { order: 'asc' | 'desc'; field: string }[];
|
||||
permissionFilters?: PermissionCriteria<TaskFilters>;
|
||||
}): Promise<{ tasks: SerializedTask[]; totalTasks?: number }>;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user