Repository navigation
fix(openapi): align buyer contract license metadata #316
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d49d919
test(openapi): require repository license authority
seonghobae d5b2cdf
fix(openapi): align buyer seed license with repository
seonghobae ea00bfa
test(openapi): reject hard-coded buyer demo identities
seonghobae b9ea77a
Merge branch 'main' into fix/openapi-license-authority
opencode-agent[bot] deb1953
fix(openapi): remove demo identity from integration contract
seonghobae 243216f
test(openapi): parse license metadata structurally
seonghobae 82b7b38
test(openapi): leave structured license assertions to YAML parser
seonghobae 7e97ee6
test(openapi): require shipped job deletion contract
seonghobae 2b3dd03
fix(openapi): document shipped job deletion route
seonghobae 41e26e0
test(openapi): require signed artifact byte contract
seonghobae 92255da
fix(openapi): document signed artifact byte delivery
seonghobae 1e1b142
test(openapi): require shipped liveness contract
seonghobae 123dd23
fix(openapi): document protected-main liveness
seonghobae b6d79bc
test(openapi): validate delete path parameter semantics
seonghobae 5218537
Merge branch 'main' into fix/openapi-license-authority
opencode-agent[bot] 581f531
test(openapi): require artifact range and auth contract values
seonghobae 71c1e3a
fix(openapi): declare artifact Content-Range responses
seonghobae 40288d1
Merge branch 'main' into fix/openapi-license-authority
opencode-agent[bot] 3d6f646
Merge branch 'main' into fix/openapi-license-authority
opencode-agent[bot] 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,39 @@ | ||
| #!/usr/bin/env python3 | ||
| """Keep buyer OpenAPI acquisition metadata aligned with repository authority.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import unittest | ||
| from pathlib import Path | ||
|
|
||
|
|
||
| REPOSITORY_ROOT = Path(__file__).resolve().parents[1] | ||
| OPENAPI_PATH = REPOSITORY_ROOT / "docs/deployment/clearfolio-buyer-connector.openapi.yaml" | ||
| LICENSE_PATH = REPOSITORY_ROOT / "LICENSE" | ||
|
|
||
|
|
||
| class BuyerOpenApiLicenseContractTest(unittest.TestCase): | ||
| """Prevent acquisition-facing API metadata from contradicting product authority.""" | ||
|
|
||
| def test_openapi_does_not_claim_proprietary_repository_licensing(self) -> None: | ||
| """Reject the superseded proprietary-only buyer-diligence claim.""" | ||
|
|
||
| repository_license = LICENSE_PATH.read_text(encoding="utf-8") | ||
| openapi = OPENAPI_PATH.read_text(encoding="utf-8") | ||
|
|
||
| self.assertTrue(repository_license.startswith("Apache License\nVersion 2.0")) | ||
| self.assertNotIn("Proprietary - buyer diligence use only", openapi) | ||
|
seonghobae marked this conversation as resolved.
|
||
|
|
||
| def test_openapi_examples_do_not_encode_buyer_demo_identity(self) -> None: | ||
| """Keep machine-readable integration examples independent of demo authority.""" | ||
|
|
||
| openapi = OPENAPI_PATH.read_text(encoding="utf-8") | ||
|
|
||
| self.assertNotIn("buyer-demo", openapi) | ||
| self.assertNotIn("buyer-demo-operator", openapi) | ||
| self.assertIn("example: tenant-example", openapi) | ||
| self.assertIn("example: operator-example", openapi) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() | ||
42 changes: 42 additions & 0 deletions
42
src/test/java/com/clearfolio/viewer/config/BuyerOpenApiLicenseContractTest.java
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,42 @@ | ||
| package com.clearfolio.viewer.config; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
| import static org.junit.jupiter.api.Assertions.assertInstanceOf; | ||
| import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
|
||
| import java.io.IOException; | ||
| import java.io.Reader; | ||
| import java.nio.file.Files; | ||
| import java.nio.file.Path; | ||
| import java.util.Map; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
| import org.yaml.snakeyaml.Yaml; | ||
|
|
||
| /** | ||
| * Verifies acquisition-facing OpenAPI license metadata through the parsed YAML structure. | ||
| */ | ||
| class BuyerOpenApiLicenseContractTest { | ||
|
|
||
| private static final Path OPENAPI_PATH = | ||
| Path.of("docs/deployment/clearfolio-buyer-connector.openapi.yaml"); | ||
| private static final Path LICENSE_PATH = Path.of("LICENSE"); | ||
|
|
||
| @Test | ||
| void openApiLicenseObjectMatchesRepositoryAuthority() throws IOException { | ||
| String repositoryLicense = Files.readString(LICENSE_PATH); | ||
| assertTrue(repositoryLicense.startsWith("Apache License\nVersion 2.0")); | ||
|
|
||
| Object parsed; | ||
| try (Reader reader = Files.newBufferedReader(OPENAPI_PATH)) { | ||
| parsed = new Yaml().load(reader); | ||
| } | ||
|
|
||
| Map<?, ?> root = assertInstanceOf(Map.class, parsed); | ||
| Map<?, ?> info = assertInstanceOf(Map.class, root.get("info")); | ||
| Map<?, ?> license = assertInstanceOf(Map.class, info.get("license")); | ||
|
|
||
| assertEquals("Apache-2.0", license.get("name")); | ||
| assertEquals("https://www.apache.org/licenses/LICENSE-2.0.html", license.get("url")); | ||
| } | ||
| } |
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.