Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ env_variables:
MAXMIND_URL: gs://downloader-{{PROJECT_ID}}/Maxmind/current/GeoLite2-City.tar.gz
ROUTEVIEW_V4_URL: gs://downloader-{{PROJECT_ID}}/RouteViewIPv4/current/routeview.pfx2as.gz
REDIS_ADDRESS: {{REDIS_ADDRESS}}
CREDENTIALS_PROJECT: {{CREDENTIALS_PROJECT}}
GC_TTL: 24h

1 change: 1 addition & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ steps:
args:
- sed -i -e 's/{{PROJECT_ID}}/$PROJECT_ID/g' app.yaml
- sed -i -e 's/{{REDIS_ADDRESS}}/$_REDIS_ADDRESS/g' app.yaml
- sed -i -e 's/{{CREDENTIALS_PROJECT}}/$_CREDENTIALS_PROJECT/g' app.yaml
- gcloud --project $PROJECT_ID app deploy --promote app.yaml
# After deploying the new service, deploy the openapi spec.
- sed -i -e 's/{{PROJECT}}/$PROJECT_ID/' -e 's/{{DEPLOYMENT}}/$PROJECT_ID/' openapi.yaml
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/m-lab/autojoin
go 1.25.0

require (
cloud.google.com/go/apikeys v1.2.7
cloud.google.com/go/datastore v1.21.0
cloud.google.com/go/secretmanager v1.16.0
github.com/Masterminds/semver/v3 v3.4.0
Expand All @@ -30,7 +29,6 @@ require (
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
cloud.google.com/go/iam v1.5.3 // indirect
cloud.google.com/go/longrunning v0.8.0 // indirect
cloud.google.com/go/monitoring v1.24.3 // indirect
cloud.google.com/go/storage v1.56.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSU
cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE=
cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU=
cloud.google.com/go/apikeys v1.2.7 h1:JbdXKvx6i4zyGKmG+hPgtmFIoT5j3CIUgByJypFT1XY=
cloud.google.com/go/apikeys v1.2.7/go.mod h1:A2yBJ+/0m3kDZaxJ27Wqw21pzr4wxoE8tTHbXpGepjk=
cloud.google.com/go/auth v0.18.0 h1:wnqy5hrv7p3k7cShwAU/Br3nzod7fxoqG+k0VZ+/Pk0=
cloud.google.com/go/auth v0.18.0/go.mod h1:wwkPM1AgE1f2u6dG443MiWoD8C3BtOywNsUMcUTVDRo=
cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc=
Expand Down
4 changes: 2 additions & 2 deletions handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/Masterminds/semver/v3"
v0 "github.com/m-lab/autojoin/api/v0"
"github.com/m-lab/autojoin/iata"
"github.com/m-lab/autojoin/internal/adminx"
"github.com/m-lab/autojoin/internal/dnsname"
"github.com/m-lab/autojoin/internal/dnsx"
"github.com/m-lab/autojoin/internal/dnsx/dnsiface"
Expand All @@ -24,6 +23,7 @@ import (
"github.com/m-lab/go/host"
"github.com/m-lab/go/rtx"
v2 "github.com/m-lab/locate/api/v2"
"github.com/m-lab/token-exchange/store"
"github.com/m-lab/uuid-annotator/annotator"
"github.com/oschwald/geoip2-golang"
)
Expand Down Expand Up @@ -82,7 +82,7 @@ type ServiceAccountSecretManager interface {
}

type Datastore interface {
GetOrganization(ctx context.Context, name string) (*adminx.Organization, error)
GetOrganization(ctx context.Context, name string) (*store.AutojoinOrganization, error)
}

// NewServer creates a new Server instance for request handling.
Expand Down
12 changes: 6 additions & 6 deletions handler/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (

v0 "github.com/m-lab/autojoin/api/v0"
"github.com/m-lab/autojoin/iata"
"github.com/m-lab/autojoin/internal/adminx"
"github.com/m-lab/autojoin/internal/dnsx/dnsiface"
"github.com/m-lab/gcp-service-discovery/discovery"
"github.com/m-lab/go/host"
"github.com/m-lab/go/testingx"
"github.com/m-lab/token-exchange/store"
"github.com/m-lab/uuid-annotator/annotator"
"github.com/oschwald/geoip2-golang"
"google.golang.org/api/dns/v1"
Expand Down Expand Up @@ -116,17 +116,17 @@ func (f *fakeSecretManager) LoadOrCreateKey(ctx context.Context, org string) (st
}

type fakeDatastoreOrgManager struct {
org *adminx.Organization
org *store.AutojoinOrganization
err error
}

func (f *fakeDatastoreOrgManager) GetOrganization(ctx context.Context, orgName string) (*adminx.Organization, error) {
func (f *fakeDatastoreOrgManager) GetOrganization(ctx context.Context, orgName string) (*store.AutojoinOrganization, error) {
if f.err != nil {
return nil, f.err
}
if f.org == nil {
// Return default if not specified
return &adminx.Organization{
return &store.AutojoinOrganization{
Name: orgName,
ProbabilityMultiplier: float64Ptr(1.0),
}, nil
Expand Down Expand Up @@ -624,7 +624,7 @@ func TestServer_Register(t *testing.T) {
key: "fake key data",
},
dsm: &fakeDatastoreOrgManager{
org: &adminx.Organization{
org: &store.AutojoinOrganization{
Name: "bar",
ProbabilityMultiplier: float64Ptr(2.0),
},
Expand All @@ -647,7 +647,7 @@ func TestServer_Register(t *testing.T) {
key: "fake key data",
},
dsm: &fakeDatastoreOrgManager{
org: &adminx.Organization{
org: &store.AutojoinOrganization{
Name: "bar",
ProbabilityMultiplier: nil,
},
Expand Down
64 changes: 0 additions & 64 deletions internal/adminx/apikeys.go

This file was deleted.

92 changes: 0 additions & 92 deletions internal/adminx/apikeys_test.go

This file was deleted.

Loading