Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@pontx/pinhere is generated from the Pinhere PontxSpec.

Pinhere source: https://github.com/jasonHzq/pinhere
Source revision: 576e6f7160b5bb04d5856620def23c6bd3b25082
Canonical PontxSpec SHA-256: 2a5f9d5796eefc683428b72d676dedc75f85e02b7b97f8de8c7942e66256ab5f
Source revision: 4df51d12e3a707454ffdcef310de5d1e41bbbdfe
Canonical PontxSpec SHA-256: 132d1988e36f4ecc186822b3c8a567ad30e270322d8772208675ab466a5ebe26
Pinhere is licensed under the MIT License. See its repository for the source
license and attribution.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ Type-safe Pinhere SDK and preview-first CLI generated only from Pinhere's
canonical PontxSpec.

This repository is generated from the MIT-licensed, product-owned contract in
[`jasonHzq/pinhere`](https://github.com/jasonHzq/pinhere). The source and
package are ready for public review, but npm publication remains fail-closed
until the canonical `https://pinhere.dev/.well-known/pontx.json` response is
DNS-reachable and byte-for-byte matches the pinned canonical JSON contract.
[`jasonHzq/pinhere`](https://github.com/jasonHzq/pinhere). Its canonical
production origin is
[`pinhere-jasonhzqs-projects.vercel.app`](https://pinhere-jasonhzqs-projects.vercel.app)
and it publishes the reviewed contract at
`/.well-known/pontx.json`.

## Safety boundary

Expand Down
8 changes: 4 additions & 4 deletions pontx-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"servers": [
{
"id": "production",
"url": "https://pinhere.dev/api/v1",
"description": "Pinhere 生产 API。"
"url": "https://pinhere-jasonhzqs-projects.vercel.app/api/v1",
"description": "Pinhere 生产 API(Vercel)。"
}
],
"tags": [
Expand Down Expand Up @@ -4246,8 +4246,8 @@
"description": "Chrome 扩展 OAuth 2.0 Authorization Code + PKCE。",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://pinhere.dev/extension-authorize",
"tokenUrl": "https://pinhere.dev/api/v1/oauth/token",
"authorizationUrl": "https://pinhere-jasonhzqs-projects.vercel.app/extension-authorize",
"tokenUrl": "https://pinhere-jasonhzqs-projects.vercel.app/api/v1/oauth/token",
"scopes": {
"projects:read": "读取项目并按页面 URL 解析项目。",
"issues:create": "创建缺陷。",
Expand Down
6 changes: 3 additions & 3 deletions scripts/verify-contract.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ assert.equal(spec.name, "pinhere");
assert.equal(spec.style, "RESTFul");
assert.deepEqual(spec.servers, [{
id: "production",
url: "https://pinhere.dev/api/v1",
description: "Pinhere 生产 API。",
url: "https://pinhere-jasonhzqs-projects.vercel.app/api/v1",
description: "Pinhere 生产 API(Vercel)。",
}]);
assert.equal(entries.length, 34);
assert.equal(schemas.length, 36);
Expand Down Expand Up @@ -54,7 +54,7 @@ assert.equal(spec.components.securitySchemes.pinherePat.bearerFormat, "ph_pat_*"

const actualHash = createHash("sha256").update(bytes).digest("hex");
assert.equal(actualHash, provenance.source.sha256);
assert.equal(provenance.source.commit, "576e6f7160b5bb04d5856620def23c6bd3b25082");
assert.equal(provenance.source.commit, "4df51d12e3a707454ffdcef310de5d1e41bbbdfe");
assert.equal(provenance.output.operations, 34);
assert.equal(provenance.output.schemas, 36);
assert.equal(provenance.output.proxyDisabledOperations, 34);
Expand Down
16 changes: 7 additions & 9 deletions source.provenance.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@
"kind": "product-owned-pontx-spec",
"repository": "https://github.com/jasonHzq/pinhere",
"path": "apps/web/specs/spec.pontx.json",
"commit": "576e6f7160b5bb04d5856620def23c6bd3b25082",
"url": "https://raw.githubusercontent.com/jasonHzq/pinhere/576e6f7160b5bb04d5856620def23c6bd3b25082/apps/web/specs/spec.pontx.json",
"sha256": "2a5f9d5796eefc683428b72d676dedc75f85e02b7b97f8de8c7942e66256ab5f",
"commit": "4df51d12e3a707454ffdcef310de5d1e41bbbdfe",
"url": "https://raw.githubusercontent.com/jasonHzq/pinhere/4df51d12e3a707454ffdcef310de5d1e41bbbdfe/apps/web/specs/spec.pontx.json",
"sha256": "132d1988e36f4ecc186822b3c8a567ad30e270322d8772208675ab466a5ebe26",
"license": "MIT"
},
"discovery": {
"url": "https://pinhere.dev/.well-known/pontx.json",
"status": "pending-dns-verification",
"canonicalJsonSha256": "7a98a17ca28eca19325b0aaa5b02fd54a119c1e36adcf99ea40bf1896c777d3c",
"url": "https://pinhere-jasonhzqs-projects.vercel.app/.well-known/pontx.json",
"status": "verified",
"canonicalJsonSha256": "4eb71ff51a64b1ba26a71754ccb1a00eccca33f6ab817d9828c196a007bf5b78",
"verifiedAt": "2026-08-15"
},
"output": {
"operations": 34,
"schemas": 36,
"proxyDisabledOperations": 34
},
"releaseBlockedBy": [
"pinhere.dev is attached to the production deployment but its DNS and canonical discovery bytes are not yet verified"
]
"releaseBlockedBy": []
}
8 changes: 4 additions & 4 deletions src/apis/pinhere/api-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"servers": [
{
"id": "production",
"url": "https://pinhere.dev/api/v1",
"description": "Pinhere 生产 API。"
"url": "https://pinhere-jasonhzqs-projects.vercel.app/api/v1",
"description": "Pinhere 生产 API(Vercel)。"
}
],
"tags": [
Expand Down Expand Up @@ -4246,8 +4246,8 @@
"description": "Chrome 扩展 OAuth 2.0 Authorization Code + PKCE。",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://pinhere.dev/extension-authorize",
"tokenUrl": "https://pinhere.dev/api/v1/oauth/token",
"authorizationUrl": "https://pinhere-jasonhzqs-projects.vercel.app/extension-authorize",
"tokenUrl": "https://pinhere-jasonhzqs-projects.vercel.app/api/v1/oauth/token",
"scopes": {
"projects:read": "读取项目并按页面 URL 解析项目。",
"issues:create": "创建缺陷。",
Expand Down
2 changes: 1 addition & 1 deletion src/apis/pinhere/apiMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const specMeta = {
hasTags: true,
url: [
{
url: "https://pinhere.dev/api/v1"
url: "https://pinhere-jasonhzqs-projects.vercel.app/api/v1"
}
],
apis: {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const DEFAULT_BASE_URL = "https://pinhere.dev/api/v1";
export const DEFAULT_BASE_URL = "https://pinhere-jasonhzqs-projects.vercel.app/api/v1";
export const ACCESS_TOKEN_ENV = "PINHERE_ACCESS_TOKEN";
export const SESSION_COOKIE_ENV = "PINHERE_SESSION_COOKIE";
export const BASE_URL_ENV = "PINHERE_BASE_URL";
Expand Down
4 changes: 2 additions & 2 deletions test/unit/canonical-discovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const canonicalHash = createHash("sha256").update(canonicalBytes).digest("hex");

test("verifies a canonical discovery response against the pinned source contract", async () => {
await expect(verifyCanonicalDiscovery({
url: "https://pinhere.dev/.well-known/pontx.json",
url: "https://pinhere-jasonhzqs-projects.vercel.app/.well-known/pontx.json",
sourceBytes,
expectedCanonicalJsonSha256: canonicalHash,
fetchImpl: async () => new Response(canonicalBytes, {
Expand All @@ -25,7 +25,7 @@ test("verifies a canonical discovery response against the pinned source contract

test("rejects a discovery response with noncanonical bytes", async () => {
await expect(verifyCanonicalDiscovery({
url: "https://pinhere.dev/.well-known/pontx.json",
url: "https://pinhere-jasonhzqs-projects.vercel.app/.well-known/pontx.json",
sourceBytes,
expectedCanonicalJsonSha256: canonicalHash,
fetchImpl: async () => new Response("{}", {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe("@pontx/pinhere", () => {
await expect(client.issues.listIssues({ limit: 10, status: "open" }))
.resolves.toEqual(payload);
const [url, init] = fetchMock.mock.calls[0] as [URL, RequestInit];
expect(url.toString()).toBe("https://pinhere.dev/api/v1/issues?limit=10&status=open");
expect(url.toString()).toBe("https://pinhere-jasonhzqs-projects.vercel.app/api/v1/issues?limit=10&status=open");
expect(init.method).toBe("GET");
expect(init.body).toBeUndefined();
expect(new Headers(init.headers).get("Authorization")).toBe("Bearer fixture-access-token");
Expand Down Expand Up @@ -94,7 +94,7 @@ describe("@pontx/pinhere", () => {
codeVerifier: "fixture-verifier",
});
const [url, init] = fetchMock.mock.calls[0] as [URL, RequestInit];
expect(url.toString()).toBe("https://pinhere.dev/api/v1/oauth/token");
expect(url.toString()).toBe("https://pinhere-jasonhzqs-projects.vercel.app/api/v1/oauth/token");
expect(new Headers(init.headers).has("Authorization")).toBe(false);
expect(new Headers(init.headers).has("Cookie")).toBe(false);
expect(JSON.parse(String(init.body))).toMatchObject({ grantType: "authorization_code" });
Expand Down
Loading