openapi: 3.2.0 info: title: FIAM-KPN Service Provider Contracts API description: A collection of crates for federated identity and access management license: name: '' version: 0.1.1 servers: - url: https://api-prd.kpn.com/fiam description: Server tags: - name: Service Provider Contracts description: Contract management for service providers (full CRUD operations) paths: /api/v1/service-providers/contracts: get: tags: - Service Provider Contracts operationId: list_contracts_sp parameters: - name: data_owner in: query required: false schema: type: - string - 'null' - name: service_consumer in: query required: false schema: type: - string - 'null' - name: resource_type in: query required: false schema: type: - string - 'null' responses: '200': description: List of contracts returned content: application/json: schema: $ref: '#/components/schemas/Paged_Contract' '401': description: Unauthorized client content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '403': description: Access denied content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' security: - bearer_auth: [] post: tags: - Service Provider Contracts operationId: create_contract_sp requestBody: content: application/json: schema: $ref: '#/components/schemas/NewContract' required: true responses: '201': description: Contract created successfully content: application/json: schema: $ref: '#/components/schemas/Contract' '400': description: Invalid contract data content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized client content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '403': description: Access denied content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' security: - bearer_auth: [] /api/v1/service-providers/contracts/{contract_id}: get: tags: - Service Provider Contracts operationId: get_contract_sp parameters: - name: contract_id in: path description: Contract ID required: true schema: type: string responses: '200': description: Contract details returned content: application/json: schema: $ref: '#/components/schemas/Contract' '401': description: Unauthorized client content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '403': description: Access denied content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Contract not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' security: - bearer_auth: [] put: tags: - Service Provider Contracts operationId: update_contract_sp parameters: - name: contract_id in: path description: Contract ID required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateContract' required: true responses: '200': description: Contract updated successfully content: application/json: schema: $ref: '#/components/schemas/Contract' '400': description: Invalid contract data content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '401': description: Unauthorized client content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '403': description: Access denied content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Contract not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' security: - bearer_auth: [] delete: tags: - Service Provider Contracts operationId: delete_contract_sp parameters: - name: contract_id in: path description: Contract ID required: true schema: type: string responses: '204': description: Contract deleted successfully '401': description: Unauthorized client content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '403': description: Access denied content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '404': description: Contract not found content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' '500': description: Internal server error content: application/json: schema: $ref: '#/components/schemas/ProblemDetail' security: - bearer_auth: [] components: schemas: Paged_Contract: type: object required: - page - size - page_count - total_count properties: page: type: integer format: int32 minimum: 0 page_count: type: integer format: int32 minimum: 0 records: type: - array - 'null' items: type: object required: - id - service_provider - service_consumer - data_owner - start_date - end_date - resource_type - resource - resource_attribute - action properties: action: type: string data_owner: type: string end_date: type: string format: date-time id: type: string resource: type: string resource_attribute: type: string resource_type: type: string service_consumer: type: string service_provider: type: string start_date: type: string format: date-time size: type: integer format: int32 minimum: 0 total_count: type: integer format: int32 minimum: 0 NewContract: type: object required: - data_owner - service_consumer - start_date - end_date - resource_type - resource - action properties: action: type: string description: Actions permitted (e.g., "GET", "POST", "READ", "WRITE") data_owner: type: string description: Identifier data_provider (policy issuer) end_date: type: string format: date-time description: End date for access resource: type: string description: Resource identifier this contract applies to resource_attribute: type: string description: Resource attributes this contract applies to resource_type: type: string description: Resource type (e.g., "data", "service", "api") service_consumer: type: string description: Identifier of the data consumer (access subject) start_date: type: string format: date-time description: Start date for access ProblemDetail: type: object required: - type - status properties: detail: type: - string - 'null' instance: type: - string - 'null' status: type: integer format: int32 minimum: 0 title: type: - string - 'null' type: type: string additionalProperties: {} UpdateContract: type: object required: - data_owner - service_consumer - start_date - end_date - resource_type - resource - action properties: action: type: string description: Actions permitted (e.g., "GET", "POST", "READ", "WRITE") data_owner: type: string description: Identifier data_provider (policy issuer) end_date: type: string format: date-time description: End date for access resource: type: string description: Resource identifier this contract applies to resource_attribute: type: string description: Resource attributes this contract applies to resource_type: type: string description: Resource type (e.g., "data", "service", "api") service_consumer: type: string description: Identifier of the data consumer (access subject) start_date: type: string format: date-time description: Start date for access Contract: type: object required: - id - service_provider - service_consumer - data_owner - start_date - end_date - resource_type - resource - resource_attribute - action properties: action: type: string data_owner: type: string end_date: type: string format: date-time id: type: string resource: type: string resource_attribute: type: string resource_type: type: string service_consumer: type: string service_provider: type: string start_date: type: string format: date-time securitySchemes: bearer_auth: type: http scheme: bearer bearerFormat: JWT description: JWT Bearer token obtained from /oauth/token endpoint