RtImportCallerContext
Namespace: Meshmakers.Octo.Runtime.Contracts.Exchange
Who initiated an RT import and which restrictions apply to it. RT imports run on a system session (replace semantics, creator stamping and the preserve pass stay as they are), so the identity of a user who triggered the import through the API is lost on the way through the job queue. This context carries the initiating caller into IImportRtModelCommand as a narrow flag: it adds the blueprint-lock protection and nothing else. Blueprint install/update, forced re-apply and CK-model migrations call the command without a context and are unchanged.
public record RtImportCallerContext : IEquatable<RtImportCallerContext>
Inheritance Object → RtImportCallerContext
Implements IEquatable<RtImportCallerContext>
Properties
SubjectId
Subject id of the initiating caller (user sub claim or client id). Null when the queue message
carried none (e.g. produced by an older service) — the protection is applied nevertheless.
public string SubjectId { get; set; }
Property Value
EnforceBlueprintLock
True when the import was initiated by a user or client through an API route: entities of CK types that
opted in to the blueprint-lock protection (data policy attribute ProtectBlueprintLocked) cannot
be overwritten when they are locked by a blueprint, and the blueprint bookkeeping attributes of the
file are stripped. System flows leave this false.
public bool EnforceBlueprintLock { get; set; }
Property Value
PrincipalKind
The kind of principal that initiated the import. Entities (and association edges) of a type with a
writeAccess block are refused unless this kind or RtImportCallerContext.WriteChannel is admitted by the block;
RtPrincipalKind.Unknown is refused (fail closed). Types without the block ignore it.
public RtPrincipalKind PrincipalKind { get; set; }
Property Value
WriteChannel
The trusted in-process write channel of the import, set only by service code (never from caller input), see RtSecurityContext.WriteChannel.
public string WriteChannel { get; set; }
Property Value
Constructors
RtImportCallerContext()
public RtImportCallerContext()
Methods
UserInitiated(String)
Creates the context of an import initiated by a user or client through an API route. A missing subject never turns the import into a system import: the protection is applied regardless.
public static RtImportCallerContext UserInitiated(string subjectId)
Parameters
subjectId String
Subject id of the caller, if known
Returns
UserInitiated(String, RtPrincipalKind)
Creates the context of an import initiated by a user or client through an API route whose principal kind is known.
public static RtImportCallerContext UserInitiated(string subjectId, RtPrincipalKind principalKind)
Parameters
subjectId String
Subject id of the caller, if known
principalKind RtPrincipalKind
Whether the caller is a signed-in user or a client-credentials service