github.com/Redstoneguy129/cli@v0.0.0-20230211220159-15dca4e91917/internal/utils/credentials/store.go (about)

     1  package credentials
     2  
     3  import (
     4  	"github.com/zalando/go-keyring"
     5  )
     6  
     7  const namespace = "Supabase CLI"
     8  
     9  // Retrieves the stored password of a project and username
    10  func Get(project string) (string, error) {
    11  	return keyring.Get(namespace, project)
    12  }
    13  
    14  // Stores the password of a project and username
    15  func Set(project, password string) error {
    16  	return keyring.Set(namespace, project, password)
    17  }
    18  
    19  // Erases the stored password of a project and username
    20  func Delete(project string) error {
    21  	return keyring.Delete(namespace, project)
    22  }