-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2504 from posit-dev/mnv-creds-reset
Reset corrupted credentials storage when applicable
- Loading branch information
Showing
22 changed files
with
785 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package credentialstest | ||
|
||
// Copyright (C) 2024 by Posit Software, PBC. | ||
|
||
import ( | ||
"github.com/stretchr/testify/mock" | ||
|
||
"github.com/posit-dev/publisher/internal/credentials" | ||
) | ||
|
||
type CredentialsServiceMock struct { | ||
mock.Mock | ||
} | ||
|
||
func NewCredentialsServiceMock() *CredentialsServiceMock { | ||
return &CredentialsServiceMock{} | ||
} | ||
|
||
func (m *CredentialsServiceMock) Delete(guid string) error { | ||
args := m.Called(guid) | ||
return args.Error(0) | ||
} | ||
|
||
func (m *CredentialsServiceMock) Get(guid string) (*credentials.Credential, error) { | ||
args := m.Called(guid) | ||
return args.Get(0).(*credentials.Credential), args.Error(1) | ||
} | ||
|
||
func (m *CredentialsServiceMock) List() ([]credentials.Credential, error) { | ||
args := m.Called() | ||
return args.Get(0).([]credentials.Credential), args.Error(1) | ||
} | ||
|
||
func (m *CredentialsServiceMock) Set(name string, url string, ak string) (*credentials.Credential, error) { | ||
args := m.Called(name, url, ak) | ||
return args.Get(0).(*credentials.Credential), args.Error(1) | ||
} | ||
|
||
func (m *CredentialsServiceMock) Reset() (string, error) { | ||
args := m.Called() | ||
return args.Get(0).(string), args.Error(1) | ||
} |
Oops, something went wrong.