C# Class GoogleCloudExtension.Accounts.CredentialsStore

This class manages the credentials store for the extension. Loading and saving the UserAccount to the %HOME%\AppData\Local directory. This class also manages the default credentials to use when a project doesn't specify credentials, or when Visual Studio is freshly opened. This default credentials is the last set of credentials used by the extension.
Exibir arquivo Open project: GoogleCloudPlatform/google-cloud-visualstudio

Public Methods

Method Description
AddAccount ( UserAccount userAccount ) : void

Stores a new set of user credentials in the credentials store.

DeleteAccount ( UserAccount account ) : void

Deletes the account from the store. The account must exist in the store or it will throw.

GetAccount ( string accountName ) : UserAccount

Returns the account given the account name.

ResetCredentials ( string accountName, string projectId ) : void

Resets the credentials state to the account with the given accountName and the given projectId. The Reset event will be raised to notify listeners on this. If accountName cannot be found in the store then the credentials will be reset to empty.

UpdateCurrentProject ( Project project ) : void

Updates the current project data from the given project.

Private Methods

Method Description
AtomicFileRead ( string path ) : string
AtomicFileWrite ( string path, string contents ) : void
CredentialsStore ( ) : Google.Apis.Auth.OAuth2
EnsureCredentialsRootExist ( ) : void
GetCredentialsStoreRoot ( ) : string
GetFileName ( UserAccount userAccount ) : string
GetUserAccountPath ( string accountName ) : string
LoadAccounts ( ) : StoredUserAccount>.Dictionary
LoadDefaultCredentials ( ) : DefaultCredentials
LoadUserAccount ( string path ) : UserAccount
SaveUserAccount ( UserAccount userAccount ) : string
SaveUserAccount ( UserAccount userAccount, string path ) : void
UpdateDefaultCredentials ( ) : void

Method Details

AddAccount() public method

Stores a new set of user credentials in the credentials store.
public AddAccount ( UserAccount userAccount ) : void
userAccount UserAccount
return void

DeleteAccount() public method

Deletes the account from the store. The account must exist in the store or it will throw.
public DeleteAccount ( UserAccount account ) : void
account UserAccount The accound to delete.
return void

GetAccount() public method

Returns the account given the account name.
public GetAccount ( string accountName ) : UserAccount
accountName string The name to look.
return UserAccount

ResetCredentials() public method

Resets the credentials state to the account with the given accountName and the given projectId. The Reset event will be raised to notify listeners on this. If accountName cannot be found in the store then the credentials will be reset to empty.
public ResetCredentials ( string accountName, string projectId ) : void
accountName string The name of the account to make current.
projectId string The projectId to make current.
return void

UpdateCurrentProject() public method

Updates the current project data from the given project.
public UpdateCurrentProject ( Project project ) : void
project Project
return void