Skip to content

Commit 1c67bd6

Browse files
authored
Android antispam implementation (#79)
* Validate Firebase app check tokens coming from Android devices * Revert "Validate Firebase app check tokens coming from Android devices" This reverts commit c332b5a. * Rewrite Android device verifier with basic Play Integrity integration * Ensure only fresh Play Integrity tokens are valid * Ensure context is used in Play Integrity request * App integrity verdict should be checked first before other related fields * Add DB store to track airdrop eligiblity for owner accounts * Check eligibility before making any airdrops * Restrict airdrops to accounts created on iOS * Minor fixes * Extend Play Integrity token checks * Return reasons for denying a device token for debugging purposes * Update comments * Fix reason string * Protect against missing signals from Play Integrity response * Update GetUser to be device-aware when determining airdrop eligibility
1 parent 468498b commit 1c67bd6

File tree

22 files changed

+674
-90
lines changed

22 files changed

+674
-90
lines changed

go.mod

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ require (
88
github.com/bits-and-blooms/bloom/v3 v3.1.0
99
github.com/code-payments/code-protobuf-api v1.13.0
1010
github.com/emirpasic/gods v1.12.0
11-
github.com/envoyproxy/protoc-gen-validate v0.1.0
11+
github.com/envoyproxy/protoc-gen-validate v1.0.4
1212
github.com/golang-jwt/jwt/v5 v5.0.0
1313
github.com/golang/protobuf v1.5.3
14-
github.com/google/uuid v1.3.0
14+
github.com/google/uuid v1.6.0
1515
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
1616
github.com/jackc/pgconn v1.10.0
1717
github.com/jackc/pgerrcode v0.0.0-20201024163028-a0d42d470451
@@ -35,20 +35,23 @@ require (
3535
github.com/twilio/twilio-go v0.26.0
3636
github.com/vence722/base122-go v0.0.2
3737
github.com/ybbus/jsonrpc v2.1.2+incompatible
38-
golang.org/x/crypto v0.14.0
39-
golang.org/x/net v0.17.0
38+
golang.org/x/crypto v0.21.0
39+
golang.org/x/net v0.22.0
4040
golang.org/x/text v0.14.0
41-
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
42-
google.golang.org/grpc v1.51.0
43-
google.golang.org/protobuf v1.28.1
41+
golang.org/x/time v0.5.0
42+
google.golang.org/api v0.170.0
43+
google.golang.org/grpc v1.62.1
44+
google.golang.org/protobuf v1.33.0
4445
)
4546

4647
require (
47-
cloud.google.com/go v0.100.2 // indirect
48-
cloud.google.com/go/compute v1.5.0 // indirect
49-
cloud.google.com/go/firestore v1.6.1 // indirect
50-
cloud.google.com/go/iam v0.1.1 // indirect
51-
cloud.google.com/go/storage v1.21.0 // indirect
48+
cloud.google.com/go v0.112.0 // indirect
49+
cloud.google.com/go/compute v1.23.4 // indirect
50+
cloud.google.com/go/compute/metadata v0.2.3 // indirect
51+
cloud.google.com/go/firestore v1.14.0 // indirect
52+
cloud.google.com/go/iam v1.1.6 // indirect
53+
cloud.google.com/go/longrunning v0.5.5 // indirect
54+
cloud.google.com/go/storage v1.36.0 // indirect
5255
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect
5356
github.com/Microsoft/go-winio v0.4.14 // indirect
5457
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
@@ -61,13 +64,17 @@ require (
6164
github.com/docker/go-connections v0.4.0 // indirect
6265
github.com/docker/go-units v0.4.0 // indirect
6366
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
67+
github.com/felixge/httpsnoop v1.0.4 // indirect
6468
github.com/fsnotify/fsnotify v1.4.7 // indirect
69+
github.com/go-logr/logr v1.4.1 // indirect
70+
github.com/go-logr/stdr v1.2.2 // indirect
6571
github.com/gogo/protobuf v1.3.2 // indirect
66-
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
72+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
6773
github.com/golang/mock v1.6.0 // indirect
68-
github.com/google/go-cmp v0.6.0 // indirect
74+
github.com/google/s2a-go v0.1.7 // indirect
6975
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
70-
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
76+
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
77+
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
7178
github.com/hashicorp/hcl v1.0.0 // indirect
7279
github.com/imdario/mergo v0.3.12 // indirect
7380
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
@@ -88,22 +95,28 @@ require (
8895
github.com/opencontainers/runc v1.0.0-rc9 // indirect
8996
github.com/pelletier/go-toml v1.2.0 // indirect
9097
github.com/pmezard/go-difflib v1.0.0 // indirect
91-
github.com/spf13/afero v1.3.3 // indirect
98+
github.com/spf13/afero v1.10.0 // indirect
9299
github.com/spf13/cast v1.3.0 // indirect
93100
github.com/spf13/jwalterweatherman v1.0.0 // indirect
94101
github.com/spf13/pflag v1.0.3 // indirect
95102
github.com/subosito/gotenv v1.2.0 // indirect
96103
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
97104
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
98105
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
99-
go.opencensus.io v0.23.0 // indirect
100-
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect
101-
golang.org/x/sys v0.13.0 // indirect
102-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
103-
google.golang.org/api v0.73.0 // indirect
104-
google.golang.org/appengine v1.6.7 // indirect
106+
go.opencensus.io v0.24.0 // indirect
107+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
108+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
109+
go.opentelemetry.io/otel v1.24.0 // indirect
110+
go.opentelemetry.io/otel/metric v1.24.0 // indirect
111+
go.opentelemetry.io/otel/trace v1.24.0 // indirect
112+
golang.org/x/oauth2 v0.18.0 // indirect
113+
golang.org/x/sync v0.6.0 // indirect
114+
golang.org/x/sys v0.18.0 // indirect
115+
google.golang.org/appengine v1.6.8 // indirect
105116
google.golang.org/appengine/v2 v2.0.1 // indirect
106-
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 // indirect
117+
google.golang.org/genproto v0.0.0-20240205150955-31a09d347014 // indirect
118+
google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect
119+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311132316-a219d84964c2 // indirect
107120
gopkg.in/ini.v1 v1.51.0 // indirect
108121
gopkg.in/yaml.v2 v2.4.0 // indirect
109122
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)