@sparkelf/dsh-patch-browser-auth-mode 0.2.1-alpha.2 → 0.2.1-alpha.21

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/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "file": "./patches/browser-auth-mode.patch",
9
9
  "id": "browser-authentication-policy-mode",
10
10
  "target": {
11
- "baseRevision": "5badb15009ae1756c3afe0ae0cef1faafc290ccc",
11
+ "baseRevision": "6851e496285b2c9670066fdd142e7e46da586649",
12
12
  "kind": "dsh-source",
13
13
  "paths": [
14
14
  "packages/client/connection/"
@@ -31,5 +31,5 @@
31
31
  "url": "git+https://github.com/SparkElf/deepseek-harness-plus.git"
32
32
  },
33
33
  "type": "module",
34
- "version": "0.2.1-alpha.2"
34
+ "version": "0.2.1-alpha.21"
35
35
  }
@@ -1,8 +1,8 @@
1
1
  diff --git a/packages/client/connection/src/browser-auth.ts b/packages/client/connection/src/browser-auth.ts
2
- index 5691180d96..823c23debf 100644
2
+ index 6b01531da6..ce8e5dd013 100644
3
3
  --- a/packages/client/connection/src/browser-auth.ts
4
4
  +++ b/packages/client/connection/src/browser-auth.ts
5
- @@ -177,12 +177,29 @@ async function initializeSecret(credentials: CredentialProvider): Promise<Buffer
5
+ @@ -185,12 +185,29 @@ async function initializeSecret(credentials: CredentialProvider): Promise<Buffer
6
6
  return secret
7
7
  }
8
8
 
@@ -11,9 +11,9 @@ index 5691180d96..823c23debf 100644
11
11
  + /** Add any authentication input to the clean application URL. */
12
12
  + authenticatedUrl(baseUrl: string): string
13
13
  + /** Authorize one frontend index request, owning the response when denied or redirected. */
14
- + authorizeIndex(req: ConnectionIndexRequest, res: ConnectionIndexResponse): boolean
14
+ + authorizeIndex(req: ConnectionIndexRequest, res: ConnectionIndexResponse, secure?: boolean): boolean
15
15
  + /** Decide whether a trusted Host request has the required browser identity. */
16
- + isAuthenticated(request: ConnectionTrustRequest): boolean
16
+ + isAuthenticated(request: ConnectionTrustRequest, secure?: boolean): boolean
17
17
  +}
18
18
  +
19
19
  +/** Profile-selected policy that admits every request after the independent Host/Origin fence. */
@@ -34,7 +34,7 @@ index 5691180d96..823c23debf 100644
34
34
  private readonly maxAgeMilliseconds: number
35
35
 
36
36
  diff --git a/packages/client/connection/src/index.ts b/packages/client/connection/src/index.ts
37
- index 647174f743..1ee4898b58 100644
37
+ index 34e15f90a6..ad516d4126 100644
38
38
  --- a/packages/client/connection/src/index.ts
39
39
  +++ b/packages/client/connection/src/index.ts
40
40
  @@ -9,7 +9,7 @@ import type { WebRoute } from '@deepseek-ai/dsh-host-webserver'
@@ -46,8 +46,8 @@ index 647174f743..1ee4898b58 100644
46
46
  import { HostConnectionService } from './rpc-host.ts'
47
47
  import { ConnectionRecoveryConfigSchema, resolveConnectionConfig, type ConnectionRecoveryConfig } from './recovery-config.ts'
48
48
 
49
- @@ -101,6 +101,8 @@ export interface ConnectionConfig {
50
- * bind. An entry that is not a bare, canonical authority fails plugin load.
49
+ @@ -99,6 +99,8 @@ export interface ConnectionConfig {
50
+ * an entry here. A non-canonical or non-bare authority fails plugin load.
51
51
  */
52
52
  trustedHosts?: string[]
53
53
  + /** Host API browser identity policy; Host/Origin trust remains independent. Default: `required`. */
@@ -55,7 +55,7 @@ index 647174f743..1ee4898b58 100644
55
55
  /** Absolute browser-session lifetime in days. Default: 30. */
56
56
  cookieMaxAgeDays?: number
57
57
  /** Maximum buffered JSON body for every `/api` request. Default: 300 MiB. */
58
- @@ -110,6 +112,7 @@ export interface ConnectionConfig {
58
+ @@ -108,6 +110,7 @@ export interface ConnectionConfig {
59
59
  export const Config: z<ConnectionConfig> = z.object({
60
60
  recovery: ConnectionRecoveryConfigSchema.default({}),
61
61
  trustedHosts: z.array(String).default([]),
@@ -63,7 +63,7 @@ index 647174f743..1ee4898b58 100644
63
63
  cookieMaxAgeDays: z.natural().min(1).default(30),
64
64
  maxRequestBodyBytes: z.natural().min(1).default(DEFAULT_MAX_REQUEST_BODY_BYTES),
65
65
  })
66
- @@ -125,16 +128,21 @@ export async function apply(ctx: Context, config?: ConnectionConfig): Promise<vo
66
+ @@ -123,16 +126,21 @@ export async function apply(ctx: Context, config?: ConnectionConfig): Promise<vo
67
67
  const recovery = resolveConnectionConfig(config?.recovery)
68
68
  // The Loader resolves schema defaults; hand-built test contexts may pass none.
69
69
  const trustedHosts = config?.trustedHosts ?? []
@@ -87,19 +87,19 @@ index 647174f743..1ee4898b58 100644
87
87
  ctx.inject(['webServer'], (webCtx) => {
88
88
  assertImageBodyCapacity(webCtx, maxRequestBodyBytes)
89
89
  diff --git a/packages/client/connection/src/rpc-host.ts b/packages/client/connection/src/rpc-host.ts
90
- index 0f98bc1f19..1fc5c528a7 100644
90
+ index 44862c770a..9a1616a162 100644
91
91
  --- a/packages/client/connection/src/rpc-host.ts
92
92
  +++ b/packages/client/connection/src/rpc-host.ts
93
93
  @@ -12,7 +12,7 @@ import { clientRequestSchema } from './rpc-schema.ts'
94
94
  import { bridge } from './http-bridge.ts'
95
- import { isTrustedApiRequest } from './api-request-trust.ts'
95
+ import { isRemoteAuthority, isTrustedApiRequest } from './api-request-trust.ts'
96
96
  import { API_PATH } from './api-path.ts'
97
97
  -import type { BrowserAuth } from './browser-auth.ts'
98
98
  +import type { BrowserAuthentication } from './browser-auth.ts'
99
99
  import { OperatorPeer } from './operator-peer.ts'
100
100
  import type {
101
101
  PeerAdmission,
102
- @@ -70,12 +70,12 @@ export class HostConnectionService extends Service implements HostConnectionHand
102
+ @@ -72,12 +72,12 @@ export class HostConnectionService extends Service implements HostConnectionHand
103
103
  * Provide the Host half over the active HTTP server.
104
104
  * @param ctx - owning Connection plugin context.
105
105
  * @param trustedHosts - deployment authorities accepted by the Host/Origin fence.