Releases: soultecag/vks-k8s-auth
Releases · soultecag/vks-k8s-auth
Release list
vks-k8s-auth v1.0.1
v1.0.1
Patch release focused on packaging, documentation, tests, and CI hardening since v1.0.0.
Fixes
- Authentication error reporting — failed login errors now include the target URL, making Supervisor or guest-cluster authentication failures easier to diagnose.
- Deferred close handling — response-body and connection close errors are now handled without overwriting more meaningful existing errors.
- Client initialization cleanup — client construction was streamlined internally by introducing a shared initialization path.
- Guest cluster endpoint handling cleanup — redundant TLS config assignment was removed during guest-cluster client setup.
Documentation
- pkg.go.dev documentation — added package-level GoDoc for
pkg/clientandpkg/k8s_utils. - pkg.go.dev examples — added rendered example functions for:
- Supervisor authentication
- Guest cluster authentication
- kubeconfig generation from
rest.Config
- README improvements — added badges and refreshed package-facing documentation.
Tests
- Comprehensive client tests — expanded coverage for authentication flows, kubeconfig generation, token helpers, TLS behavior, and HTTP client lifecycle.
- Utility package tests — added dedicated tests for the extracted kubeconfig helper package.
Internal/package changes
- Kubeconfig helper extraction —
ConvertRESTConfigToKubeconfigwas moved out ofpkg/clientinto the newpkg/k8s_utilspackage.
CI / supply chain
- golangci-lint workflow — added a dedicated lint and test workflow.
- SBOM workflow updates — improved software bill of materials generation in the scan pipeline.
- Go toolchain workflow hardening — CI was updated to avoid mixed-toolchain cache issues during lint and test runs.
Breaking changes
ConvertRESTConfigToKubeconfigis now provided bypkg/k8s_utilsinstead ofpkg/client. Update imports accordingly if you were calling this helper directly.
vks-k8s-auth v1.0.0
v1.0.0
First breaking release.
Adds Tanzu guest cluster authentication support alongside the existing Supervisor client, and renames the client constructors for clarity.
New features
- Guest cluster authentication —
NewVksGuestClusterAuthClientbuilds a Kubernetes client scoped to a Tanzu guest cluster, authenticating through the Supervisor and using the cluster's control-plane endpoint/CA. - Kubeconfig generation for guest clusters —
GenerateKubeconfig()now also works against the guest cluster client, and a new example (examples/k8s-guest-cluster-client) demonstrates listing namespaces and generating a kubeconfig for a guest cluster. - Token access —
GetToken()exposes the current JWT for callers that need the raw token. - Thread-safe token access — token reads/writes (
GetToken(),TokenValid(),TokenExpiry(),GenerateKubeconfig(),Login(),RefreshToken()) are now synchronized, making it safe to call these concurrently on the same client instance. - HTTP client reset —
ResetHTTPClient()closes idle connections and discards the cached HTTP client, forcing a fresh client/connection to be built on the next login call (e.g. after changing TLS settings orTimeout).
Breaking changes
NewVksK8sAuthClienthas been renamed toNewVksSupervisorAuthClientfor naming consistency with the newNewVksGuestClusterAuthClient. Update existing call sites accordingly.Login()now returns aSupervisorLoginResponseinstead of the raw response bytes.NewVksGuestClusterAuthClientnow requires bothVksAuthConfig.GuestClusterNameandVksAuthConfig.GuestClusterNamespaceto be set, failing fast with an error if either is missing.
Behavior changes
- Client construction now fails closed: if the Supervisor/guest cluster's CA certificate cannot be captured during setup,
NewVksSupervisorAuthClient/NewVksGuestClusterAuthClientreturn an error instead of silently falling back to the system trust store.
Config additions
VksAuthConfig.GuestClusterNameandVksAuthConfig.GuestClusterNamespaceidentify the target guest cluster when usingNewVksGuestClusterAuthClient.VksAuthConfig.Timeoutconfigures the login request timeout in seconds (defaults to 20).
vks-k8s-auth v0.0.1
Initial release of a Go client library for authenticating against a vSphere Supervisor (VKS) and consuming its Kubernetes API.
Core features:
- Supervisor login — authenticates against the vSphere Supervisor API using username/password (VksAuthConfig), with optional custom port and TlsInsecureSkipVerify.
- Kubernetes client construction — builds a ready-to-use controller-runtime client (VksK8sAuthClient) backed by the Supervisor's TLS info and bearer token, so it can be used directly for Get/List/Create/etc.
- Kubeconfig generation — produces a standalone kubeconfig YAML string from the authenticated session
- JWT token handling — TokenExpiry() and TokenValid() inspect the JWT claims to check expiration; RefreshToken() re-authenticates to obtain a fresh token.
- Configurable HTTP timeout — VksAuthConfig.Timeout (seconds) for the login call, defaulting to 20s.