Skip to content

Commit 09a1f54

Browse files
committed
Drop AppEngine Go 1.9 support
1 parent c9b400d commit 09a1f54

File tree

10 files changed

+19
-88
lines changed

10 files changed

+19
-88
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ install:
2727

2828
script:
2929
- make test-coverage
30-
- go mod vendor
31-
- GOFLAGS=-mod=vendor make test-appengine-coverage
32-
- cat ae_coverage.out ae2_coverage.out | grep .go >> coverage.out
30+
- make test-appengine-coverage
31+
- cat ae_coverage.out | grep .go >> coverage.out
3332
- "$GOPATH/bin/goveralls -coverprofile=coverage.out -service=travis-ci"
3433
- make fmt vet build

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ test-coverage:
2525
go test -coverprofile=coverage.out -covermode=count -coverpkg=$(shell go list ./... | grep -v '/vendor/' | paste -sd, -) ./...
2626

2727
test-appengine-coverage:
28-
APPENGINE_TEST=true goapp test -coverprofile=ae_coverage.out -covermode=count ./
29-
APPENGINE_TEST=true goapp test -coverprofile=ae2_coverage.out -covermode=count -coverpkg=$(shell go list ./... | grep -v '/vendor/' | paste -sd, -) ./jwtmiddleware
28+
APPENGINE_TEST=true go test -coverprofile=ae_coverage.out -covermode=count -coverpkg=$(shell go list ./... | grep -v '/vendor/' | paste -sd, -) ./...
3029

3130
vet:
3231
@if [ "`go vet ./... | tee /dev/stderr`" ]; then \

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Google Cloud Platform (Cloud KMS, IAM API, & AppEngine App Identity API) jwt-go
66

77
Google Cloud KMS [now supports signatures](https://cloud.google.com/kms/docs/create-validate-signatures) and support has been added to gcp-jwt-go!
88

9+
## Breaking Changes with v2.1
10+
11+
- Dropping support for AppEngine Go 1.9 environment (last version with AppEngine App Identity support will be for Go 1.11)
12+
- KMSConfig no longer takes an optional HTTP Client, but rather the kms gRPC based client
13+
914
## Breaking Changes with v2
1015

1116
- Package name changed from gcp_jwt to gcpjwt
@@ -76,4 +81,4 @@ _Where cache=false is where we get the most value from these numbers as it shows
7681
- If using the IAM API - create a separate service account to sign on behalf of for your projects unless you NEED to use your default service account (e.g. the AppEngine service account). This way you can limit the scope of access for any leaked credentials. You'll have to grant the `roles/iam.serviceAccountTokenCreator` role to any user/group/serviceaccount you want to be able to sign on behalf of the new service account (resource: `projects/-/serviceAccounts/<serviceaccount>`). For example, create an api-signer service account, do NOT furnish any keys for it, [grant](https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/setIamPolicy) your AppEngine/GCE/etc. default service account the proper role for that serviceAccount, and use the api-signer@... service account address in your configuration.
7782
- If using outside of GCP, be sure to put credentials for an account that can access the service account for signing tokens in a well known location:
7883
1. A JSON file whose path is specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable.
79-
2. A JSON file in a location known to the gcloud command-line tool. On Windows, this is %APPDATA%/gcloud/application_default_credentials.json. On other systems, $HOME/.config/gcloud/application_default_credentials.json.
84+
2. A JSON file in a location known to the gcloud command-line tool. On Windows, this is %APPDATA%/gcloud/application_default_credentials.json. On other systems, \$HOME/.config/gcloud/application_default_credentials.json.

client_appengine.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

client_gcp.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ func KMSFromContext(ctx context.Context) (*KMSConfig, bool) {
108108
return val, ok
109109
}
110110

111+
func getDefaultClient(ctx context.Context) *http.Client {
112+
return http.DefaultClient
113+
}
114+
111115
func getDefaultOauthClient(ctx context.Context) (*http.Client, error) {
112116
return google.DefaultClient(ctx, iam.CloudPlatformScope)
113117
}

iam_appengine.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build appengine
2-
31
package gcpjwt
42

53
import (

iam_appengine_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build appengine
2-
31
package gcpjwt
42

53
import (
@@ -153,6 +151,9 @@ var appEngineTestData = []struct {
153151
// }
154152

155153
func TestAppEngineSignAndVerify(t *testing.T) {
154+
if !isAppEngine {
155+
return
156+
}
156157
ctx, err := newContextFunc()
157158
if err != nil {
158159
t.Errorf("could not get context: %v", err)
@@ -192,6 +193,9 @@ func TestAppEngineSignAndVerify(t *testing.T) {
192193
}
193194

194195
func TestSigningMethodAppEngineImpl_Sign(t *testing.T) {
196+
if !isAppEngine {
197+
return
198+
}
195199
type args struct {
196200
signingString string
197201
key interface{}

jwtmiddleware/middleware.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build !appengine
2-
31
package jwtmiddleware
42

53
import (

jwtmiddleware/middleware_appengine.go

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)