Skip to content

Releases: soultecag/vks-k8s-auth

vks-k8s-auth v1.0.1

Choose a tag to compare

@tribock tribock released this 23 Jul 12:49
6b21dc8

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/client and pkg/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 extractionConvertRESTConfigToKubeconfig was moved out of pkg/client into the new pkg/k8s_utils package.

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

  • ConvertRESTConfigToKubeconfig is now provided by pkg/k8s_utils instead of pkg/client. Update imports accordingly if you were calling this helper directly.

vks-k8s-auth v1.0.0

Choose a tag to compare

@tribock tribock released this 21 Jul 07:43

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 authenticationNewVksGuestClusterAuthClient builds 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 clustersGenerateKubeconfig() 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 accessGetToken() 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 resetResetHTTPClient() 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 or Timeout).

Breaking changes

  • NewVksK8sAuthClient has been renamed to NewVksSupervisorAuthClient for naming consistency with the new NewVksGuestClusterAuthClient. Update existing call sites accordingly.
  • Login() now returns a SupervisorLoginResponse instead of the raw response bytes.
  • NewVksGuestClusterAuthClient now requires both VksAuthConfig.GuestClusterName and VksAuthConfig.GuestClusterNamespace to 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/NewVksGuestClusterAuthClient return an error instead of silently falling back to the system trust store.

Config additions

  • VksAuthConfig.GuestClusterName and VksAuthConfig.GuestClusterNamespace identify the target guest cluster when using NewVksGuestClusterAuthClient.
  • VksAuthConfig.Timeout configures the login request timeout in seconds (defaults to 20).

vks-k8s-auth v0.0.1

Choose a tag to compare

@tribock tribock released this 15 Jul 13:12

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.