aboutsummaryrefslogtreecommitdiff
path: root/server/signer
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-06-05 22:18:24 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-06-05 23:00:46 +0100
commitb8af9fe60f27353bdd5933ed37508b30d4290046 (patch)
treefcc12e2f39f9fe4d7aa7d37fd4114309d3362c38 /server/signer
parenta52d19e9e78d08643ffd4aee0483515d8bae2939 (diff)
Add AWS S3 and Google GCS virtual filesystems.
This allows the signing key to be read directly from S3 using a path like /s3/<bucket>/<path/to/signing.key> or /gcs/<bucket>/<path/to/signing.key>.
Diffstat (limited to 'server/signer')
-rw-r--r--server/signer/signer.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/signer/signer.go b/server/signer/signer.go
index 8be5cad..1be6d75 100644
--- a/server/signer/signer.go
+++ b/server/signer/signer.go
@@ -4,11 +4,13 @@ import (
"crypto/md5"
"crypto/rand"
"fmt"
- "io/ioutil"
"log"
"strings"
"time"
+ "go4.org/wkfs"
+ _ "go4.org/wkfs/gcs" // Register "/gcs/" as a wkfs.
+
"github.com/nsheridan/cashier/lib"
"github.com/nsheridan/cashier/server/config"
"golang.org/x/crypto/ssh"
@@ -71,7 +73,7 @@ func makeperms(perms []string) map[string]string {
// New creates a new KeySigner from the supplied configuration.
func New(conf config.SSH) (*KeySigner, error) {
- data, err := ioutil.ReadFile(conf.SigningKey)
+ data, err := wkfs.ReadFile(conf.SigningKey)
if err != nil {
return nil, fmt.Errorf("unable to read CA key %s: %v", conf.SigningKey, err)
}