Skip to content

Commit

Permalink
SM-1082: Add SM state to bitwarden_client.go
Browse files Browse the repository at this point in the history
  • Loading branch information
coltonhurst committed Jan 29, 2024
1 parent 3064ac5 commit 80a9fcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions languages/go/bitwarden_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func NewBitwardenClient(apiURL *string, identityURL *string) (*BitwardenClient,
}, nil
}

func (c *BitwardenClient) AccessTokenLogin(accessToken string) error {
req := AccessTokenLoginRequest{AccessToken: accessToken}
func (c *BitwardenClient) AccessTokenLogin(accessToken string, state_path *string) error {
req := AccessTokenLoginRequest{AccessToken: accessToken, StateFile: state_path}
command := Command{AccessTokenLogin: &req}

responseStr, err := c.commandRunner.RunCommand(command)
Expand Down
3 changes: 2 additions & 1 deletion languages/go/example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ func main() {
bitwardenClient, _ := sdk.NewBitwardenClient(&apiURL, &identityURL)

accessToken := os.Getenv("ACCESS_TOKEN")
statePath := os.Getenv("STATE_PATH")
organizationIDStr := os.Getenv("ORGANIZATION_ID")
projectName := os.Getenv("PROJECT_NAME")

if projectName == "" {
projectName = "NewTestProject" // default value
}

err := bitwardenClient.AccessTokenLogin(accessToken)
err := bitwardenClient.AccessTokenLogin(accessToken, &statePath)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 80a9fcb

Please sign in to comment.