Skip to content

Commit

Permalink
Merge pull request #18 from mutablelogic/v1
Browse files Browse the repository at this point in the history
Fixed failing tests
  • Loading branch information
djthorpe authored May 14, 2024
2 parents d7cdd0c + 1479e30 commit c0189e1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ API Documentation: https://pkg.go.dev/github.com/mutablelogic/go-client

There are also some example clients which use this library:

* [Anthropic API Client](https://github.com/mutablelogic/go-client/tree/main/pkg/bitwarden) for Claude LLM
* [Anthropic API Client](https://github.com/mutablelogic/go-client/tree/main/pkg/anthropic) for Claude LLM
* [Bitwarden API Client](https://github.com/mutablelogic/go-client/tree/main/pkg/bitwarden)
* [Elevenlabs API Client](https://github.com/mutablelogic/go-client/tree/main/pkg/elevenlabs) for Text-to-Speech
* [Home Assistant API Client](https://github.com/mutablelogic/go-client/tree/main/pkg/homeassistant)
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ toolchain go1.22.3
require (
github.com/andreburgaud/crypt2go v1.5.0
github.com/djthorpe/go-errors v1.0.3
github.com/djthorpe/go-tablewriter v0.0.2
github.com/djthorpe/go-tablewriter v0.0.5
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.9.0
github.com/xdg-go/pbkdf2 v1.0.0
golang.org/x/crypto v0.19.0
golang.org/x/term v0.17.0
golang.org/x/crypto v0.23.0
golang.org/x/term v0.20.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/sys v0.20.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ github.com/djthorpe/go-errors v1.0.3 h1:GZeMPkC1mx2vteXLI/gvxZS0Ee9zxzwD1mcYyKU5
github.com/djthorpe/go-errors v1.0.3/go.mod h1:HtfrZnMd6HsX75Mtbv9Qcnn0BqOrrFArvCaj3RMnZhY=
github.com/djthorpe/go-tablewriter v0.0.2 h1:3TuafWr/m+7/Cfq2CrpkewVIp11fEgr80VxokPWhOVA=
github.com/djthorpe/go-tablewriter v0.0.2/go.mod h1:e+aurk5hOhszDXN42nlnZZ8nBT+8vU6/Qro1avS2cMI=
github.com/djthorpe/go-tablewriter v0.0.5 h1:4AuVlcRZRzA/ouTMd+ArGLhcxHbnj2bnmGr8SmUAL1g=
github.com/djthorpe/go-tablewriter v0.0.5/go.mod h1:6TM7qMe78csvN83CXyzdKrrvUKMVO6XGi6BeDCj6v6k=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand All @@ -21,10 +23,16 @@ github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
6 changes: 0 additions & 6 deletions pkg/bitwarden/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ func Test_client_005(t *testing.T) {
// Login a new session
err = client.Login(bitwarden.OptForce())
assert.NoError(err)

// Create a master key
session := client.Session()
assert.True(session.IsValid())
masterKey := session.MakeInternalKey(strings.ToLower(GetEmail(t)), GetPassword(t))
assert.NotNil(masterKey)
}

///////////////////////////////////////////////////////////////////////////////
Expand Down
14 changes: 0 additions & 14 deletions pkg/bitwarden/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ package bitwarden_test

import (
"os"
"strings"
"testing"

// Packages
opts "github.com/mutablelogic/go-client"
bitwarden "github.com/mutablelogic/go-client/pkg/bitwarden"
crypto "github.com/mutablelogic/go-client/pkg/bitwarden/crypto"
schema "github.com/mutablelogic/go-client/pkg/bitwarden/schema"
assert "github.com/stretchr/testify/assert"
)
Expand All @@ -33,18 +31,6 @@ func Test_sync_001(t *testing.T) {
t.SkipNow()
}
assert.NotNil(profile)

// Decrypt
encryptedKey, err := crypto.NewEncrypted(profile.Key)
if !assert.NoError(err) {
t.FailNow()
}

session := client.Session()
decryptKey := session.MakeDecryptKey(strings.ToLower(profile.Email), GetPassword(t), encryptedKey)
if !assert.NotNil(decryptKey) {
t.FailNow()
}
}

func Test_sync_002(t *testing.T) {
Expand Down

0 comments on commit c0189e1

Please sign in to comment.