Skip to content

Commit 09cb289

Browse files
fix(server): address runtime auth review feedback
1 parent 1e7f59a commit 09cb289

18 files changed

Lines changed: 102 additions & 100 deletions

sdks/typescript/src/generated/funcs/auth-runtime-token-exchange.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ import { Result } from "../types/fp.js";
3232
* @remarks
3333
* Mint a short-lived runtime token for the requested target.
3434
*
35-
* The caller's credential is authenticated and authorized by the
36-
* installed default authorizer; the resulting :class:`Principal`
37-
* supplies the actor identity and (when the upstream surfaces it)
38-
* the grant scopes and expiry. This endpoint then mints a local HS256
39-
* token whose lifetime cannot outlive the upstream grant.
35+
* The caller's credential is authenticated and authorized before a
36+
* :class:`Principal` supplies the actor identity, grant scopes, and
37+
* expiry. This endpoint then mints a local HS256 token whose lifetime
38+
* cannot outlive the grant.
4039
*
4140
* Runtime auth must be enabled via
4241
* ``AGENT_CONTROL_RUNTIME_TOKEN_SECRET``; otherwise the endpoint

sdks/typescript/src/generated/funcs/control-bindings-create.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import { Result } from "../types/fp.js";
3232
* @remarks
3333
* Attach a control to an opaque external target.
3434
*
35-
* Each binding row is scoped to the request namespace as resolved by
36-
* the active authorizer.
35+
* Each binding row is scoped to the namespace associated with the
36+
* authenticated request.
3737
*/
3838
export function controlBindingsCreate(
3939
client: AgentControlSDKCore,

sdks/typescript/src/generated/funcs/control-bindings-delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { Result } from "../types/fp.js";
3636
* See the GET-by-id docstring for the authorization scope: this route
3737
* is namespace-wide because the target identifiers are not available
3838
* before the binding is loaded. Use ``POST /by-key:delete`` for
39-
* target-scoped detach that forwards the target to the authorizer.
39+
* target-scoped detach that includes the target in the request context.
4040
*/
4141
export function controlBindingsDelete(
4242
client: AgentControlSDKCore,

sdks/typescript/src/generated/funcs/control-bindings-get.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ import { Result } from "../types/fp.js";
3434
* Read a single control binding by surrogate ID.
3535
*
3636
* Authorization is namespace-wide: the binding's target identifiers
37-
* are not forwarded to the upstream because they are only discoverable
38-
* after the row is loaded, and ``require_operation`` is single-pass.
37+
* are not available until after the row is loaded.
3938
* Callers whose authorization model requires per-target permissions
4039
* should use the natural-key endpoints (``PUT /by-key``,
4140
* ``POST /by-key:delete``) and the target-filtered list endpoint, all
42-
* of which forward ``(target_type, target_id)`` to the authorizer.
41+
* of which include ``(target_type, target_id)`` in the request context.
4342
*/
4443
export function controlBindingsGet(
4544
client: AgentControlSDKCore,

sdks/typescript/src/generated/funcs/control-bindings-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { Result } from "../types/fp.js";
3535
* cursor-based pagination. Bindings are ordered by ID descending
3636
* (newest first). The cursor is opaque to clients: pass back the
3737
* ``next_cursor`` value verbatim to fetch the following page. The
38-
* storage namespace is resolved by the active authorizer.
38+
* storage namespace is resolved from the authenticated request.
3939
*/
4040
export function controlBindingsList(
4141
client: AgentControlSDKCore,

sdks/typescript/src/generated/funcs/control-bindings-update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { Result } from "../types/fp.js";
3636
* See the GET-by-id docstring for the authorization scope: this route
3737
* is namespace-wide because the target identifiers are not available
3838
* before the binding is loaded. Use ``PUT /by-key`` for target-scoped
39-
* upserts that forward the target to the authorizer.
39+
* upserts that include the target in the request context.
4040
*/
4141
export function controlBindingsUpdate(
4242
client: AgentControlSDKCore,

sdks/typescript/src/generated/sdk/auth.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ export class Auth extends ClientSDK {
1414
* @remarks
1515
* Mint a short-lived runtime token for the requested target.
1616
*
17-
* The caller's credential is authenticated and authorized by the
18-
* installed default authorizer; the resulting :class:`Principal`
19-
* supplies the actor identity and (when the upstream surfaces it)
20-
* the grant scopes and expiry. This endpoint then mints a local HS256
21-
* token whose lifetime cannot outlive the upstream grant.
17+
* The caller's credential is authenticated and authorized before a
18+
* :class:`Principal` supplies the actor identity, grant scopes, and
19+
* expiry. This endpoint then mints a local HS256 token whose lifetime
20+
* cannot outlive the grant.
2221
*
2322
* Runtime auth must be enabled via
2423
* ``AGENT_CONTROL_RUNTIME_TOKEN_SECRET``; otherwise the endpoint

sdks/typescript/src/generated/sdk/control-bindings.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class ControlBindings extends ClientSDK {
2323
* cursor-based pagination. Bindings are ordered by ID descending
2424
* (newest first). The cursor is opaque to clients: pass back the
2525
* ``next_cursor`` value verbatim to fetch the following page. The
26-
* storage namespace is resolved by the active authorizer.
26+
* storage namespace is resolved from the authenticated request.
2727
*/
2828
async list(
2929
request?:
@@ -44,8 +44,8 @@ export class ControlBindings extends ClientSDK {
4444
* @remarks
4545
* Attach a control to an opaque external target.
4646
*
47-
* Each binding row is scoped to the request namespace as resolved by
48-
* the active authorizer.
47+
* Each binding row is scoped to the namespace associated with the
48+
* authenticated request.
4949
*/
5050
async create(
5151
request: models.CreateControlBindingRequest,
@@ -104,7 +104,7 @@ export class ControlBindings extends ClientSDK {
104104
* See the GET-by-id docstring for the authorization scope: this route
105105
* is namespace-wide because the target identifiers are not available
106106
* before the binding is loaded. Use ``POST /by-key:delete`` for
107-
* target-scoped detach that forwards the target to the authorizer.
107+
* target-scoped detach that includes the target in the request context.
108108
*/
109109
async delete(
110110
request:
@@ -125,12 +125,11 @@ export class ControlBindings extends ClientSDK {
125125
* Read a single control binding by surrogate ID.
126126
*
127127
* Authorization is namespace-wide: the binding's target identifiers
128-
* are not forwarded to the upstream because they are only discoverable
129-
* after the row is loaded, and ``require_operation`` is single-pass.
128+
* are not available until after the row is loaded.
130129
* Callers whose authorization model requires per-target permissions
131130
* should use the natural-key endpoints (``PUT /by-key``,
132131
* ``POST /by-key:delete``) and the target-filtered list endpoint, all
133-
* of which forward ``(target_type, target_id)`` to the authorizer.
132+
* of which include ``(target_type, target_id)`` in the request context.
134133
*/
135134
async get(
136135
request:
@@ -153,7 +152,7 @@ export class ControlBindings extends ClientSDK {
153152
* See the GET-by-id docstring for the authorization scope: this route
154153
* is namespace-wide because the target identifiers are not available
155154
* before the binding is loaded. Use ``PUT /by-key`` for target-scoped
156-
* upserts that forward the target to the authorizer.
155+
* upserts that include the target in the request context.
157156
*/
158157
async update(
159158
request:

server/src/agent_control_server/auth_framework/core.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ class Operation(StrEnum):
5252
POLICIES_READ = "policies.read"
5353
POLICIES_CREATE = "policies.create"
5454
POLICIES_UPDATE = "policies.update"
55-
POLICIES_DELETE = "policies.delete"
5655
AGENTS_READ = "agents.read"
5756
AGENTS_CREATE = "agents.create"
5857
AGENTS_UPDATE = "agents.update"
59-
AGENTS_DELETE = "agents.delete"
6058
RUNTIME_USE = "runtime.use"
6159

6260

server/src/agent_control_server/auth_framework/providers/header.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,9 @@ class AccessLevel(Enum):
4545
Operation.POLICIES_READ: AccessLevel.AUTHENTICATED,
4646
Operation.POLICIES_CREATE: AccessLevel.ADMIN,
4747
Operation.POLICIES_UPDATE: AccessLevel.ADMIN,
48-
Operation.POLICIES_DELETE: AccessLevel.ADMIN,
4948
Operation.AGENTS_READ: AccessLevel.AUTHENTICATED,
5049
Operation.AGENTS_CREATE: AccessLevel.AUTHENTICATED,
5150
Operation.AGENTS_UPDATE: AccessLevel.ADMIN,
52-
Operation.AGENTS_DELETE: AccessLevel.ADMIN,
5351
Operation.RUNTIME_TOKEN_EXCHANGE: AccessLevel.AUTHENTICATED,
5452
Operation.RUNTIME_USE: AccessLevel.AUTHENTICATED,
5553
}

0 commit comments

Comments
 (0)