Skip to content

SecurityEntityAttributes

A custom System.Attribute used to annotate certificate-related types or members with the set of security resource names (drawn from SecurityResources) that govern access to them, letting a consumer (e.g. a security/authorization scanner) discover which permission checks apply to a given entity by reflection rather than by hardcoded lookup tables.*

Purpose

  • Carries an array of security resource names (SecurityResourceNames) associated with the attributed entity.
  • Provides a constructor-based way to assign the resource-name array at the point of attribution.

Context

  • Namespace: SAIF.Services.Policies.Certificates
  • Assembly/package: SAIF.Services (packaged inside the SAIF.SAIFCode.Core NuGet package).

Public members

Member Signature Purpose
SecurityEntityAttributes (constructor) public SecurityEntityAttributes(string[] securityResourceNames) Initializes the attribute instance with the array of security resource names that apply to the attributed entity.
SecurityResourceNames public string[] SecurityResourceNames { get; set; } The set of security resource name strings (typically values from SecurityResources) that govern access to the attributed entity.

Behavioral notes

  • The class does not restrict its usage target (no [AttributeUsage] is applied), and it is not sealed; both are flagged by suppressed code-analysis rules (CA1018:MarkAttributesWithAttributeUsage, CA1813:AvoidUnsealedAttributes), indicating these are known, accepted deviations rather than oversights.*
  • CA1019:DefineAccessorsForAttributeArguments is also suppressed even though SecurityResourceNames does expose a public accessor, suggesting the analyzer flagged the array-typed property specifically (arrays are mutable, which analyzers generally discourage for attribute arguments).*

Constraints and usage notes

  • Because SecurityResourceNames is a settable array property, callers holding a reference to an attribute instance can mutate the array after construction; there is no defensive copy.*

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • Services/SAIF.Services/Policies/Certificates/SecurityResources.cs