Documentation
¶
Index ¶
- type GitTokenStore
- func (s *GitTokenStore) AuthDir() string
- func (s *GitTokenStore) CommitConfig(_ context.Context) error
- func (s *GitTokenStore) CommitPaths(_ context.Context, message string, paths ...string) error
- func (s *GitTokenStore) ConfigPath() string
- func (s *GitTokenStore) Delete(_ context.Context, id string) error
- func (s *GitTokenStore) EnsureRepository() error
- func (s *GitTokenStore) List(_ context.Context) ([]*cliproxyauth.Auth, error)
- func (s *GitTokenStore) Save(_ context.Context, auth *cliproxyauth.Auth) (string, error)
- func (s *GitTokenStore) SetBaseDir(dir string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitTokenStore ¶
type GitTokenStore struct {
// contains filtered or unexported fields
}
GitTokenStore persists token records and auth metadata using git as the backing storage.
func NewGitTokenStore ¶
func NewGitTokenStore(remote, username, password string) *GitTokenStore
NewGitTokenStore creates a token store that saves credentials to disk through the TokenStorage implementation embedded in the token record.
func (*GitTokenStore) AuthDir ¶
func (s *GitTokenStore) AuthDir() string
AuthDir returns the directory used for auth persistence.
func (*GitTokenStore) CommitConfig ¶
func (s *GitTokenStore) CommitConfig(_ context.Context) error
CommitConfig commits and pushes configuration changes to git.
func (*GitTokenStore) CommitPaths ¶
CommitPaths commits and pushes the provided paths to the remote repository. It no-ops when the store is not fully configured or when there are no paths.
func (*GitTokenStore) ConfigPath ¶
func (s *GitTokenStore) ConfigPath() string
ConfigPath returns the managed config file path.
func (*GitTokenStore) Delete ¶
func (s *GitTokenStore) Delete(_ context.Context, id string) error
Delete removes the auth file.
func (*GitTokenStore) EnsureRepository ¶
func (s *GitTokenStore) EnsureRepository() error
EnsureRepository prepares the local git working tree by cloning or opening the repository.
func (*GitTokenStore) List ¶
func (s *GitTokenStore) List(_ context.Context) ([]*cliproxyauth.Auth, error)
List enumerates all auth JSON files under the configured directory.
func (*GitTokenStore) Save ¶
func (s *GitTokenStore) Save(_ context.Context, auth *cliproxyauth.Auth) (string, error)
Save persists token storage and metadata to the resolved auth file path.
func (*GitTokenStore) SetBaseDir ¶
func (s *GitTokenStore) SetBaseDir(dir string)
SetBaseDir updates the default directory used for auth JSON persistence when no explicit path is provided.