Skip to content

Commit

Permalink
Update Dependencies for Envoy (#1175)
Browse files Browse the repository at this point in the history
* Update Dependencies for Envoy

* finalize test fixes
  • Loading branch information
bbengfort authored Sep 9, 2024
1 parent 483fba8 commit 057953f
Show file tree
Hide file tree
Showing 21 changed files with 255 additions and 438 deletions.
71 changes: 47 additions & 24 deletions fixtures/datagen/fakerize.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import secrets
import tarfile
import datetime
import argparse

import lorem
from faker import Faker
Expand Down Expand Up @@ -66,6 +67,22 @@
"Romeo Montague Labs LLC": "VERIFIED",
"Oscar Inc": "PENDING_REVIEW",
}
FAKE_LEIS = {
"CharlieBank": "OOT900L1XDRRL7PSIP77",
"Delta Assets": "C4TU00ZTL5Y0MHUGRJ57",
"Echo Funds": "9RLH00AZEPZAD6YPEJ97",
"Foxtrot LLC": "TVHN00DQZFMKWP8BA330",
"GolfBucks": "7BAX00RUVOVV6RPULO23",
"Hotel Corp": "JQOO00QREPQRMSXLXL26",
"IndiaCoin": "B7PE00JRMVNOWAZDYQ28",
"Juliet Capulet LLC": "WHWT00YHWLAZCX3M6D83",
"KiloVASP": "BWUN00NLE0NL2DH1UK77",
"Lima Beancounters": "BWUN00NLE0NL2DH1UK77",
"Mikes Official VASP": "XKDW00MRCXBAQJPW8A40",
"NovemberCash": "C5AR00MDD8NPUZRV2J68",
"Romeo Montague Labs LLC": "RVTZ00KDM2NIREGCLV45",
"Oscar Inc": "VZQC00XDUW7OBYGX0W22",
}
VASP_STATE_CHANGES = {
"SUBMITTED": {
"previous_state": "NO_VERIFICATION",
Expand Down Expand Up @@ -243,6 +260,13 @@ def fake_legal_name(vasp):
}


def fake_lei(vasp):
return {
"national_identifier": FAKE_LEIS[vasp],
"national_identifier_type": "NATIONAL_IDENTIFIER_TYPE_CODE_LEIX",
}


def fake_address(country):
"""
Given a string representing the 2-letter country code for a VASP, return a
Expand Down Expand Up @@ -450,6 +474,7 @@ def replace_fixtures():
tar.add(OUTPUT_DIRECTORY, arcname="synthetic")
shutil.move("fakes.tgz", os.path.join("pkg", "gds", "testdata", "fakes.tgz"))


##########################################################################
# Contact Creation Functions
##########################################################################
Expand Down Expand Up @@ -502,11 +527,7 @@ def make_verified(vasp, idx, template="fixtures/datagen/templates/verified.json"
record["id"] = idx
record["entity"]["name"] = fake_legal_name(vasp)
record["entity"]["geographic_addresses"] = [fake_address(country)]
record["entity"]["national_identification"][
"national_identifier"
] = secrets.token_urlsafe(24)
# Due to IVMS101 validation constraint C9, the country of issue should not be
# filled in for a legal person.
record["entity"]["national_identification"] = fake_lei(vasp)
record["entity"]["country_of_registration"] = country
rng_person = random.Random(vasp+"person")
record["contacts"]["legal"] = make_person(vasp, token="legal_token", rng=rng_person)
Expand Down Expand Up @@ -558,11 +579,7 @@ def make_unverified(
record["id"] = idx
record["entity"]["name"] = fake_legal_name(vasp)
record["entity"]["geographic_addresses"] = [fake_address(country)]
record["entity"]["national_identification"][
"national_identifier"
] = secrets.token_urlsafe(24)
# Due to IVMS101 validation constraint C9, the country of issue should not be
# filled in for a legal person.
record["entity"]["national_identification"] = fake_lei(vasp)
record["entity"]["country_of_registration"] = country
rng_person = random.Random(vasp+"person")
record["contacts"]["legal"] = make_person(vasp, verified=email_verified, token="legal_token", rng=rng_person)
Expand Down Expand Up @@ -592,7 +609,6 @@ def make_unverified(
else:
record["extra"]["admin_verification_token"] = ""


return record


Expand Down Expand Up @@ -957,18 +973,25 @@ def add_vasp_cert_relationships(vasps, certreqs, certs):
vasps[vasp_name]["extra"]["certificates"] = cert_ids

if __name__ == "__main__":
replace = False
if len(sys.argv) > 1:
if sys.argv[1] == "--help":
print("Usage: python fixtures/datagen/fakerize.py [--help|--replace]")
print(" --help: print this message")
print(" --replace: generate and replace existing fixtures in pkg/gds/testdata")
sys.exit(0)
elif sys.argv[1] == "--replace":
replace = True
else:
print("Unknown argument: %s", sys.argv[1])
sys.exit(1)
parser = argparse.ArgumentParser(
description="generate fake data for testing purposes",
epilog="make sure to run this in the root of the repository",
)

parser.add_argument(
"-r",
"--replace",
action="store_true",
default=False,
help="generate and replace existing fixtures in pkg/gds/testdata",
)

if not os.path.exists("fixtures") or not os.path.exists("pkg"):
print("ensure you're running this from the root of the repository:")
print(" python3 fixtures/datagen/fakerize.py")
sys.exit(1)

args = parser.parse_args()

if os.path.exists(OUTPUT_DIRECTORY):
shutil.rmtree(OUTPUT_DIRECTORY)
Expand All @@ -983,6 +1006,6 @@ def add_vasp_cert_relationships(vasps, certreqs, certs):
store(fake_certreqs, kind="certreqs")
store(fake_certs, kind="certs")

if replace:
if args.replace:
replace_fixtures()
print("Successfully replaced pkg/gds/testdata/fakes.tgz")
97 changes: 49 additions & 48 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/trisacrypto/directory

go 1.22
go 1.22.1

toolchain go1.22.3

require (
cloud.google.com/go/secretmanager v1.13.4
github.com/auth0/go-jwt-middleware/v2 v2.2.1
cloud.google.com/go/secretmanager v1.14.0
github.com/auth0/go-jwt-middleware/v2 v2.2.2
github.com/getsentry/sentry-go v0.28.1
github.com/ghodss/yaml v1.0.0
github.com/gin-contrib/cors v1.7.2
Expand All @@ -21,57 +21,57 @@ require (
github.com/kelseyhightower/envconfig v1.4.0
github.com/mroth/weightedrand v1.0.0
github.com/oklog/ulid/v2 v2.1.0
github.com/prometheus/client_golang v1.19.1
github.com/rotationalio/confire v1.0.0
github.com/prometheus/client_golang v1.20.3
github.com/rotationalio/confire v1.1.0
github.com/rotationalio/go-ensign v0.12.0
github.com/rotationalio/honu v0.4.0
github.com/rotationalio/whisper v1.2.1
github.com/rs/zerolog v1.33.0
github.com/segmentio/ksuid v1.0.4
github.com/sendgrid/rest v2.6.9+incompatible
github.com/sendgrid/sendgrid-go v3.14.0+incompatible
github.com/sendgrid/sendgrid-go v3.16.0+incompatible
github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0
github.com/stretchr/testify v1.9.0
github.com/swaggo/files v1.0.1
github.com/swaggo/gin-swagger v1.6.0
github.com/swaggo/swag v1.16.3
github.com/syndtr/goleveldb v1.0.0
github.com/trisacrypto/courier v1.0.0
github.com/trisacrypto/trisa v1.3.0
github.com/trisacrypto/trisa v1.4.1
github.com/urfave/cli v1.22.15
github.com/urfave/cli/v2 v2.27.2
github.com/urfave/cli/v2 v2.27.4
github.com/vmihailenco/msgpack/v5 v5.4.1
golang.org/x/net v0.27.0
google.golang.org/api v0.189.0
google.golang.org/grpc v1.65.0
golang.org/x/net v0.29.0
google.golang.org/api v0.196.0
google.golang.org/grpc v1.66.0
google.golang.org/protobuf v1.34.2
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/yaml.v2 v2.4.0
)

require (
cloud.google.com/go/auth v0.7.2 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect
cloud.google.com/go/auth v0.9.3 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.1.11 // indirect
cloud.google.com/go/iam v1.2.0 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/rehttp v1.4.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bytedance/sonic v1.11.9 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/bytedance/sonic v1.12.2 // indirect
github.com/bytedance/sonic/loader v0.2.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/cockroachdb/fifo v0.0.0-20240616162244-4768e80dfb9a // indirect
github.com/cockroachdb/fifo v0.0.0-20240816210425-c5d0cb0b6fc0 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.5 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
Expand All @@ -84,8 +84,8 @@ require (
github.com/goccy/go-json v0.10.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.3 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -102,54 +102,55 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.27.8 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/trisacrypto/lei v1.0.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/arch v0.8.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
go.opentelemetry.io/otel v1.29.0 // indirect
go.opentelemetry.io/otel/metric v1.29.0 // indirect
go.opentelemetry.io/otel/trace v1.29.0 // indirect
golang.org/x/arch v0.10.0 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/genproto v0.0.0-20240722135656-d784300faade // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240722135656-d784300faade // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/auth0/go-auth0 v1.8.0
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
github.com/DataDog/zstd v1.5.6 // indirect
github.com/auth0/go-auth0 v1.10.0
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/pebble v1.1.1 // indirect
github.com/go-playground/validator/v10 v10.22.0 // indirect
github.com/cockroachdb/pebble v1.1.2 // indirect
github.com/go-playground/validator/v10 v10.22.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/prometheus/common v0.55.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
golang.org/x/exp/typeparams v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/sys v0.22.0 // indirect
honnef.co/go/tools v0.4.7 // indirect
software.sslmate.com/src/go-pkcs12 v0.4.0 // indirect
github.com/prometheus/common v0.59.1 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e
golang.org/x/exp/typeparams v0.0.0-20240904232852-e7e105dedf7e // indirect
golang.org/x/sys v0.25.0 // indirect
honnef.co/go/tools v0.5.1 // indirect
software.sslmate.com/src/go-pkcs12 v0.5.0 // indirect
)
Loading

0 comments on commit 057953f

Please sign in to comment.