Skip to content

Commit

Permalink
updated scy integration
Browse files Browse the repository at this point in the history
  • Loading branch information
awitas committed Mar 22, 2023
1 parent 72df3c0 commit 2dadf93
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.63.0
0.64.0
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ require (
github.com/viant/dsc v0.16.3-0.20230216180920-9279ced1a21a
github.com/viant/dsunit v0.10.11-0.20230206200841-24715d3637af
github.com/viant/neatly v0.8.1-0.20230118003138-9e5c5757ae6e
github.com/viant/scy v0.4.2
github.com/viant/scy v0.5.0
github.com/viant/toolbox v0.34.6-0.20220701174423-a46fd679bbc5
github.com/yuin/gopher-lua v0.0.0-20190514113301-1cd887cd7036 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,8 @@ github.com/viant/neatly v0.8.1-0.20230118003138-9e5c5757ae6e h1:YO2JEwvGdglS97nO
github.com/viant/neatly v0.8.1-0.20230118003138-9e5c5757ae6e/go.mod h1:bwPo68RpiUBxiEM81im5b9PkWA4dACQAPQrPqtVov7A=
github.com/viant/parsly v0.0.0-20220913214053-cb272791c00f h1:cpnXF1e4ywkykZmNqjjnjbRXIK+zfom2wRbrGqB63eM=
github.com/viant/parsly v0.0.0-20220913214053-cb272791c00f/go.mod h1:4PKQzioRT9R99ceIhZ6tCD3tp0H0n2dEoIOaLulVvrg=
github.com/viant/scy v0.3.2-0.20220818145333-129333b79ae7 h1:dJ0U1LSr8KwlNpZQ0egjTiYAMZZTCEH2MW4E+/golH0=
github.com/viant/scy v0.3.2-0.20220818145333-129333b79ae7/go.mod h1:n9aw1NKilNgadT5NKbDLAAdSeQGm0UY45e2P2X8UeS4=
github.com/viant/scy v0.4.2 h1:ZsbuqfNxspF/OjF1ksdOoIo5XrlfQZq5L9+PjtbA9f4=
github.com/viant/scy v0.4.2/go.mod h1:8DdAWhNVjY6OGOT9+2O7FEAPGDRqy2e+fG6cwIY6jNo=
github.com/viant/scy v0.5.0 h1:xFjCoPElf5hdlebhw7AUEv3rYj/PC+dhOPUKpBTXsHg=
github.com/viant/scy v0.5.0/go.mod h1:8DdAWhNVjY6OGOT9+2O7FEAPGDRqy2e+fG6cwIY6jNo=
github.com/viant/sqlparser v0.2.0 h1:8VCxyq5wwmz6QkhdgMwYAdgsvpZ9vIwG2tRDHGN/C2k=
github.com/viant/sqlparser v0.2.0/go.mod h1:ffKCsz9eb+tv0/nfDguYCcvpYmco/rLHhxhf/kMzKzw=
github.com/viant/toolbox v0.34.6-0.20220701174423-a46fd679bbc5 h1:pVpg+vp+O8fTRNmmzxmJBKJbHnLC6jE1OxrSFMi4rNY=
Expand Down
2 changes: 1 addition & 1 deletion shared/static/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
func init() {
var memStorage = storage.NewMemoryService()
{
err := memStorage.Upload("mem://github.com/viant/endly/Version", bytes.NewReader([]byte{48, 46, 54, 51, 46, 48}))
err := memStorage.Upload("mem://github.com/viant/endly/Version", bytes.NewReader([]byte{48, 46, 54, 52, 46, 48}))
if err != nil {
log.Printf("failed to upload: mem://github.com/viant/endly/Version %v", err)
}
Expand Down
2 changes: 2 additions & 0 deletions system/secret/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ type RevealResponse struct {

type SignJWTRequest struct {
PrivateKey *scy.Resource
HMAC *scy.Resource
ExpiryInSec int
ClaimsURL string
UseClaimsMap bool
Expand Down Expand Up @@ -136,6 +137,7 @@ type SignJWTResponse struct {

type VerifyJWTRequest struct {
PublicKey *scy.Resource
HMAC *scy.Resource
CertURL string
Token string
}
Expand Down
4 changes: 2 additions & 2 deletions system/secret/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *service) reveal(context *endly.Context, request *RevealRequest) (*Revea
}

func (s *service) signJWT(context *endly.Context, request *SignJWTRequest) (*SignJWTResponse, error) {
jwtSigner := signer.New(&signer.Config{RSA: request.PrivateKey})
jwtSigner := signer.New(&signer.Config{RSA: request.PrivateKey, HMAC: request.HMAC})

if err := jwtSigner.Init(context.Background()); err != nil {
return nil, err
Expand All @@ -85,7 +85,7 @@ func (s *service) signJWT(context *endly.Context, request *SignJWTRequest) (*Sig
}

func (s *service) verifyJWT(context *endly.Context, request *VerifyJWTRequest) (*VerifyJWTResponse, error) {
jwtVerifier := verifier.New(&verifier.Config{RSA: request.PublicKey, CertURL: request.CertURL})
jwtVerifier := verifier.New(&verifier.Config{RSA: request.PublicKey, CertURL: request.CertURL, HMAC: request.HMAC})
if err := jwtVerifier.Init(context.Background()); err != nil {
return nil, err
}
Expand Down

0 comments on commit 2dadf93

Please sign in to comment.