Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
📝 WalkthroughWalkthroughThis change introduces new OpenAPI schema definitions for common objects and standardized error responses, corrects schema reference casing for "Role" across OpenAPI files, and reformats route description strings in multiple TypeScript API route files for improved readability. Additionally, the Go OpenAPI generator consolidates the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thank you for following the naming conventions for pull request titles! 🙏 |
Graphite Automations"Notify author when CI fails" took an action on this PR • (07/30/25)1 teammate was notified to this PR based on Andreas Thomas's automation. "Post a GIF when PR approved" took an action on this PR • (07/30/25)1 gif was posted to this PR based on Andreas Thomas's automation. |
|
If we add all of these new definitions but don't remove the existing ones, we will have a bad time |
|
thats due to the merge |
|
sec |
|
mind trying again |
|
my newest commit fixes it, loads fine now you kind of have to actually generate the new spec after doing changes |
|
ok cool, ty |
There was a problem hiding this comment.
Actionable comments posted: 25
🔭 Outside diff range comments (7)
apps/api/src/routes/v1_permissions_getPermission.ts (1)
27-30: Response description says “The Role” but returns a Permission.This is misleading for SDK generators and human readers.
- description: "The Role", + description: "The Permission",apps/api/src/routes/v1_keys_removeRoles.ts (2)
115-124: Incorrect filtering – only the first delete-request is evaluatedBecause
returnis executed inside the innerfor-of, the callback exits on the firstdeleteRequest, so at most one comparison is performed perconnectedRole. Roles appearing later inreq.rolesare silently ignored.-const deleteRoles = connectedRoles.filter((cr) => { - for (const deleteRequest of req.roles) { - if ("id" in deleteRequest) { - return cr.roleId === deleteRequest.id; - } - if ("name" in deleteRequest) { - return cr.role.name === deleteRequest.name; - } - } -}); +const deleteRoles = connectedRoles.filter((cr) => + req.roles.some((del) => + "id" in del ? cr.roleId === del.id : cr.role.name === del.name, + ), +);Without this fix, attempting to remove multiple roles can leave some roles untouched, leading to confusing, partial updates.
146-152: Typo in audit-log description
"Disonnected"→"Disconnected". Minor, but shows up in customer audit trails and search queries.- description: `Disonnected ${r.roleId} and ${req.keyId}`, + description: `Disconnected ${r.roleId} and ${req.keyId}`,apps/api/src/routes/v1_ratelimits_limit.ts (1)
302-323: Computedasyncflag is ignored when calling the rate-limiterYou correctly derive
async(line 306) from an override or the request, but the value passed torateLimiter.limit(line 322) is stillreq.async. Overrides therefore never take effect.Recommend:
-const async = typeof override?.async !== "undefined" ? override.async : req.async; +const isAsync = typeof override?.async !== "undefined" ? override.async : req.async; … - identifier: [namespace.id, req.identifier, limit, duration, async].join("::"), + identifier: [namespace.id, req.identifier, limit, duration, isAsync].join("::"), … - async: req.async, + async: isAsync,Renaming the variable also avoids shadowing the reserved keyword
async.go/apps/api/openapi/spec/error/ForbiddenErrorResponse.yaml (1)
1-17: AddadditionalProperties: falsefor stricter validationAll other new schemas (e.g.,
RatelimitResponse) explicitly forbid extra fields, but error responses don’t. Omitting this leads to silent acceptance of typos / unexpected payload in error objects and breaks consistency.- Access to the requested resource is restricted based on workspace settings To resolve this error, ensure your root key has the necessary permissions or contact your workspace administrator. + +additionalProperties: falsego/apps/api/openapi/spec/error/ConflictErrorResponse.yaml (1)
1-17: Mirror validation rules used elsewhereSame concern as in
ForbiddenErrorResponse: disallowing unknown fields keeps error contracts tight.- Violating unique constraints or business rules To resolve this error, check the current state of the resource and adjust your request accordingly. + +additionalProperties: falsego/apps/api/openapi/spec/common/RatelimitRequest.yaml (1)
50-56: Forbid extra fields & stay consistent with response schema
RatelimitResponsesetsadditionalProperties: false; request schema should do the same.default: false + +additionalProperties: false
♻️ Duplicate comments (3)
apps/api/src/routes/v1_permissions_createRole.ts (1)
18-19: Same comment as earlier – duplicated deprecation textSee remark on
v1_apis_createApi.ts.apps/api/src/routes/v1_migrations_enqueueKeys.ts (1)
16-17: Duplicate deprecation-text noteSame optional refactor suggestion as in
v1_apis_createApi.ts.apps/api/src/routes/v1_permissions_listRoles.ts (1)
13-14: Duplicate deprecation-text noteSame optional refactor suggestion as in
v1_apis_createApi.ts.
go/apps/api/openapi/spec/paths/v2/permissions/listRoles/V2PermissionsListRolesResponseData.yaml
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 31
♻️ Duplicate comments (5)
go/apps/api/openapi/spec/paths/v2/keys/setRoles/V2KeysSetRolesResponseData.yaml (1)
17-17: Same uppercase-ref consistency checkThe ref was updated to
Role.yaml. Please run the same verification to catch any dangling lowercase references.apps/api/src/routes/v1_keys_whoami.ts (1)
14-15: Reuse of the same deprecation notice—see earlier comment about introducingDEPRECATED_V1_DESCRIPTION.apps/api/src/routes/v1_permissions_getPermission.ts (1)
13-14: Same duplicated deprecation notice—refer to the suggestion inv1_permissions_listPermissions.ts.apps/api/src/routes/v1_apis_getApi.ts (1)
13-14: Deprecation text duplication—covered by prior comment regarding a shared constant.apps/api/src/routes/v1_liveness.ts (1)
10-11: Deprecation message duplication—see first file for DRY refactor suggestion.
There was a problem hiding this comment.
Actionable comments posted: 24
🔭 Outside diff range comments (6)
apps/api/src/routes/v1_ratelimits_limit.ts (1)
361-367: Typo in meta payload:namespacId→namespaceIdDown-stream consumers will silently miss this field.
- meta: { - requestId: c.get("requestId"), - namespacId: namespace.id, + meta: { + requestId: c.get("requestId"), + namespaceId: namespace.id,apps/api/src/routes/v1_ratelimits_getOverride.ts (1)
79-84: Handle conflicting namespace parametersIf both
namespaceIdandnamespaceNameare provided, the current logic silently prefersnamespaceId. Explicitly rejecting this ambiguous input will prevent accidental mismatches.if (!namespaceId && !namespaceName) { throw new UnkeyApiError({ code: "BAD_REQUEST", message: "You must provide a namespaceId or a namespaceName", }); +} +if (namespaceId && namespaceName) { + throw new UnkeyApiError({ + code: "BAD_REQUEST", + message: "Provide either namespaceId or namespaceName, not both", + }); }go/apps/api/openapi/spec/common/Identity.yaml (1)
1-17: Consider locking the schema withadditionalProperties: falseUnless you intentionally allow arbitrary keys on
Identity, add the flag to keep payloads tight and predictable.type: object properties: ... required: - externalId - ratelimits +additionalProperties: falsego/apps/api/openapi/spec/error/NotFoundErrorResponse.yaml (2)
10-17: Add HTTP-status context & example for faster consumer onboardingThe schema is technically correct, but the description omits the explicit HTTP status code (404) and an example payload. A short status note + example helps SDK generators surface better docs and speeds up consumer debugging.
description: |- Error response when the requested resource cannot be found (HTTP 404). @@ To resolve this error, verify the resource ID is correct and that you have access to it. +example: + meta: + requestId: "req_123456789" + error: + title: "Not Found" + detail: "Key with id 'key_abc' does not exist" + status: 404 + type: "https://docs.unkey.dev/errors/not_found"
1-17: Usevalidate(notlint) with Redocly’s OpenAPI CLIThe Redocly CLI doesn’t support a
lintcommand—usevalidateto catch unresolved$reftargets or circular references after adding new components.Updated validation step:
# Validate entire OpenAPI document for unresolved $ref or circular refs # Requires openapi-cli; skip cloning because it needs the repo. npx -y @redocly/openapi-cli validate go/apps/api/openapi/openapi.yamlgo/apps/api/openapi/spec/error/InternalServerErrorResponse.yaml (1)
10-17: Consider supplying retry guidance viaRetry-Afterheader exampleSince the description recommends retrying, an example illustrating a
Retry-Afterheader (or note that none is returned) would remove ambiguity for API consumers.
| identity: row.identityId | ||
| ? { | ||
| id: row.identityId, | ||
| externalId: identitiesById[row.identityId]?.externalId, | ||
| } | ||
| id: row.identityId, | ||
| externalId: identitiesById[row.identityId]?.externalId, | ||
| } | ||
| : undefined, | ||
| })), |
There was a problem hiding this comment.
Possible schema violation when externalId is missing
externalId is defined as a required string in the OpenAPI response schema (Line 165-169) but can become undefined when identitiesById lacks the entry (e.g. cache miss or DB inconsistency). Serialising undefined will either drop the key (violating the schema) or break strict clients.
Diff suggesting a defensive guard:
- identity: row.identityId
- ? {
- id: row.identityId,
- externalId: identitiesById[row.identityId]?.externalId,
- }
- : undefined,
+ identity:
+ row.identityId && identitiesById[row.identityId]
+ ? {
+ id: row.identityId,
+ externalId: identitiesById[row.identityId].externalId,
+ }
+ : undefined,This ensures we only emit identity when both id and externalId are present, keeping the runtime payload consistent with the declared schema.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| identity: row.identityId | |
| ? { | |
| id: row.identityId, | |
| externalId: identitiesById[row.identityId]?.externalId, | |
| } | |
| id: row.identityId, | |
| externalId: identitiesById[row.identityId]?.externalId, | |
| } | |
| : undefined, | |
| })), | |
| identity: | |
| row.identityId && identitiesById[row.identityId] | |
| ? { | |
| id: row.identityId, | |
| externalId: identitiesById[row.identityId].externalId, | |
| } | |
| : undefined, | |
| })), |
🤖 Prompt for AI Agents
In apps/api/src/routes/v1_analytics_getVerifications.ts around lines 512 to 518,
the externalId field can be undefined if identitiesById lacks the entry, which
violates the OpenAPI schema requiring externalId as a string. To fix this, add a
defensive check to only include the identity object when both identityId and
externalId are present, otherwise set identity to undefined. This ensures the
response payload matches the declared schema and avoids runtime issues.
| tags: ["ratelimit"], | ||
| operationId: "setOverride", | ||
| summary: "Set rate limit override", | ||
| description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", | ||
| description: | ||
| "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Unify tag naming for ratelimit routes
This file uses the singular tag "ratelimit" (Line 13) while sibling routes use "ratelimits". Consider sticking to one spelling to keep the generated docs grouped consistently.
- tags: ["ratelimit"],
+ tags: ["ratelimits"],📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| tags: ["ratelimit"], | |
| operationId: "setOverride", | |
| summary: "Set rate limit override", | |
| description: "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", | |
| description: | |
| "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", | |
| tags: ["ratelimits"], | |
| operationId: "setOverride", | |
| summary: "Set rate limit override", | |
| description: | |
| "**DEPRECATED**: This API version is deprecated. Please migrate to v2. See https://www.unkey.com/docs/api-reference/v1/migration for more information.", |
🤖 Prompt for AI Agents
In apps/api/src/routes/v1_ratelimits_setOverride.ts around lines 13 to 17, the
tag used is the singular "ratelimit" while sibling routes use the plural
"ratelimits". Change the tag from "ratelimit" to "ratelimits" to unify tag
naming and ensure consistent grouping in the generated documentation.
| // Role defines model for Role. | ||
| type Role struct { | ||
| // Description Optional detailed explanation of what this role encompasses and what access it provides. | ||
| // Helps team members understand the role's scope, intended use cases, and security implications. | ||
| // Include information about what types of users should receive this role and what they can accomplish. | ||
| // Not visible to end users - this is for internal documentation and access control audits. | ||
| Description *string `json:"description,omitempty"` | ||
|
|
||
| // Id The unique identifier for this role within Unkey's system. | ||
| // Generated automatically when the role is created and used to reference this role in API operations. | ||
| // Always begins with 'role_' followed by alphanumeric characters and underscores. | ||
| Id string `json:"id"` | ||
|
|
||
| // Name The human-readable name for this role that describes its function. | ||
| // Should be descriptive enough for administrators to understand what access this role provides. | ||
| // Use clear, semantic names that reflect the job function or responsibility level. | ||
| // Names must be unique within your workspace to avoid confusion during role assignment. | ||
| Name string `json:"name"` | ||
|
|
||
| // Permissions Complete list of permissions currently assigned to this role. | ||
| // Each permission grants specific access rights that will be inherited by any keys or users assigned this role. | ||
| // Use this list to understand the full scope of access provided by this role. | ||
| // Permissions can be added or removed from roles without affecting the role's identity or other properties. | ||
| // Empty array indicates a role with no permissions currently assigned. | ||
| Permissions []Permission `json:"permissions"` | ||
| } |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Confirm there is now only ONE Role definition
Great to see the duplicate Role struct consolidated. A second definition anywhere else would break compilation, so please double-check that the old copy was fully removed.
Run once to be sure:
The command should return nothing. If it prints another location, delete the leftover struct.
🏁 Script executed:
#!/bin/bash
# Find any additional Role struct definitions.
rg --no-heading --line-number $'^type\\s+Role\\s+struct' | grep -v 'openapi/gen.go'Length of output: 133
Remove the stale Role struct in models_generated.go
The ripgrep check found a second Role definition here:
- go/pkg/db/models_generated.go:813
Please delete or consolidate this outdated struct so there’s only one Role type (in openapi/gen.go).
🤖 Prompt for AI Agents
In go/apps/api/openapi/gen.go lines 420 to 445, there is a duplicate Role struct
defined also in go/pkg/db/models_generated.go at line 813. To fix this, remove
the stale Role struct from models_generated.go to avoid duplication and ensure
only the Role struct in openapi/gen.go is used throughout the codebase.
| meta: | ||
| type: object | ||
| description: Identity metadata |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Leverage the shared Meta schema instead of an untyped object
The meta field is declared as a bare object, forfeiting the strong typing you just introduced in Meta.yaml. Re-use that definition for consistency and automatic validation.
- meta:
- type: object
- description: Identity metadata
+ meta:
+ "$ref": "./Meta.yaml"
+ description: Identity metadata🤖 Prompt for AI Agents
In go/apps/api/openapi/spec/common/Identity.yaml around lines 6 to 8, replace
the current untyped object declaration of the `meta` field with a reference to
the shared `Meta` schema defined in Meta.yaml. This involves changing the type
from a bare object to a $ref pointing to the Meta schema to ensure consistent
typing and automatic validation.
| ratelimits: | ||
| type: array | ||
| items: | ||
| "$ref": "./RatelimitResponse.yaml" | ||
| description: Identity ratelimits |
There was a problem hiding this comment.
description is mistakenly declared as a property, not a field-description
Because it’s indented at the same level as externalId, meta, and ratelimits, the parser treats description as an additional object property rather than as the description of ratelimits.
This creates an unintended description field on every Identity object and leaves ratelimits undocumented.
ratelimits:
type: array
items:
"$ref": "./RatelimitResponse.yaml"
- description: Identity ratelimits
+ description: Identity ratelimits📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ratelimits: | |
| type: array | |
| items: | |
| "$ref": "./RatelimitResponse.yaml" | |
| description: Identity ratelimits | |
| ratelimits: | |
| type: array | |
| items: | |
| "$ref": "./RatelimitResponse.yaml" | |
| description: Identity ratelimits |
🤖 Prompt for AI Agents
In go/apps/api/openapi/spec/common/Identity.yaml around lines 9 to 13, the
description for the ratelimits property is incorrectly indented as a sibling
property, causing it to be treated as a separate field. To fix this, move the
description line so it is nested under the ratelimits property, properly
associating it as the description of ratelimits rather than an independent
property of Identity.
| type: object | ||
| required: | ||
| - meta | ||
| - error | ||
| properties: | ||
| meta: | ||
| $ref: "../common/Meta.yaml" | ||
| error: | ||
| $ref: "./BaseError.yaml" |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Mirror validation strictness of other error schemas
For consistency with ForbiddenErrorResponse.yaml (and common schemas), disable extra properties.
$ref: "./BaseError.yaml"
+additionalProperties: false🤖 Prompt for AI Agents
In go/apps/api/openapi/spec/error/ConflictErrorResponse.yaml lines 1 to 9, the
schema currently allows extra properties which is inconsistent with
ForbiddenErrorResponse.yaml and other common error schemas. Add
"additionalProperties: false" at the root level of the schema to disable extra
properties and enforce strict validation.
| type: object | ||
| required: | ||
| - meta | ||
| - error | ||
| properties: | ||
| meta: | ||
| $ref: "../common/Meta.yaml" | ||
| error: | ||
| $ref: "./BaseError.yaml" |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Add additionalProperties: false for stricter validation
All other newly-added schemas (e.g. Role.yaml) explicitly disable unknown properties. Doing the same here keeps the error response shape tight and prevents accidental leakage of extra fields.
$ref: "./BaseError.yaml"
+additionalProperties: falseCommittable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In go/apps/api/openapi/spec/error/ForbiddenErrorResponse.yaml lines 1 to 9, the
schema lacks the `additionalProperties: false` setting, which is needed to
prevent unknown properties from being included in the error response. Add
`additionalProperties: false` at the root level of the schema to enforce strict
validation and disallow any properties other than those explicitly defined.
| description: |- | ||
| Error response when authentication has failed or credentials are missing. This occurs when: | ||
| - No authentication token is provided in the request | ||
| - The provided token is invalid, expired, or malformed | ||
| - The token format doesn't match expected patterns | ||
|
|
||
| To resolve this error, ensure you're including a valid root key in the Authorization header. |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Clarify credential type in description
“root key” is Unkey-specific jargon. Down-stream consumers may send bearer tokens or session cookies. Consider broadening wording or adding a concrete header example.
- To resolve this error, ensure you're including a valid root key in the Authorization header.
+ To resolve this error, include valid credentials, e.g.
+ `Authorization: Bearer <root-key|access-token>`.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| description: |- | |
| Error response when authentication has failed or credentials are missing. This occurs when: | |
| - No authentication token is provided in the request | |
| - The provided token is invalid, expired, or malformed | |
| - The token format doesn't match expected patterns | |
| To resolve this error, ensure you're including a valid root key in the Authorization header. | |
| description: |- | |
| Error response when authentication has failed or credentials are missing. This occurs when: | |
| - No authentication token is provided in the request | |
| - The provided token is invalid, expired, or malformed | |
| - The token format doesn't match expected patterns | |
| To resolve this error, include valid credentials, e.g. | |
| `Authorization: Bearer <root-key|access-token>`. |
🤖 Prompt for AI Agents
In go/apps/api/openapi/spec/error/UnauthorizedErrorResponse.yaml around lines 10
to 16, the description uses the term "root key," which is unclear to downstream
consumers. Update the description to use more general terms like "valid
authentication credentials" and provide a concrete example, such as including a
valid token in the Authorization header (e.g., Bearer token), to clarify the
expected credential type.
| additionalProperties: false | ||
| properties: | ||
| location: | ||
| description: |- | ||
| JSON path indicating exactly where in the request the error occurred. This helps pinpoint the problematic field or parameter. Examples include: | ||
| - 'body.name' (field in request body) | ||
| - 'body.items[3].tags' (nested array element) | ||
| - 'path.apiId' (path parameter) | ||
| - 'query.limit' (query parameter) | ||
| Use this location to identify exactly which part of your request needs correction. | ||
| type: string | ||
| example: body.permissions[0].name | ||
| message: | ||
| description: Detailed error message explaining what validation rule was | ||
| violated. This provides specific information about why the field or parameter | ||
| was rejected, such as format errors, invalid values, or constraint violations. | ||
| type: string | ||
| example: Must be at least 3 characters long | ||
| fix: | ||
| description: A human-readable suggestion describing how to fix the error. | ||
| This provides practical guidance on what changes would satisfy the validation | ||
| requirements. Not all validation errors include fix suggestions, but when | ||
| present, they offer specific remediation advice. | ||
| type: string | ||
| example: Ensure the name uses only alphanumeric characters, underscores, | ||
| and hyphens | ||
| required: | ||
| - location | ||
| - message | ||
| type: object | ||
| description: | ||
| Individual validation error details. Each validation error provides | ||
| precise information about what failed, where it failed, and how to fix it, | ||
| enabling efficient error resolution. No newline at end of file |
There was a problem hiding this comment.
Add missing newline at EOF to satisfy YAML linting
yamllint fails with new-line-at-end-of-file. CI will break until a trailing newline is present.
enabling efficient error resolution.
+📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| additionalProperties: false | |
| properties: | |
| location: | |
| description: |- | |
| JSON path indicating exactly where in the request the error occurred. This helps pinpoint the problematic field or parameter. Examples include: | |
| - 'body.name' (field in request body) | |
| - 'body.items[3].tags' (nested array element) | |
| - 'path.apiId' (path parameter) | |
| - 'query.limit' (query parameter) | |
| Use this location to identify exactly which part of your request needs correction. | |
| type: string | |
| example: body.permissions[0].name | |
| message: | |
| description: Detailed error message explaining what validation rule was | |
| violated. This provides specific information about why the field or parameter | |
| was rejected, such as format errors, invalid values, or constraint violations. | |
| type: string | |
| example: Must be at least 3 characters long | |
| fix: | |
| description: A human-readable suggestion describing how to fix the error. | |
| This provides practical guidance on what changes would satisfy the validation | |
| requirements. Not all validation errors include fix suggestions, but when | |
| present, they offer specific remediation advice. | |
| type: string | |
| example: Ensure the name uses only alphanumeric characters, underscores, | |
| and hyphens | |
| required: | |
| - location | |
| - message | |
| type: object | |
| description: | |
| Individual validation error details. Each validation error provides | |
| precise information about what failed, where it failed, and how to fix it, | |
| enabling efficient error resolution. | |
| enabling efficient error resolution. | |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 34-34: no new line character at the end of file
(new-line-at-end-of-file)
🤖 Prompt for AI Agents
In go/apps/api/openapi/spec/error/ValidationError.yaml at the end of the file
(line 34), add a newline character after the last line to satisfy YAML linting
rules and prevent CI failures due to missing EOF newline.
| location: | ||
| description: |- | ||
| JSON path indicating exactly where in the request the error occurred. This helps pinpoint the problematic field or parameter. Examples include: | ||
| - 'body.name' (field in request body) | ||
| - 'body.items[3].tags' (nested array element) | ||
| - 'path.apiId' (path parameter) | ||
| - 'query.limit' (query parameter) | ||
| Use this location to identify exactly which part of your request needs correction. | ||
| type: string | ||
| example: body.permissions[0].name |
There was a problem hiding this comment.
🧹 Nitpick (assertive)
Consider constraining location with a pattern
A simple pattern such as ^(body|path|query)\.[A-Za-z0-9_.[\]]+$ would prevent impossible paths and catch typos early.
🤖 Prompt for AI Agents
In go/apps/api/openapi/spec/error/ValidationError.yaml around lines 3 to 12, the
'location' field currently accepts any string, which may allow invalid or
impossible JSON paths. To fix this, add a pattern constraint to the 'location'
property using a regex like ^(body|path|query)\.[A-Za-z0-9_.[\]]+$ to ensure
only valid paths starting with 'body', 'path', or 'query' followed by valid
characters are accepted. This will help catch typos and invalid paths early.
* Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * almost * re ordered badge list collapse * undo rabbit * [autofix.ci] apply automated fixes * fix scroll * changes before merge * chore: deprecate v1 endpoints (#3680) * fix: openapi * chore: deprecate v1 endpoints * fix: vault credentials and chproxy config (#3681) * fix: openapi * fix: vault credentials and chproxy config * fix: rename flag accessor too * fix: linter issues * fix: some more v2 api changes (#3677) * remove namespaceID * actually use limit and cursor * filter out delted overrides * fix error messages list endpoints * fix more error messages * ensure identity create handles like permission/role create * fix regex for roles * fix regex for roles * fix list keys cursor * fix: uppercase common files (#3683) * name files uppercase * name files uppercase * [autofix.ci] apply automated fixes * name files uppercase * name files uppercase --------- Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: conflicting casing (#3689) * fix the openapi spec again (#3692) * dont trace chproxy endpoints (#3691) * fix: log verifications to the owning workspace (#3693) * functioning again * style change * more tweaks * fix: validate s3 config (#3694) * Fix all the fucking things * remove close button * fmt * fix: speakeasy ignore directive is ignored if it's a string (#3699) * fix: upsert permissions with slug or name colission (#3696) * fix: upsert permissions with slug or name colission * chore: also remove index * fix permission test and remove unnnecessary test --------- Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com> * docs: migration (#3678) * fix: openapi * docs: migration from v1 to v2 * fix: remove binaries * [autofix.ci] apply automated fixes * docs: add james' feedback --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: api list keys zod errors (#3702) * fix api zod errors * [autofix.ci] apply automated fixes * make array handling uniform * make array handling uniform * fix rabbi comment * fix: permission array for roles --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * ci: don't build for windows and freebsd (#3700) * docs: errors (#3703) * chore: move sdks to unkeyed/sdks (#3701) * fix: omitting array vs null (#3704) * fix omitting array vs null * [autofix.ci] apply automated fixes * fix flakey test * fix flakey test --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: panics not being catched (#3706) * fix panics not being catched * feat: add counter to track panics Signed-off-by: Ian Meyer <k@imeyer.io> --------- Signed-off-by: Ian Meyer <k@imeyer.io> Co-authored-by: Ian Meyer <k@imeyer.io> * docs: use `CodeGroup` in hono/nextjs TS libraries (#3708) * Update hono.mdx * Update nextjs.mdx * ci: remove outdated steps and flows (#3709) * docs: update sdks (#3712) * docs: update sdks * Update nextjs.mdx * [autofix.ci] apply automated fixes * fix: rabbit feedback * Update nextjs.mdx * fix: root key is required --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * dialog and confirm added * feat(deployment beta): projects UI for Unkey Deploy (#3662) * projects and branches * wip * wip * spec differ wip * fix some docker, add some trpc, integrate diff viewer * change version to deployments, add feature flag, update go schema * update versions page * fix null condition * delete old router, fix null assertion * fmt * fmt * fmt again * apply auth and feature flagging access to projects, remove versions * yolo * stable yolo * stable yolo * style: fmt * fix: hardcode time, so it doesn't fail on the first of a month * [autofix.ci] apply automated fixes --------- Co-authored-by: chronark <dev@chronark.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * chore: add missingd delete endpoint for v2 (#3711) * only log key at the end (#3716) * fix: allow wildcard and colon in permissions query (#3717) * remove regex for permissions * allow for asterix and colon in permissions * fix: update identity by identity key instead of externalId and fix wrong body for permission and role (#3713) * docs and remove externalId from keyResponse * fix updateIdentity to take in an identity parameter instead of an externalId * fix get role/permission * Update go/apps/api/openapi/spec/common/Permission.yaml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update openapi-generated.yaml * fix comment --------- Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: openapi references (#3723) * feat: add paginated tRPC endpoint for projects (#3697) * feat: add new endpoint for deploy projects * chore: replace file path * [autofix.ci] apply automated fixes * feat: add missing endpoint * fix: trpc path * fix: add feature flag * chore: remove optin --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: region not showing and wrong rl id (#3722) * fix: region not showing and wrong rl id * pass region down * perf: bad get key performance (#3724) * perf: make getKey 2 seperate queries so mysql chooses correct idx * fix query * fix query name * docs: verify identities endpoints (#3727) * chore: docs (#3728) * chore: fixup migration guide * adjust more * adjust more * adjust more * rabbit comments * Update index.mdx * working updates * re factor for clarity * only update if diff than existing * [autofix.ci] apply automated fixes * re name create-root-key to root-key folder --------- Signed-off-by: Ian Meyer <k@imeyer.io> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com> Co-authored-by: Oğuzhan Olguncu <21091016+ogzhanolguncu@users.noreply.github.com> Co-authored-by: James Perkins <jamesperkins@hey.com> Co-authored-by: Ian Meyer <k@imeyer.io> Co-authored-by: JA Castro <51177379+ubinatus@users.noreply.github.com> Co-authored-by: Meg Stepp <mcstepp@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* chore: new root key dialog (#3637) * Dialog created * small changes * feat: ui show permission side bar when select permission button is (#3654) * Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * feat: UI when a permission is selected it should show in the modal (#3663) * Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * almost * re ordered badge list collapse * undo rabbit * [autofix.ci] apply automated fixes * fix scroll * button size and margin --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: UI when a user searches for a permission it should show (#3695) * Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * almost * re ordered badge list collapse * undo rabbit * [autofix.ci] apply automated fixes * fix scroll * changes before merge * functioning again * style change * more tweaks * Fix all the fucking things * remove close button * fmt --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: James Perkins <jamesperkins@hey.com> * feat: rootkey create with success dialog and confirm close (#3714) * Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * almost * re ordered badge list collapse * undo rabbit * [autofix.ci] apply automated fixes * fix scroll * changes before merge * functioning again * style change * more tweaks * Fix all the fucking things * remove close button * fmt * dialog and confirm added --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: James Perkins <jamesperkins@hey.com> * feat: a user selects edit root key and an edit root key modal (#3731) * Dialog created * small changes * half functional * small spacing changes and chevron * Rabbit Changes * remove useffect * almost * re ordered badge list collapse * undo rabbit * [autofix.ci] apply automated fixes * fix scroll * changes before merge * chore: deprecate v1 endpoints (#3680) * fix: openapi * chore: deprecate v1 endpoints * fix: vault credentials and chproxy config (#3681) * fix: openapi * fix: vault credentials and chproxy config * fix: rename flag accessor too * fix: linter issues * fix: some more v2 api changes (#3677) * remove namespaceID * actually use limit and cursor * filter out delted overrides * fix error messages list endpoints * fix more error messages * ensure identity create handles like permission/role create * fix regex for roles * fix regex for roles * fix list keys cursor * fix: uppercase common files (#3683) * name files uppercase * name files uppercase * [autofix.ci] apply automated fixes * name files uppercase * name files uppercase --------- Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: conflicting casing (#3689) * fix the openapi spec again (#3692) * dont trace chproxy endpoints (#3691) * fix: log verifications to the owning workspace (#3693) * functioning again * style change * more tweaks * fix: validate s3 config (#3694) * Fix all the fucking things * remove close button * fmt * fix: speakeasy ignore directive is ignored if it's a string (#3699) * fix: upsert permissions with slug or name colission (#3696) * fix: upsert permissions with slug or name colission * chore: also remove index * fix permission test and remove unnnecessary test --------- Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com> * docs: migration (#3678) * fix: openapi * docs: migration from v1 to v2 * fix: remove binaries * [autofix.ci] apply automated fixes * docs: add james' feedback --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: api list keys zod errors (#3702) * fix api zod errors * [autofix.ci] apply automated fixes * make array handling uniform * make array handling uniform * fix rabbi comment * fix: permission array for roles --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * ci: don't build for windows and freebsd (#3700) * docs: errors (#3703) * chore: move sdks to unkeyed/sdks (#3701) * fix: omitting array vs null (#3704) * fix omitting array vs null * [autofix.ci] apply automated fixes * fix flakey test * fix flakey test --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: panics not being catched (#3706) * fix panics not being catched * feat: add counter to track panics Signed-off-by: Ian Meyer <k@imeyer.io> --------- Signed-off-by: Ian Meyer <k@imeyer.io> Co-authored-by: Ian Meyer <k@imeyer.io> * docs: use `CodeGroup` in hono/nextjs TS libraries (#3708) * Update hono.mdx * Update nextjs.mdx * ci: remove outdated steps and flows (#3709) * docs: update sdks (#3712) * docs: update sdks * Update nextjs.mdx * [autofix.ci] apply automated fixes * fix: rabbit feedback * Update nextjs.mdx * fix: root key is required --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * dialog and confirm added * feat(deployment beta): projects UI for Unkey Deploy (#3662) * projects and branches * wip * wip * spec differ wip * fix some docker, add some trpc, integrate diff viewer * change version to deployments, add feature flag, update go schema * update versions page * fix null condition * delete old router, fix null assertion * fmt * fmt * fmt again * apply auth and feature flagging access to projects, remove versions * yolo * stable yolo * stable yolo * style: fmt * fix: hardcode time, so it doesn't fail on the first of a month * [autofix.ci] apply automated fixes --------- Co-authored-by: chronark <dev@chronark.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * chore: add missingd delete endpoint for v2 (#3711) * only log key at the end (#3716) * fix: allow wildcard and colon in permissions query (#3717) * remove regex for permissions * allow for asterix and colon in permissions * fix: update identity by identity key instead of externalId and fix wrong body for permission and role (#3713) * docs and remove externalId from keyResponse * fix updateIdentity to take in an identity parameter instead of an externalId * fix get role/permission * Update go/apps/api/openapi/spec/common/Permission.yaml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update openapi-generated.yaml * fix comment --------- Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: openapi references (#3723) * feat: add paginated tRPC endpoint for projects (#3697) * feat: add new endpoint for deploy projects * chore: replace file path * [autofix.ci] apply automated fixes * feat: add missing endpoint * fix: trpc path * fix: add feature flag * chore: remove optin --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix: region not showing and wrong rl id (#3722) * fix: region not showing and wrong rl id * pass region down * perf: bad get key performance (#3724) * perf: make getKey 2 seperate queries so mysql chooses correct idx * fix query * fix query name * docs: verify identities endpoints (#3727) * chore: docs (#3728) * chore: fixup migration guide * adjust more * adjust more * adjust more * rabbit comments * Update index.mdx * working updates * re factor for clarity * only update if diff than existing * [autofix.ci] apply automated fixes * re name create-root-key to root-key folder --------- Signed-off-by: Ian Meyer <k@imeyer.io> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com> Co-authored-by: Oğuzhan Olguncu <21091016+ogzhanolguncu@users.noreply.github.com> Co-authored-by: James Perkins <jamesperkins@hey.com> Co-authored-by: Ian Meyer <k@imeyer.io> Co-authored-by: JA Castro <51177379+ubinatus@users.noreply.github.com> Co-authored-by: Meg Stepp <mcstepp@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fresh * start rabbit changes * rabbits * missing processing * Update apps/dashboard/lib/trpc/routers/index.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update apps/dashboard/app/(app)/settings/root-keys/components/root-key/components/permission-badge-list.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * more rabbit * function name * [autofix.ci] apply automated fixes * minor changes * rabbit checked locally * comment changes * light mode fix * removed old page files * updated success * slack comment changes * cleanup * rabbit * more rabbits * most consts * change clear and details * cleanup * pr suggested changes * few nits --------- Signed-off-by: Ian Meyer <k@imeyer.io> Co-authored-by: CodeReaper <148160799+MichaelUnkey@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Andreas Thomas <dev@chronark.com> Co-authored-by: Flo <53355483+Flo4604@users.noreply.github.com> Co-authored-by: Oğuzhan Olguncu <21091016+ogzhanolguncu@users.noreply.github.com> Co-authored-by: Ian Meyer <k@imeyer.io> Co-authored-by: JA Castro <51177379+ubinatus@users.noreply.github.com> Co-authored-by: Meg Stepp <mcstepp@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: MichaelUnkey <michael@unkey.com>


What does this PR do?
Renames all the common files to uppercase instead of having mixed cases...
Fixes # (issue)
If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists
Type of change
How should this be tested?
Checklist
Required
pnpm buildpnpm fmtconsole.logsgit pull origin mainAppreciated
Summary by CodeRabbit
New Features
Documentation
Style