Skip to content

fix(server): add ClientTimeout to Server, fix hostname:port parsing - #56

Open
spbsoluble wants to merge 1 commit into
mainfrom
ab#82257
Open

spbsoluble wants to merge 1 commit into
mainfrom
ab#82257

Conversation

@spbsoluble

Copy link
Copy Markdown
Collaborator

Summary

  • Add ClientTimeout int field to the Server struct in command_config.go, populated from HttpClientTimeout in all four GetServerConfig() implementations (core, basic, OAuth, kerberos). This allows downstream consumers (e.g. keyfactor-go-client) to read the configured timeout from Server without reaching back into the auth config.
  • Fix WithCommandHostName to extract an embedded port (e.g. "host:9443") and apply it via CommandPort so the SDK doesn't double-append a port to the URL.
  • Fix Authenticate() to reconstruct the URL with the non-default port when present.

Context

The ClientTimeout gap was discovered while the terraform-provider-keyfactor consumed a local dev copy of kfc-auth — the go-client's client.go references cfg.ClientTimeout which didn't exist on Server. This is the smallest fix to close that gap.

Test plan

  • Existing kfc-auth unit tests pass
  • keyfactor-go-client builds against this version
  • terraform-provider-keyfactor builds and unit tests pass with this RC

…rverConfig

auth_providers.Server was missing a ClientTimeout field, causing every call
to GetServerConfig() to return a Server with ClientTimeout=0 regardless of
what WithClientTimeout() was set to on the underlying CommandAuthConfig.

Add:
- ClientTimeout int to Server (command_config.go)
- ClientTimeout: c.HttpClientTimeout in CommandAuthConfig.GetServerConfig()
- ClientTimeout: a.HttpClientTimeout in CommandAuthConfigBasic.GetServerConfig()
- ClientTimeout: b.HttpClientTimeout in CommandConfigOauth.GetServerConfig()
- ClientTimeout: k.HttpClientTimeout in CommandAuthConfigKerberos.GetServerConfig()

This fixes the silent timeout propagation gap reported in provider
integration tests (TestUnitGetServerConfig_RequestTimeout*).

This branch was successfully deployed

No deployments
ses_2441 — 87d3c240 Deployed Sep 16, 2026 by spbsoluble via Run tests (ses_2441) #221
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant