No description
- Java 97.5%
- Shell 2.5%
|
All checks were successful
Build / build (push) Successful in 2m49s
## Proposal — `x-plan-decomposition` Service Plan metadata extension This PR enhances the broker schema with the **`x-plan-decomposition`** vendor extension. A Service Plan may declare the **other Service Plans it is composed of** and **how many units of each it consumes per one unit of the plan**. The extension is **generic** — the referenced plans are most commonly IaaS plans, but it is not restricted to them. The composition is *informational and platform-internal* — consumed by the platform (principally the **invoicing** module) and **not** surfaced to end users. Refs: phoenix/tenant-portal#515 ### Specification basis The extension is an extra key inside the Service Plan `metadata` object, which the specification explicitly allows: - `spec.md` § *Service Plan Object*: `metadata` is *"an opaque object of metadata … Platforms will treat this as a blob."* - `profile.md` § *Service Metadata*: *"the specification does not mandate the property names used in the `metadata` objects"* — the listed names are only **RECOMMENDED**. - `spec.md` § *Vendor Extension Fields*: a unique prefix (`x-`) reduces clashes, and receivers **MUST** ignore unknown fields. ### Shape `services[].plans[].metadata.x-plan-decomposition` ```json "metadata": { "displayName": "Chat", "bullets": ["Dedicated chat", "8 vCPU", "16 GB memory"], "x-plan-decomposition": [ { "planId": "PHOENIQS_INFRA.STORAGE", "quantity": 100 }, { "planId": "PHOENIQS_INFRA.COMPUTE_CPU", "quantity": 8 }, { "planId": "PHOENIQS_INFRA.MEMORY", "quantity": 16 } ] } ``` | Field | Type | Required | Description | |---|---|---|---| | `x-plan-decomposition` | array of objects | no | The Service Plans this plan is composed of and the units of each consumed per one unit of this plan. | | `[].planId` | string | yes | A Service Plan id (`SERVICE.PLAN` convention), e.g. `PHOENIQS_INFRA.COMPUTE_CPU`. | | `[].quantity` | number | yes | Units consumed per one unit of this plan; `> 0`; **fractional allowed**. | ### Changes - **`open-service-broker-model`** — new `PlanDecomposition` record; `ServicePlanMetadata` gains the optional `x-plan-decomposition` component and now declares its **6-arg canonical constructor explicitly** — the only way to set the extension. A backward-compatible constructor is kept, so existing positional callers (osb-core, osb-catalog, osb-maas, kvant-api, …) keep compiling. - **`open-service-broker-api`** — no production code change: the extension flows through the shared model. Integration tests added: `GET /v2/catalog` exposes the extension, and it appears in the generated OpenAPI schema. - **`docs`** — new proposal [`docs/proposals/x-plan-decomposition.md`](docs/proposals/x-plan-decomposition.md), linked from the README. ### Module impact | Module | Impact | |---|---| | `open-service-broker-model` | New `PlanDecomposition` record + `x-plan-decomposition` on `ServicePlanMetadata`. | | `open-service-broker-api` | None (shared model); integration tests assert exposure in the catalog JSON and OpenAPI. | | `open-service-broker-client` | None — the client decodes `Catalog` through the shared model and carries the extension transparently. | | `open-service-broker-schema-validator` | **Not impacted** — it validates the JSON *schemas* exposed for Service Instance / Binding parameters (`schemas.*.parameters`), not plan `metadata`. | ### Compatibility - Optional and additive: a plan that omits the key is unchanged. - Opaque container: platforms that do not know the key ignore it. - Source compatible for downstream callers (backward-compatible constructor). ### Testing `./mvnw verify` is green across all modules. New coverage: `PlanDecompositionTest` (4), `ServicePlanMetadataTest` (+2 — serialize/deserialize with the extension and fractional quantity), `CatalogResourceTest` (+2 — catalog exposure and OpenAPI documentation). Reviewed-on: #214 |
||
|---|---|---|
| .github | ||
| .mvn/wrapper | ||
| docs | ||
| open-service-broker-api | ||
| open-service-broker-client | ||
| open-service-broker-model | ||
| open-service-broker-schema-validator | ||
| scripts | ||
| .gitattributes | ||
| .gitignore | ||
| mvnw | ||
| mvnw.cmd | ||
| pom.xml | ||
| README.md | ||
open-service-broker
Introduction
This repository contains Java modules written with Quarkus framework that are used to implement a Service Broker based on the Open Service Broker API specification.
Specification
The specification of Open Service Broker API version 2.17 can be found on its
GitHub repository.
For easier reference, it has been copied to this repository;
PHOENIQS vendor extensions to the specification:
Modules
open-service-broker-api- This module contains the API endpoints from the specification
open-service-broker-client- This module contains the REST client that is used to communicate with the Service Broker
open-service-broker-model- This module contains the model classes that are used to represent the Service Broker API objects