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
7 changes: 7 additions & 0 deletions apps/connectors/poc/network-account/v1alpha/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM gcr.io/distroless/static-debian11
COPY --from=busybox:1.36.0-uclibc /bin/cp /bin/cp

WORKDIR /
COPY v1alpha .

ENTRYPOINT ["/app"]
133 changes: 133 additions & 0 deletions apps/connectors/poc/network-account/v1alpha/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@

# Manually Deploy Docker Image

```bash
cpln profile update jeannotcompany --login --org jeannotcompany
export CPLN_PROFILE="jeannotcompany"
cpln image docker-login
```

```bash
nx build workloads-public-communications-v1alpha-preference-center
nx container workloads-public-communications-v1alpha-preference-center
docker tag workloads/public/communications/v1alpha/preference-center:latest jeannotcompany.registry.cpln.io/communications-v1alpha-preference-center:JC-123
docker push jeannotcompany.registry.cpln.io/communications-v1alpha-preference-center:JC-123
cpln --org jeannotcompany --gvc local-gvc workload force-redeployment communications-v1alpha-preference-center
```

```bash
curl \
--header "Content-Type: application/json" \
--header "x-spec-workspace-slug:workspace123" \
--header "x-spec-organization-slug:organization123" \
http://localhost:6477/v1/communication/preference-center/options | jq .
```

```bash
curl \
--header "Content-Type: application/json" \
--header "x-spec-workspace-slug: workspace123" \
--header "x-spec-organization-slug: organization123" \
http://localhost:6477/v1/communication/preference-center/dimy | jq .
```

# Get Preference Options
```bash
cd proto
grpcurl \
-protoset <(buf build -o -) -plaintext \
-H "x-spec-workspace: workspace123" \
-H "x-spec-organization: organization123" \
-d '{}' \
localhost:6477 platform.communication.v1alpha.PreferenceCenterService/GetPreferenceOptions
```

# Create or Update Preferences
```bash

curl -X POST \
--header "Content-Type: application/json" \
--header "x-spec-workspace-slug: workspace123" \
--header "x-spec-organization-slug: organization123" \
--header "x-spec-validate-only: true" \
--header "x-spec-principal-id: djeannot" \
--header "x-spec-ip: 123.0.0.0" \
--header "x-spec-locale: en-us" \
--header "x-spec-sent-at: 2022-12-10T04:08:31.581Z" \
--header "x-spec-principal-id:12345678" \
--header "x-spec-principal-email: dimy@jeannotfamily.com" \
--header "x-spec-connection-id: sf-corporate" \
--header "x-b3-traceid: 34bc6254cbf6c0ac2236ac7a8999ffa6" \
--header "x-spec-workspace-jan: JURISDICTION_USA" \
--header "x-spec-ip: 224.567.324.233" \
--header "x-spec-locale: en_US" \
--header "x-spec-timezone: America/New_York" \
--header "x-spec-device-id: B5372DB0-C21E-11E4-8DFC-AA07A5B093DB" \
--header "x-spec-device-adv-id: 7A3CBEA0-BDF5-11E4-8DFC-AA07A5B093DB" \
--header "x-spec-device-manufacturer: Apple" \
--header "x-spec-device-model: iPhone16,2" \
--header "x-spec-device-name: maguro" \
--header "x-spec-device-type: ios" \
--header "x-spec-device-token: ff15bc0c20c4aa6cd50854ff165fd265c838e5405bfeb9571066395b8c9da449" \
--header "x-spec-city: Atlanta" \
--header "x-spec-country: United States" \
--header "x-spec-lat: 40.2964197" \
--header "x-spec-long: -76.9411617" \
--header "x-spec-speed: 0" \
--header "x-spec-cellular: true" \
--header "x-spec-carrier: Verizon" \
--header "x-spec-os-name: iPhone OS" \
--header "x-spec-os-version: 16.1.3" \
--data '{"email": "dimy2@jeannot.company", "first_name": "Dimy2", "last_name": "Jeannot2", "phone_number": "770"}' \
http://localhost:6477/v1/communication/preference-center | jq .

# Directly to Ingress
curl -X POST \
--header "Content-Type: application/json" \
--header "x-spec-workspace-slug:workspace123" \
--header "x-spec-organization-slug:organization123" \
--header "x-spec-validate-only: true" \
--data '{"email": "dimy2@jeannot.company", "first_name": "Dimy2", "last_name": "Jeannot2"}' \
https://api.communication.dev-1.na-us-1.jeannot.company/v1/communication/preference-center | jq .

# Directly to Edge
curl -X POST \
--header "Content-Type: application/json" \
--header "x-spec-apikey: 12345678" \
--header "x-spec-validate-only: true" \
--header "x-spec-debug: true" \
--data '{"email": "dimy2@jeannot.company", "first_name": "Dimy2", "last_name": "Jeannot2"}' \
https://api.communication.dev-1.jeannot.company/v1/communication/preference-center | jq .


```

# Get preferences for a user
```bash
curl \
--header "Content-Type: application/json" \
--header "x-spec-workspace-slug: workspace123" \
--header "x-spec-organization-slug: organization123" \
http://localhost:6477/v1/communication/preference-center/7c25c3a0-0e69-4363-bf05-3df64c705320 | jq .
```



cd proto
grpcurl \
-protoset <(buf build -o -) -plaintext \
-H "x-spec-workspace: workspace123" \
-H "x-spec-organization: organization123" \
-d '{}' \
localhost:6477 platform.communication.v1alpha.PreferenceCenterService/GetPreferenceOptions


cd proto
ghz --insecure --protoset <(buf build -o -) --call platform.audit.v2alpha.AuditService/Search --total 100000 localhost:6476



curl \
--header "Content-Type: application/json" \
--header "x-spec-apikey: 12987312kj13h2i371298312kj3u12i8371298371923" \
http://localhost:6477/v1/communication/preference-center/options | jq .
122 changes: 122 additions & 0 deletions apps/connectors/poc/network-account/v1alpha/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
module github.com/openecosystems/ecosystem/apps/connectors/poc/network-account/v1alpha

go 1.23.4

require (
github.com/openecosystems/ecosystem/libs/partner/go/nats v0.0.0-20250314114941-6105506b389b
github.com/openecosystems/ecosystem/libs/partner/go/nebula v0.0.0-20250314114941-6105506b389b
github.com/openecosystems/ecosystem/libs/partner/go/sendgrid/v3 v3.0.0-20250313162807-9d78ed3460c3
github.com/openecosystems/ecosystem/libs/partner/go/zap v0.0.0-20250314114941-6105506b389b
github.com/openecosystems/ecosystem/libs/private/go/configuration/v2alpha v0.0.0-20250314114941-6105506b389b
github.com/openecosystems/ecosystem/libs/public/go/sdk/v2alpha v0.0.0-20250314114941-6105506b389b
github.com/openecosystems/ecosystem/libs/public/go/model v0.0.0-20250314114941-6105506b389b
)

require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.35.1-20240920164238-5a7b106cbb87.1 // indirect
connectrpc.com/connect v1.17.0 // indirect
connectrpc.com/vanguard v0.3.0 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/apex/log v1.9.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cyberdelia/go-metrics-graphite v0.0.0-20161219230853-39f87cc3b432 // indirect
github.com/ebitengine/purego v0.8.1 // indirect
github.com/flynn/noise v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gaissmai/bart v0.11.1 // indirect
github.com/getkin/kin-openapi v0.125.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/invopop/yaml v0.3.1 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mennanov/fmutils v0.3.0 // indirect
github.com/miekg/dns v1.1.61 // indirect
github.com/minio/highwayhash v1.0.3 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/nats-io/jwt/v2 v2.5.8 // indirect
github.com/nats-io/nats-server/v2 v2.10.20 // indirect
github.com/nats-io/nats.go v1.37.0 // indirect
github.com/nats-io/nkeys v0.4.7 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/nbrownus/go-metrics-prometheus v0.0.0-20210712211119-974a6260965f // indirect
github.com/oapi-codegen/oapi-codegen/v2 v2.3.0 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/openecosystems/ecosystem/libs/poc/go/protobuf v0.0.0-20250314114941-6105506b389b // indirect
github.com/openecosystems/ecosystem/libs/private/go/protobuf v0.0.0-20250314114941-6105506b389b // indirect
github.com/openecosystems/ecosystem/libs/protobuf/go/protobuf v0.0.0-20250314114941-6105506b389b // indirect
github.com/openecosystems/ecosystem/libs/public/go/protobuf v0.0.0-20250314114941-6105506b389b // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/segmentio/ksuid v1.0.4 // indirect
github.com/shirou/gopsutil/v4 v4.24.11 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/slackhq/nebula v1.9.5 // indirect
github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.29.0 // indirect
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.31.0 // indirect
golang.org/x/sync v0.9.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/term v0.26.0 // indirect
golang.org/x/text v0.20.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.26.0 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
golang.zx2c4.com/wireguard v0.0.0-20230325221338-052af4a8072b // indirect
golang.zx2c4.com/wireguard/windows v0.5.3 // 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
google.golang.org/grpc v1.68.0 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gvisor.dev/gvisor v0.0.0-20240423190808-9d7a357edefe // indirect
)
Loading
Loading