IJobPrincipal
Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.
Defined in: packages/pipeline-job-context/src/interfaces/job-principal.interface.ts:13
Application port that reads the current principal when a job is enqueued and
binds it again when the job runs. The application implements it over its own
authentication state; register the implementation with
registerJobContext.
Type Parameters
Section titled “Type Parameters”TGrant
Section titled “TGrant”TGrant = unknown
The application’s grant type, as declared in @AsSystem.
Methods
Section titled “Methods”capture()
Section titled “capture()”capture():
PrincipalReference|undefined
Defined in: packages/pipeline-job-context/src/interfaces/job-principal.interface.ts:18
The principal of the current execution, or undefined when there is none.
Only id, type and sessionId of the result are kept.
Returns
Section titled “Returns”PrincipalReference | undefined
restore()
Section titled “restore()”restore<
T>(principal,work,grants?):Promise<T>
Defined in: packages/pipeline-job-context/src/interfaces/job-principal.interface.ts:30
Re-checks principal against current state and runs work with it as the
current principal. It runs inside the job’s tenant and correlation id.
Throw to refuse the job, for example for a revoked session or a deleted
principal; the job then fails without running.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”principal
Section titled “principal”() => Promise<T>
grants?
Section titled “grants?”readonly TGrant[]
Set only for @AsSystem work: the complete grants its code
declares. For a job payload it is undefined, and the principal’s
authorization must be resolved from current state.
Returns
Section titled “Returns”Promise<T>