From c8405bfd2b1677866d5e33aa9fd5e4240c183b4b Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 4 Aug 2015 10:55:27 -0700 Subject: [PATCH] add cache to yaml --- README.md | 4 ++-- pkg/types/config.go | 1 + pkg/utils/sshutil/sshutil.go | 13 +++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fd049a84..edd069e4 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,6 @@ Drone documentation is organized into several categories: * [Plugin Guide](http://readme.drone.io/docs/plugin/) * [API Reference](http://readme.drone.io/docs/api/) -### Community +### Community, Help -Contributions, questions, and comments are welcomed and encouraged. Drone developers hang out in the [drone/drone](https://gitter.im/drone/drone) room on [gitter](https://gitter.im/drone/drone). +Contributions, questions, and comments are welcomed and encouraged. Drone developers hang out in the [drone/drone](https://gitter.im/drone/drone) room on gitter. We ask that you please post your questions to [gitter](https://gitter.im/drone/drone) before creating an issue. diff --git a/pkg/types/config.go b/pkg/types/config.go index 6a431b61..7d219e58 100644 --- a/pkg/types/config.go +++ b/pkg/types/config.go @@ -47,6 +47,7 @@ type Step struct { Entrypoint []string Command []string Volumes []string + Cache []string WorkingDir string `yaml:"working_dir"` NetworkMode string `yaml:"net"` diff --git a/pkg/utils/sshutil/sshutil.go b/pkg/utils/sshutil/sshutil.go index 7def573e..197265f0 100644 --- a/pkg/utils/sshutil/sshutil.go +++ b/pkg/utils/sshutil/sshutil.go @@ -37,3 +37,16 @@ func MarshalPrivateKey(privkey *rsa.PrivateKey) []byte { privateKeyPEM := pem.EncodeToMemory(&pem.Block{Type: "RSA PRIVATE KEY", Headers: nil, Bytes: privateKeyMarshaled}) return privateKeyPEM } + +// helper function to encrypt a plain-text string using +// an RSA public key. +func Encrypt(pubkey *rsa.PublicKey, msg string) ([]byte, error) { + return rsa.EncryptPKCS1v15(rand.Reader, pubkey, []byte(msg)) +} + +// helper function to encrypt a plain-text string using +// an RSA public key. +func Decrypt(privkey *rsa.PrivateKey, secret string) (string, error) { + msg, err := rsa.DecryptPKCS1v15(rand.Reader, privkey, []byte(secret)) + return string(msg), err +}