diff --git a/pkg/authtoken/interfaces.go b/pkg/authtoken/interfaces.go index 56f577ac6..75549a1e6 100644 --- a/pkg/authtoken/interfaces.go +++ b/pkg/authtoken/interfaces.go @@ -11,20 +11,20 @@ import ( // An AuthToken is an authentication token used to communicate with the hub API server. type AuthToken struct { - Token string // name of token - ExpiresOn time.Time // expiration time of token + Token string // The authentication token string. + ExpiresOn time.Time // The expiration time of the token. } -// Provider defines a method for fetching an AuthToken. +// Provider defines a method for fetching an authentication token. type Provider interface { - // FetchToken fetches an AuthToken. - // It returns an error if it is unable to fetch an AuthToken for the given input context. + // FetchToken fetches an authentication token to make requests to its associated fleet's hub cluster. + // It returns the token for a given input context, or an error if the retrieval fails. FetchToken(ctx context.Context) (AuthToken, error) } -// Writer defines a method for writing an AuthToken. +// Writer defines a method for writing an authentication token to a specified location. type Writer interface { - // WriteToken writes an AuthToken. - // It returns an error if it is unable to write the AuthToken. + // WriteToken writes the provided authentication token to a filepath location specified in a TokenWriter. + // It returns an error if the writing process fails. WriteToken(token AuthToken) error }