@amerged/ohmyhost-mcp 0.1.48 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{chunk-AHSHRANX.js → chunk-MYCLNNZ7.js} +9 -9
- package/dist/index.js +1 -1
- package/dist/stdio-main.js +556 -6
- package/package.json +1 -1
- package/src/apps/mcp/package.json +1 -1
- package/src/apps/mcp/src/local-client.ts +5 -0
- package/src/apps/mcp/src/local-server.ts +308 -2
- package/src/apps/product-cli/package.json +1 -1
- package/src/apps/product-cli/src/cli.ts +22 -0
- package/src/apps/product-cli/src/command.ts +235 -0
- package/src/apps/product-cli/src/composition.ts +7 -2
- package/src/apps/product-cli/src/index.ts +1 -0
- package/src/apps/product-cli/src/native-auth.ts +172 -0
- package/src/apps/product-cli/src/product-api.ts +6 -0
- package/src/packages/agent-skills/src/generated-skill-resources.ts +8 -8
- package/src/packages/contracts/package.json +5 -0
- package/src/packages/contracts/src/framework-admission.ts +5 -0
- package/src/packages/contracts/src/framework-source-rules.ts +9 -0
- package/src/packages/contracts/src/index.ts +1 -1
- package/src/packages/contracts/src/native-auth.ts +158 -0
- package/src/packages/contracts/src/problem-policy.ts +8 -1
- package/src/packages/contracts/src/project-exports.ts +11 -3
- package/src/packages/sdk-ts/package.json +1 -1
- package/src/packages/sdk-ts/src/generated/index.ts +81 -0
- package/src/packages/sdk-ts/src/generated/sdk.gen.ts +607 -1
- package/src/packages/sdk-ts/src/generated/types.gen.ts +1071 -76
- package/src/packages/workos-auth-contracts/src/tokens.ts +22 -0
|
@@ -56,6 +56,7 @@ export interface WorkosConnectUserClaims {
|
|
|
56
56
|
readonly issuedAt: number;
|
|
57
57
|
readonly notBefore?: number;
|
|
58
58
|
readonly scopes: readonly string[];
|
|
59
|
+
readonly authorizationRestriction?: Readonly<Record<string, readonly string[]>>;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
export interface WorkosRsaJwk {
|
|
@@ -186,6 +187,26 @@ export function parseWorkosTokenClaims(
|
|
|
186
187
|
throw new WorkosContractError("invalid_consent", "Connect consent identifier is invalid");
|
|
187
188
|
}
|
|
188
189
|
const tokenId = expectString(input["jti"], "jti", { optional: true });
|
|
190
|
+
const restriction = input["ohmyhost_authorization"];
|
|
191
|
+
let authorizationRestriction: Record<string, readonly string[]> | undefined;
|
|
192
|
+
if (restriction !== undefined) {
|
|
193
|
+
const raw = expectRecord(restriction, "invalid_claim");
|
|
194
|
+
const keys = ["actions", "organizationIds", "projectIds", "mailDomainIds"];
|
|
195
|
+
authorizationRestriction = {};
|
|
196
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
197
|
+
if (
|
|
198
|
+
!keys.includes(key) ||
|
|
199
|
+
!Array.isArray(value) ||
|
|
200
|
+
value.length > 1000 ||
|
|
201
|
+
!value.every((item) => typeof item === "string" && item.length > 0 && item.length <= 128)
|
|
202
|
+
)
|
|
203
|
+
throw new WorkosContractError(
|
|
204
|
+
"invalid_claim",
|
|
205
|
+
"Token authorization restriction is invalid",
|
|
206
|
+
);
|
|
207
|
+
authorizationRestriction[key] = [...new Set(value as string[])].sort();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
189
210
|
return {
|
|
190
211
|
kind,
|
|
191
212
|
...common,
|
|
@@ -196,6 +217,7 @@ export function parseWorkosTokenClaims(
|
|
|
196
217
|
...(tokenId === undefined ? {} : { tokenId }),
|
|
197
218
|
...(notBefore === undefined ? {} : { notBefore }),
|
|
198
219
|
scopes: parseScopes(input["scope"]),
|
|
220
|
+
...(authorizationRestriction === undefined ? {} : { authorizationRestriction }),
|
|
199
221
|
};
|
|
200
222
|
}
|
|
201
223
|
if (kind === "m2m") {
|