-
Notifications
You must be signed in to change notification settings - Fork 5
Support Push based transport mode #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Fannon
wants to merge
7
commits into
main
Choose a base branch
from
ord-push-based-transport
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1f98684
Push Based Transport Proposal
Fannon 68f7c5a
Idea draft for Aggregator Config schema (will be removed later)
Fannon 46ba867
Remove ORD Aggregator Configuration for now to keep this PR clean
Fannon 699edbc
Add changelog and TODO that validation error response is not yet defined
Fannon 44365c8
Make this up to the aggregator
Fannon 6dddc33
Update docs/spec-v1/index.md
Fannon 92ea368
Update docs/spec-v1/index.md
Fannon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| --- | ||
| title: Embedded Access Strategy | ||
| description: Resource definition is embedded inline in the ORD document (push transport). | ||
| sidebar_position: 1 | ||
| --- | ||
|
|
||
| # Embedded Access Strategy | ||
|
|
||
| > **Status**: Draft Proposal (WIP) | ||
| > | ||
| > This access strategy is part of the [Push Transport](../../spec-v1/index.md#push-transport) proposal. | ||
|
|
||
| ## Description | ||
|
|
||
| The `embedded` access strategy indicates that the resource definition content is provided inline within the ORD document itself, rather than being fetched from an external URL. | ||
|
|
||
| This is specifically designed for [push transport](../../spec-v1/index.md#push-transport) scenarios where: | ||
|
|
||
| - The ORD provider pushes the complete ORD document including all resource definitions to an aggregator | ||
| - The aggregator does not need to make additional requests to fetch resource definitions | ||
| - All metadata is self-contained in a single push request | ||
|
|
||
| The `accessStrategy`.`type` value for it is: `embedded`. | ||
|
|
||
| ## How It Works | ||
|
|
||
| When a `resourceDefinition` uses the `embedded` access strategy: | ||
|
|
||
| 1. The `url` field still contains the logical path/identifier for the resource definition | ||
| 2. The actual content is provided in the document-level `definitions` property | ||
| 3. The `url` value is used as the key to look up the content in `definitions` | ||
|
|
||
| ### Example | ||
|
|
||
| ```json | ||
| { | ||
| "openResourceDiscovery": "1.15", | ||
| "apiResources": [ | ||
| { | ||
| "ordId": "sap.foo:apiResource:myApi:v1", | ||
| "resourceDefinitions": [ | ||
| { | ||
| "type": "openapi-v3", | ||
| "mediaType": "application/json", | ||
| "url": "/api/my-api/openapi.json", | ||
| "accessStrategies": [ | ||
| { | ||
| "type": "embedded" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "definitions": { | ||
| "/api/my-api/openapi.json": "{\"openapi\":\"3.0.0\",\"info\":{\"title\":\"My API\",\"version\":\"1.0.0\"},\"paths\":{}}" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Provider Implementation | ||
|
|
||
| The ORD provider MUST: | ||
|
|
||
| - Set `accessStrategies[].type` to `embedded` for any resource definition whose content is included inline | ||
| - Include the resource definition content in the top-level `definitions` property | ||
| - Use the same URL path as the key in `definitions` that is referenced in `resourceDefinitions[].url` | ||
| - Encode the content as a string (preserving original formatting) | ||
|
|
||
| ## Aggregator / Consumer Implementation | ||
|
|
||
| The ORD aggregator or consumer MUST: | ||
|
|
||
| - Recognize `embedded` as an access strategy type | ||
| - Look up the content in the `definitions` property using the `url` as the key | ||
| - NOT attempt to fetch the URL externally when `embedded` is specified | ||
| - Parse the string content according to the `mediaType` specified | ||
|
|
||
| ## When to Use | ||
|
|
||
| Use the `embedded` access strategy when: | ||
|
|
||
| - Pushing ORD documents to an aggregator (push transport) | ||
| - Integrating ORD publishing into CI/CD pipelines | ||
| - The provider cannot or does not want to host resource definitions at accessible URLs | ||
| - You want to ensure atomic updates of metadata and definitions together | ||
|
|
||
| ## Comparison with `open` | ||
|
|
||
| | Aspect | `open` | `embedded` | | ||
| |--------|--------|------------| | ||
| | Content location | External URL | Inline in document | | ||
| | Fetch required | Yes | No | | ||
| | Transport mode | Pull | Push | | ||
| | Self-contained | No | Yes | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "$schema": "https://open-resource-discovery.org/spec-v1/interfaces/Document.schema.json", | ||
| "openResourceDiscovery": "1.14", | ||
| "description": "Minimal example for push transport with inline resource definition", | ||
| "describedSystemInstance": { | ||
| "baseUrl": "https://example.com" | ||
| }, | ||
| "packages": [ | ||
| { | ||
| "ordId": "sap.example:package:push-demo:v1", | ||
| "title": "Push Transport Demo", | ||
| "shortDescription": "Demonstrates push transport with inline definitions", | ||
| "description": "This package demonstrates push transport with inline resource definitions.", | ||
| "version": "1.0.0", | ||
| "vendor": "sap:vendor:SAP:" | ||
| } | ||
| ], | ||
| "apiResources": [ | ||
| { | ||
| "ordId": "sap.example:apiResource:hello-api:v1", | ||
| "title": "Hello API", | ||
| "shortDescription": "Simple greeting API", | ||
| "description": "A simple greeting API that demonstrates push transport.", | ||
| "version": "1.0.0", | ||
| "visibility": "public", | ||
| "releaseStatus": "active", | ||
| "partOfPackage": "sap.example:package:push-demo:v1", | ||
| "apiProtocol": "rest", | ||
| "resourceDefinitions": [ | ||
| { | ||
| "type": "openapi-v3", | ||
| "mediaType": "application/json", | ||
| "url": "/api/hello/openapi.json", | ||
| "accessStrategies": [ | ||
| { | ||
| "type": "embedded" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "entryPoints": ["/api/hello"] | ||
| } | ||
| ], | ||
| "definitions": { | ||
| "/api/hello/openapi.json": "{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Hello API\",\"version\":\"1.0.0\"},\"paths\":{\"/hello\":{\"get\":{\"summary\":\"Get greeting\",\"responses\":{\"200\":{\"description\":\"A greeting message\",\"content\":{\"application/json\":{\"schema\":{\"type\":\"object\",\"properties\":{\"message\":{\"type\":\"string\"}}}}}}}}}}}" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.