diff --git a/README.md b/README.md index 5f4d3ea..4a72ca6 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/go.mod b/go.mod index aeb66c1..6b243f3 100644 --- a/go.mod +++ b/go.mod @@ -7,12 +7,12 @@ 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 ( @@ -20,6 +20,6 @@ require ( 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 ) diff --git a/go.sum b/go.sum index 65da04e..1d891cd 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= diff --git a/pkg/bitwarden/client_test.go b/pkg/bitwarden/client_test.go index 3892f34..0538a2c 100644 --- a/pkg/bitwarden/client_test.go +++ b/pkg/bitwarden/client_test.go @@ -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) } /////////////////////////////////////////////////////////////////////////////// diff --git a/pkg/bitwarden/sync_test.go b/pkg/bitwarden/sync_test.go index 1c60330..ce7b76c 100644 --- a/pkg/bitwarden/sync_test.go +++ b/pkg/bitwarden/sync_test.go @@ -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" ) @@ -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) {