You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if I attempt to build my project, I get this error:
env GOOS=linux go build -ldflags="-s -w" -o bin/decrypt-gopher main.go
# github.com/ProtonMail/gopenpgp/v2/crypto
../../go/pkg/mod/github.com/!proton!mail/gopenpgp/[email protected]/crypto/key.go:187:20: key.entity.SerializePrivateWithoutSigning undefined (type *openpgp.Entity has no field or method SerializePrivateWithoutSigning)
../../go/pkg/mod/github.com/!proton!mail/gopenpgp/[email protected]/crypto/key.go:233:22: key.entity.EncryptionKey undefined (type *openpgp.Entity has no field or method EncryptionKey)
../../go/pkg/mod/github.com/!proton!mail/gopenpgp/[email protected]/crypto/key.go:351:9: pk.SerializeForHash undefined (type *packet.PublicKey has no field or method SerializeForHash)
../../go/pkg/mod/github.com/!proton!mail/gopenpgp/[email protected]/crypto/keyring.go:198:17: entity.SerializePrivateWithoutSigning undefined (type *openpgp.Entity has no field or method SerializePrivateWithoutSigning)
../../go/pkg/mod/github.com/!proton!mail/gopenpgp/[email protected]/crypto/keyring_session.go:59:29: e.EncryptionKey undefined (type *openpgp.Entity has no field or method EncryptionKey)
make: *** [Makefile:10: build] Error 1
here's the kinda decontextualized main.go i modded to just build this:
package main
import (
"context"
"encoding/json"
// "encoding/json"
"fmt"
"os"
"strings"
"github.com/aws/aws-lambda-go/events"
"github.com/ProtonMail/gopenpgp/v2/helper"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
)
func init() {
}
func handler(ctx context.Context, sqsEvent events.SQSEvent) {
privateKey := (os.Getenv("PRIVATE_KEY"))
passphrase := []byte(os.Getenv("PASSPHRASE"))
//s3Dest := os.Getenv("S3_DEST")
message := ""
error := false
if privateKey == "" {
message += "PRIVATE_KEY env var does not exist"
error = true
}
if passphrase == "" {
message += "PASSPHRASE env var does not exist"
error = true
}
if error {
panic(message)
}
armor := ""
decrypted, _ := helper.DecryptMessageArmored(privateKey, passphrase, armor)
fmt.Println(decrypted)
sess, _ := session.NewSession(&aws.Config{
Region: aws.String("us-west-2")},
)
downloader := s3manager.NewDownloader(sess)
for _, sqsRecord := range sqsEvent.Records {
s3Event := &events.S3Event{}
err := json.Unmarshal([]byte(sqsRecord.Body), s3Event)
panic(err)
}
for _, record := range s3Event.Records {
s3RecordMetadata := record.S3
splitKey := strings.Split(s3RecordMetadata.Object.Key, "/")
fmt.Println(splitKey)
file := splitKey[len(splitKey)-1]
destinationFile, err := client.Create(file)
if err != nil {
panic(err)
}
defer destinationFile.Close()
_, err = downloader.Download(destinationFile,
&s3.GetObjectInput{
Bucket: aws.String(s3RecordMetadata.Bucket.Name),
Key: aws.String(s3RecordMetadata.Object.Key),
})
if err != nil {
panic(err)
}
}
}
The text was updated successfully, but these errors were encountered:
When I attempt to build my module which includes
gopenpgp
, I cannotHere's my
go.mod
:if I attempt to build my project, I get this error:
here's the kinda decontextualized
main.go
i modded to just build this:The text was updated successfully, but these errors were encountered: