feat: Add in-memory implementations for issuer audit, key, repository, and trust management
Some checks failed
devportal-offline / build-offline (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
oas-ci / oas-validate (push) Has been cancelled
Some checks failed
devportal-offline / build-offline (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
oas-ci / oas-validate (push) Has been cancelled
- Introduced InMemoryIssuerAuditSink to retain audit entries for testing. - Implemented InMemoryIssuerKeyRepository for deterministic key storage. - Created InMemoryIssuerRepository to manage issuer records in memory. - Added InMemoryIssuerTrustRepository for managing issuer trust overrides. - Each repository utilizes concurrent collections for thread-safe operations. - Enhanced deprecation tracking with a comprehensive YAML schema for API governance.
This commit is contained in:
209
src/Api/StellaOps.Api.OpenApi/_shared/schemas/deprecation.yaml
Normal file
209
src/Api/StellaOps.Api.OpenApi/_shared/schemas/deprecation.yaml
Normal file
@@ -0,0 +1,209 @@
|
||||
# Deprecation metadata schema for OpenAPI extensions
|
||||
# Used by API Governance tools for deprecation tracking and notification workflows.
|
||||
# Per APIGOV-63-001.
|
||||
schemas:
|
||||
DeprecationMetadata:
|
||||
type: object
|
||||
description: |
|
||||
Deprecation metadata for API endpoints. Applied as x-deprecation extension
|
||||
on operation objects. Used by Spectral rules, changelog generation, and
|
||||
notification templates.
|
||||
required:
|
||||
- deprecatedAt
|
||||
- sunsetAt
|
||||
- successorPath
|
||||
- reason
|
||||
properties:
|
||||
deprecatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
description: ISO 8601 timestamp when the endpoint was marked deprecated.
|
||||
example: "2025-01-15T00:00:00Z"
|
||||
sunsetAt:
|
||||
type: string
|
||||
format: date-time
|
||||
description: ISO 8601 timestamp when the endpoint will be removed.
|
||||
example: "2025-07-15T00:00:00Z"
|
||||
successorPath:
|
||||
type: string
|
||||
description: Path to the replacement endpoint (if available).
|
||||
example: "/v2/resources"
|
||||
successorOperationId:
|
||||
type: string
|
||||
description: Operation ID of the replacement endpoint.
|
||||
example: "getResourcesV2"
|
||||
reason:
|
||||
type: string
|
||||
description: Human-readable explanation for the deprecation.
|
||||
example: "Replaced by paginated v2 endpoint with cursor-based pagination."
|
||||
migrationGuide:
|
||||
type: string
|
||||
format: uri
|
||||
description: URL to migration documentation.
|
||||
example: "https://docs.stella-ops.org/migration/resources-v2"
|
||||
notificationChannels:
|
||||
type: array
|
||||
description: Notification channels for deprecation announcements.
|
||||
items:
|
||||
type: string
|
||||
enum:
|
||||
- slack
|
||||
- teams
|
||||
- email
|
||||
- webhook
|
||||
default:
|
||||
- email
|
||||
affectedConsumerHints:
|
||||
type: array
|
||||
description: Hints about affected consumers (e.g., SDK names, client IDs).
|
||||
items:
|
||||
type: string
|
||||
breakingChanges:
|
||||
type: array
|
||||
description: List of breaking changes in the successor endpoint.
|
||||
items:
|
||||
$ref: '#/schemas/BreakingChange'
|
||||
|
||||
BreakingChange:
|
||||
type: object
|
||||
description: Description of a breaking change between deprecated and successor endpoints.
|
||||
required:
|
||||
- type
|
||||
- description
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum:
|
||||
- parameter-removed
|
||||
- parameter-renamed
|
||||
- parameter-type-changed
|
||||
- response-schema-changed
|
||||
- header-removed
|
||||
- header-renamed
|
||||
- status-code-changed
|
||||
- content-type-changed
|
||||
- authentication-changed
|
||||
description: Category of the breaking change.
|
||||
path:
|
||||
type: string
|
||||
description: JSON path to the affected element.
|
||||
example: "$.parameters[0].name"
|
||||
description:
|
||||
type: string
|
||||
description: Human-readable description of the change.
|
||||
example: "Parameter 'page' renamed to 'cursor'"
|
||||
migrationAction:
|
||||
type: string
|
||||
description: Recommended action for consumers.
|
||||
example: "Replace 'page' parameter with 'cursor' using the nextCursor value from previous response."
|
||||
|
||||
DeprecationNotificationEvent:
|
||||
type: object
|
||||
description: Event payload for deprecation notifications sent to Notify service.
|
||||
required:
|
||||
- eventId
|
||||
- eventType
|
||||
- timestamp
|
||||
- tenantId
|
||||
- deprecation
|
||||
properties:
|
||||
eventId:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Unique identifier for this notification event.
|
||||
eventType:
|
||||
type: string
|
||||
const: "api.deprecation.announced"
|
||||
description: Event type for routing in Notify service.
|
||||
timestamp:
|
||||
type: string
|
||||
format: date-time
|
||||
description: ISO 8601 timestamp when the event was generated.
|
||||
tenantId:
|
||||
type: string
|
||||
description: Tenant scope for the notification.
|
||||
deprecation:
|
||||
$ref: '#/schemas/DeprecationSummary'
|
||||
|
||||
DeprecationSummary:
|
||||
type: object
|
||||
description: Summary of a deprecated endpoint for notification purposes.
|
||||
required:
|
||||
- service
|
||||
- path
|
||||
- method
|
||||
- deprecatedAt
|
||||
- sunsetAt
|
||||
properties:
|
||||
service:
|
||||
type: string
|
||||
description: Service name owning the deprecated endpoint.
|
||||
example: "authority"
|
||||
path:
|
||||
type: string
|
||||
description: API path of the deprecated endpoint.
|
||||
example: "/v1/tokens"
|
||||
method:
|
||||
type: string
|
||||
enum:
|
||||
- GET
|
||||
- POST
|
||||
- PUT
|
||||
- PATCH
|
||||
- DELETE
|
||||
- HEAD
|
||||
- OPTIONS
|
||||
description: HTTP method of the deprecated endpoint.
|
||||
operationId:
|
||||
type: string
|
||||
description: OpenAPI operation ID.
|
||||
example: "createToken"
|
||||
deprecatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
sunsetAt:
|
||||
type: string
|
||||
format: date-time
|
||||
daysUntilSunset:
|
||||
type: integer
|
||||
description: Computed days remaining until sunset.
|
||||
example: 180
|
||||
successorPath:
|
||||
type: string
|
||||
description: Path to the replacement endpoint.
|
||||
reason:
|
||||
type: string
|
||||
description: Deprecation reason.
|
||||
migrationGuide:
|
||||
type: string
|
||||
format: uri
|
||||
changelogUrl:
|
||||
type: string
|
||||
format: uri
|
||||
description: URL to the API changelog entry for this deprecation.
|
||||
|
||||
DeprecationReport:
|
||||
type: object
|
||||
description: Aggregated report of all deprecations for changelog/SDK publishing.
|
||||
required:
|
||||
- generatedAt
|
||||
- schemaVersion
|
||||
- deprecations
|
||||
properties:
|
||||
generatedAt:
|
||||
type: string
|
||||
format: date-time
|
||||
description: When this report was generated.
|
||||
schemaVersion:
|
||||
type: string
|
||||
const: "api.deprecation.report@1"
|
||||
totalCount:
|
||||
type: integer
|
||||
description: Total number of deprecated endpoints.
|
||||
upcomingSunsets:
|
||||
type: integer
|
||||
description: Number of endpoints with sunset within 90 days.
|
||||
deprecations:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/schemas/DeprecationSummary'
|
||||
Reference in New Issue
Block a user