Skip to content

Commit

Permalink
fix: Add option to exclude auth-server env var output
Browse files Browse the repository at this point in the history
Since [PR #38727][1] in teleport, tbot configuration validation fails
when both the proxy server and the auth server are specified. Because
the auth-server seems deprecated, the GitHub Action should not
automatically export the env var `TELEPORT_AUTH_SERVER`. However, to
avoid any breaking changes, I suggest keeping it exported by default.

[1]: gravitational/teleport#38727
  • Loading branch information
Erouan50 committed Aug 5, 2024
1 parent f16241b commit e6f1f11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion actions/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ async function run() {

const identityFilePath = path.join(destinationPath, 'identity');
const sshConfigFilePath = path.join(destinationPath, 'ssh_config');
const export_auth_server = sharedInputs.export_auth_server;
core.setOutput('identity-file', identityFilePath);
core.setOutput('ssh-config', sshConfigFilePath);
core.exportVariable('TELEPORT_PROXY', sharedInputs.proxy);
core.exportVariable('TELEPORT_AUTH_SERVER', sharedInputs.proxy);
// By default, we export the env var to not do any breaking change
if (export_auth_server == null && export_auth_server) {
core.exportVariable('TELEPORT_AUTH_SERVER', sharedInputs.proxy);
}
core.exportVariable('TELEPORT_IDENTITY_FILE', identityFilePath);
}
run().catch(core.setFailed);
3 changes: 3 additions & 0 deletions common/lib/tbot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface SharedInputs {
certificateTTL: string;
anonymousTelemetry: boolean;
caPins: string[];
export_auth_server: boolean;
}

function stringToBool(str: string): boolean {
Expand All @@ -29,13 +30,15 @@ export function getSharedInputs(): SharedInputs {
const certificateTTL = core.getInput('certificate-ttl');
const anonymousTelemetry = stringToBool(core.getInput('anonymous-telemetry'));
const caPins = core.getMultilineInput('ca-pins');
const export_auth_server = core.getBooleanInput('export_auth_server');

return {
proxy,
token,
certificateTTL,
anonymousTelemetry,
caPins,
export_auth_server,
};
}

Expand Down

0 comments on commit e6f1f11

Please sign in to comment.