mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
fix: add a Default agent permission choice and stop forwarding cookies to OpenCode (OM-179)
Each agent permission select now offers Default, shown when the agent has no wildcard rule for the action. Choosing Allow, Ask or Deny writes an agent rule even when it matches the inherited effect; choosing Default removes the agent's wildcard rules so the global permission applies. The local OpenCode proxy drops the browser's Cookie header, as the linked-server proxy already does.
This commit is contained in:
1 parent
38d618be9b
commit
670c66f85b
4 files changed
+64
-24
No files matched your search
@@ -6,6 +6,8 @@ import { forwardProxyRequest } from '../../utils/proxy-forward'
|
||||
import { getOpenCodeBasicAuthHeader, type OpenCodePasswordResolver } from './auth'
|
||||
import { getOpenCodeUpstreamBaseUrl, withDefaultOpenCodeDirectory } from './upstream'
|
||||
|
||||
const FORWARD_EXCLUDED_HEADERS: ReadonlySet<string> = new Set(['cookie'])
|
||||
|
||||
export interface OpenCodeClient {
|
||||
readonly api: OpenCodeApi
|
||||
forwardRaw(request: Request): Promise<Response>
|
||||
@@ -65,7 +67,7 @@ export class FetchOpenCodeClient implements OpenCodeClient {
|
||||
async forwardRaw(request: Request): Promise<Response> {
|
||||
const url = new URL(request.url)
|
||||
const path = url.pathname.replace(/^\/api\/opencode/, '') + url.search
|
||||
const headers = this.withDirectoryHeader(filterProxyHeaders(request.headers))
|
||||
const headers = this.withDirectoryHeader(filterProxyHeaders(request.headers, FORWARD_EXCLUDED_HEADERS))
|
||||
const basicAuth = await this.getBasicAuth()
|
||||
|
||||
if (basicAuth) {
|
||||
|
||||
Reference in new issue
Block a user