Skip to content

Commit 673a745

Browse files
committed
Add header command setting
1 parent 923338a commit 673a745

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/main/kotlin/com/coder/gateway/CoderSettingsConfigurable.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ class CoderSettingsConfigurable : BoundConfigurable("Coder") {
6666
CoderGatewayBundle.message("gateway.connector.settings.enable-binary-directory-fallback.comment")
6767
)
6868
}.layout(RowLayout.PARENT_GRID)
69+
row(CoderGatewayBundle.message("gateway.connector.settings.header-command.title")) {
70+
textField().resizableColumn().align(AlignX.FILL)
71+
.bindText(state::headerCommand)
72+
.comment(
73+
CoderGatewayBundle.message("gateway.connector.settings.header-command.comment")
74+
)
75+
}.layout(RowLayout.PARENT_GRID)
6976
}
7077
}
7178

src/main/kotlin/com/coder/gateway/services/CoderSettingsState.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class CoderSettingsState : PersistentStateComponent<CoderSettingsState> {
1818
var dataDirectory: String = ""
1919
var enableDownloads: Boolean = true
2020
var enableBinaryDirectoryFallback: Boolean = false
21+
var headerCommand: String = ""
2122
override fun getState(): CoderSettingsState {
2223
return this
2324
}

src/main/resources/messages/CoderGatewayBundle.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,8 @@ gateway.connector.settings.enable-binary-directory-fallback.title=Fall back to d
8787
gateway.connector.settings.enable-binary-directory-fallback.comment=Checking this \
8888
box will allow the plugin to fall back to the data directory when the CLI \
8989
directory is not writable.
90+
gateway.connector.settings.header-command.title=Header command:
91+
gateway.connector.settings.header-command.comment=An external command that \
92+
outputs additional HTTP headers added to all requests. The command must \
93+
output each header as `key=value` on its own line. The following \
94+
environment variables will be available to the process: CODER_URL.

0 commit comments

Comments
 (0)