Skip to content

Commit

Permalink
dep: go mod: update
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Oct 22, 2023
1 parent 4b5b48d commit 829b4d5
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 33 deletions.
12 changes: 6 additions & 6 deletions cmd/rchooks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"strings"

"github.com/grokify/goauth/credentials"
"github.com/grokify/goauth"
"github.com/grokify/mogo/encoding/jsonutil"
"github.com/grokify/mogo/errors/errorsutil"
"github.com/grokify/mogo/fmt/fmtutil"
Expand All @@ -17,7 +17,7 @@ import (
)

type Options struct {
credentials.Options
goauth.Options
//EnvFile string `short:"e" long:"env" description:"Env filepath"`
//WhichEnv []bool `short:"w" long:"which" description:"Which .env path"`
List []bool `short:"l" long:"list" description:"List subscriptions"`
Expand Down Expand Up @@ -47,16 +47,16 @@ func handleResponse(info interface{}, err error) {
fmtutil.MustPrintJSON(info)
}

func GetCredentials(credspath, account string) (credentials.Credentials, error) {
set, err := credentials.ReadFileCredentialsSet(credspath, true)
func GetCredentials(credspath, account string) (goauth.Credentials, error) {
set, err := goauth.ReadFileCredentialsSet(credspath, true)
if err != nil {
return credentials.Credentials{},
return goauth.Credentials{},
errorsutil.Wrap(err, fmt.Sprintf("creds file [%s]", credspath))
}
creds, err := set.Get(account)
if err != nil {
accts := strings.Join(set.Accounts(), ",")
return credentials.Credentials{},
return goauth.Credentials{},
errorsutil.Wrap(err, fmt.Sprintf("use [%s]", accts))
}
return creds, err
Expand Down
6 changes: 3 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"

"github.com/grokify/goauth"
"github.com/grokify/goauth/credentials"
"github.com/grokify/goauth/authutil"
"github.com/grokify/goauth/ringcentral"
"github.com/grokify/mogo/errors/errorsutil"

Expand All @@ -23,7 +23,7 @@ type RcHooksConfig struct {
WebhookDefinition rc.CreateSubscriptionRequest
}

func NewRcHooksConfigCreds(creds credentials.Credentials, hookDefJSON string) (RcHooksConfig, error) {
func NewRcHooksConfigCreds(creds goauth.Credentials, hookDefJSON string) (RcHooksConfig, error) {
cfg := RcHooksConfig{
ServerURL: creds.OAuth2.ServerURL,
WebhookDefinitionJSON: hookDefJSON}
Expand Down Expand Up @@ -61,7 +61,7 @@ func (rchConfig *RcHooksConfig) Inflate() error {
}

func (rchConfig *RcHooksConfig) Client() (*http.Client, error) {
return goauth.NewClientBearerTokenSimpleOrJSON(context.Background(), []byte(rchConfig.Token))
return authutil.NewClientBearerTokenSimpleOrJSON(context.Background(), []byte(rchConfig.Token))
}

func (rchConfig *RcHooksConfig) ClientUtil() (ringcentral.ClientUtil, error) {
Expand Down
27 changes: 20 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
module github.com/grokify/rchooks

go 1.18
go 1.21

toolchain go1.21.1

require (
github.com/aws/aws-lambda-go v1.41.0
github.com/grokify/go-ringcentral-client v0.3.14
github.com/grokify/goauth v0.17.7
github.com/grokify/go-ringcentral-client v0.3.16
github.com/grokify/goauth v0.20.4
github.com/grokify/mogo v0.57.0
github.com/jessevdk/go-flags v1.5.0
)

require (
cloud.google.com/go/compute v1.23.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/antihax/optional v1.0.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/grokify/go-scim-client v0.1.15 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/grokify/go-scim-client v0.1.16 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/martinlindhe/base36 v1.1.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/valyala/fastjson v1.6.4 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/api v0.148.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/oleiade/reflections.v1 v1.0.0 // indirect
)
Loading

0 comments on commit 829b4d5

Please sign in to comment.