Skip to content

Commit

Permalink
tweak: Switch to anonymous authentication for GCS
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Feb 20, 2019
1 parent 33ca95f commit b5da2bb
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
5 changes: 0 additions & 5 deletions function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"os"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand All @@ -15,10 +14,6 @@ import (
)

var _ = Describe("Function as a Service", func() {
if os.Getenv("GOOGLE_APPLICATION_CREDENTIALS") == "" {
Skip("Google Cloud credentials are not available")
}

ts := httptest.NewServer(http.HandlerFunc(Bender))
defer ts.Close()

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/sirupsen/logrus v1.2.0
github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c // indirect
github.com/urfave/cli v1.20.0
google.golang.org/api v0.1.0 // indirect
google.golang.org/api v0.1.0
google.golang.org/genproto v0.0.0-20190111180523-db91494dd46c // indirect
google.golang.org/grpc v1.18.0 // indirect
)
3 changes: 2 additions & 1 deletion internal/pkg/loaders/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"

"cloud.google.com/go/storage"
"google.golang.org/api/option"
"github.com/SierraSoftworks/bender/pkg/models"
sentry "github.com/SierraSoftworks/sentry-go"
"github.com/pkg/errors"
Expand Down Expand Up @@ -32,7 +33,7 @@ func (l *gcsLoader) Load() ([]*models.Quote, error) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

client, err := storage.NewClient(ctx)
client, err := storage.NewClient(ctx, option.WithoutAuthentication())
if err != nil {
return nil, errors.Wrap(err, "failed to access cloud storage account")
}
Expand Down
6 changes: 0 additions & 6 deletions internal/pkg/loaders/gcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ import (
. "github.com/onsi/gomega"

. "github.com/SierraSoftworks/bender/internal/pkg/loaders"

"os"
)

var _ = Describe("GCS", func() {
if os.Getenv("GOOGLE_APPLICATION_CREDENTIALS") == "" {
Skip("Google Cloud credentials are not available")
}

Describe("NewGCSLoader", func() {
loader := NewGCSLoader("cdn.sierrasoftworks.com", "bender/quotes.json")
It("should return a loader", func() {
Expand Down

0 comments on commit b5da2bb

Please sign in to comment.