Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna committed Nov 13, 2024
1 parent 3ba7913 commit 6e351fd
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions client/src/www/app/outline_server_repository/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,22 @@ export const TEST_ONLY = {
* ServiceConfig represents an Outline service. It's the structured representation of an Access Key.
* It has a name, a tunnel config that can be statically or dynamically defined.
*/
export type ServiceConfig = {
readonly name: string;
} & (StaticServiceConfig | DynamicServiceConfig);
export type ServiceConfig = StaticServiceConfig | DynamicServiceConfig;

/**
/**
* StaticServiceConfig is a ServiceConfig with a static tunnel config.
* It's the structured representation of a Static Access Key.
*/
export class StaticServiceConfig {
constructor(readonly name: string, readonly tunnelConfig: TunnelConfigJson) {}
}

/**
/**
* DynamicServiceConfig is a ServiceConfig that has the location to fetch the tunnel config.
* It's the structured representation of a Dynamic Access Key.
*/
export class DynamicServiceConfig {
constructor(
readonly name: string,
readonly transportConfigLocation: URL
) {}
constructor(readonly name: string, readonly transportConfigLocation: URL) {}
}

/** EndpointAddress represents the address of a TCP/UDP endpoint. */
Expand Down Expand Up @@ -105,7 +100,8 @@ export function setTransportConfigHost(
/**
* parseTunnelConfig parses the given tunnel config as text and returns a new TunnelConfigJson.
* The config text may be a "ss://" link or a JSON object.
* This is used by the server to parse the config fetched from the dynamic key.
* This is used by the server to parse the config fetched from the dynamic key, and to parse
* static keys as tunnel configs (which may be present in the dynamic config).
*/
export function parseTunnelConfig(
tunnelConfigText: string
Expand Down

0 comments on commit 6e351fd

Please sign in to comment.