Compare commits

...

37 Commits
main ... dev

Author SHA1 Message Date
Arnaud Delcasse 5f12bed2d4 Add beneficiaries informations to bookings list
Build and Push Docker Image / build_and_push (push) Failing after 1m25s Details
2024-11-19 15:53:40 +01:00
Arnaud Delcasse 2f760733af Add ReplyTo header when sending email tu support
Build and Push Docker Image / build_and_push (push) Failing after 1m41s Details
2024-11-19 15:21:31 +01:00
Arnaud Delcasse 1df56a4f83 Remove all fmr.Println and add zerolog logging
Build and Push Docker Image / build_and_push (push) Failing after 1m42s Details
2024-11-11 20:07:00 +01:00
Arnaud Delcasse a8acc9950a Remove all fmr.Println and add zerolog logging
Build and Push Docker Image / build_and_push (push) Failing after 1m52s Details
2024-11-11 19:50:17 +01:00
Arnaud Delcasse a51f077358 resolve conflict
Build and Push Docker Image / build_and_push (push) Failing after 1m46s Details
2024-11-04 17:29:19 +01:00
Arnaud Delcasse 4fc08a35de Allow insecure HTTP for OIDC only in local in development mode 2024-11-04 17:24:02 +01:00
Nicolas CARON eaf866154e Update package git.coopgo.io
Build and Push Docker Image / build_and_push (push) Failing after 1m41s Details
2024-11-04 10:58:30 +01:00
Nicolas CARON 06f42947b9 run 'go mod tidy'
Build and Push Docker Image / build_and_push (push) Failing after 1m1s Details
2024-11-04 10:45:59 +01:00
Nicolas CARON acb5232b94 run 'go mod tidy'
Build and Push Docker Image / build_and_push (push) Failing after 55s Details
2024-11-04 10:43:24 +01:00
Nicolas CARON 8de170a009 add bookings on dashboard & kilometers on vehicles management
Build and Push Docker Image / build_and_push (push) Failing after 59s Details
2024-10-29 12:08:24 +01:00
Nicolas CARON a0557b0971 edit go.mod - comments all replace
Build and Push Docker Image / build_and_push (push) Failing after 58s Details
2024-10-28 10:05:31 +01:00
Nicolas CARON b4c59c7408 edit agenda handlers - delete logs
Build and Push Docker Image / build_and_push (push) Failing after 2m8s Details
2024-10-23 10:39:11 +02:00
Nicolas CARON 334351a0cf renderer agenda.go & handler agendo.go 2024-10-22 12:09:46 +02:00
Nicolas CARON 7184f4735c edit agenda handlers 2024-10-15 10:51:15 +02:00
Nicolas CARON 434be30074 add logical to add docs in event 2024-10-09 18:21:45 +02:00
Arnaud Delcasse 498b12de18 fix dependencies in go.mod
Build and Push Docker Image / build_and_push (push) Failing after 54s Details
2024-05-20 17:25:31 +02:00
Nicolas CARON b77403c674 test actions
Build and Push Docker Image / build_and_push (push) Failing after 53s Details
2024-04-10 09:18:24 +02:00
Nicolas CARON f7cb9f1116 test actions
Build and Push Docker Image / build_and_push (push) Failing after 26s Details
2024-04-05 12:22:22 +02:00
Nicolas CARON 2aec61e520 Merge branch 'dev' of https://git.coopgo.io/coopgo-apps/parcoursmob into dev 2024-04-04 12:24:59 +02:00
Nicolas CARON 73586aa61a add .gitea/worflows/build.yml 2024-04-04 12:24:21 +02:00
mfrigo a636b54a94 [+] Correction for véhicule partages 2023-12-08 13:29:25 +01:00
mfrigo 7c73c1d233 Merge branch 'dev' of https://git.coopgo.io/coopgo-apps/parcoursmob into dev 2023-11-24 17:06:12 +01:00
mfrigo 7a31b0ceb2 [+] merge main.go 2023-11-24 17:04:10 +01:00
mfrigo 2274f8d6d0 [+] bug fix regarding booking-list 2023-11-24 16:27:34 +01:00
mfrigo 4229c13b6b Implemented functional "Actions réalisées"
- Added events and vehicles inside it
- Included dates, characteristics, and names of events/vehicles
- Introduced color-coded badges to indicate the status of events/vehicles (ongoing or not)
2023-10-23 09:45:57 +02:00
mfrigo 100ffbe05a delete themes.zip 2023-09-06 13:32:49 +02:00
mfrigo 0f50b5e678 [+] adding in beneficiary-events the agenda-widget 2023-09-06 13:28:02 +02:00
sbouaram 0e00a839a3 agenda dispositifs exports 2023-05-30 09:06:48 +02:00
sbouaram c354bece5f refactoring groupcache 2023-05-19 10:58:37 +02:00
sbouaram 6299a6c7be cache refactoring 2023-05-19 10:06:30 +02:00
sbouaram 718c39de00 refactoring 2023-05-16 08:40:05 +02:00
sbouaram 9f66851529 adding groupcache 2023-05-15 14:49:00 +02:00
sbouaram aa13d60ca6 AdministrationGroupInviteMember 2023-04-25 04:37:20 -04:00
sbouaram d169566cd1 administration create group 2023-04-24 05:36:57 -04:00
root b54961b619 handlers/administration goroutines 2023-04-20 19:14:00 +03:00
root c34d08ff70 go routines /handlers/application/journeys 2023-04-20 15:28:27 +03:00
root 46a72e1aef api/cache 2023-04-20 13:14:25 +03:00
78 changed files with 1395 additions and 810 deletions

View File

@ -0,0 +1,81 @@
name: Build and Push Docker Image
on:
push:
tags:
- '*'
branches:
- main
- dev
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Install Docker
run: |
apt-get update
apt-get install -y docker.io
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Kubernetes Context
uses: azure/k8s-set-context@v4
with:
method: kubeconfig
kubeconfig: ${{secrets.buildx_kubeconfig}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: kubernetes
driver-opts: |
namespace=gitea
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: git.coopgo.io
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract metadata (tags, labels) for Docker image
id: metadata
uses: docker/metadata-action@v3
with:
images: git.coopgo.io/${{gitea.repository}}
tags: |
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
flavor: |
latest=auto
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ steps.metadata.outputs.tags }}
build-args: |
ACCESS_TOKEN_USR=${{gitea.actor}}
ACCESS_TOKEN_PWD=${{gitea.token}}
# BUILD WITH KANIKO
# - name: Kaniko build and push
# uses: aevea/action-kaniko@master
# with:
# build_file: Dockerfile
# registry: git.coopgo.io
# username: ${{secrets.registry_user}}
# password: ${{secrets.registry_token}}
# image: ${{gitea.repository}}
# tag: ${{gitea.ref_name}}
# cache: true
# cache_registry: git.coopgo.io/${{gitea.repository}}/cache
# extra-args: |
# ACCESS_TOKEN_USR=${{gitea.actor}}
# ACCESS_TOKEN_PWD=${{gitea.token}}

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/parcoursmob.iml" filepath="$PROJECT_DIR$/.idea/parcoursmob.iml" />
</modules>
</component>
</project>

9
.idea/parcoursmob.iml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

7
.idea/vcs.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/themes" vcs="Git" />
</component>
</project>

0
Dockerfile Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
config.go Normal file → Executable file
View File

91
go.mod Normal file → Executable file
View File

@ -1,6 +1,6 @@
module git.coopgo.io/coopgo-apps/parcoursmob
go 1.18
go 1.21
// replace git.coopgo.io/coopgo-platform/mobility-accounts => ../../coopgo-platform/mobility-accounts/
@ -13,101 +13,110 @@ go 1.18
// replace git.coopgo.io/coopgo-platform/emailing => ../../coopgo-platform/emailing/
require (
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/fogleman/gg v1.3.0
github.com/go-playground/validator/v10 v10.11.0
github.com/google/uuid v1.3.0
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.0
github.com/gorilla/sessions v1.2.1
github.com/paulmach/go.geojson v1.4.0
github.com/spf13/viper v1.13.0
github.com/spf13/viper v1.15.0
gitlab.scity.coop/maas/navitia-golang v0.0.0-20220429110621-5c22d6efdd0c
go.etcd.io/etcd/client/v3 v3.5.4
go.etcd.io/etcd/client/v3 v3.5.6
golang.org/x/image v0.5.0
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
google.golang.org/grpc v1.48.0
google.golang.org/protobuf v1.28.1
golang.org/x/oauth2 v0.21.0
google.golang.org/grpc v1.62.1
google.golang.org/protobuf v1.33.0
)
require (
git.coopgo.io/coopgo-platform/agenda v0.0.0-20230310121901-ef3add576f86
git.coopgo.io/coopgo-platform/emailing v0.0.0-20221017030337-c71888d90c15
git.coopgo.io/coopgo-platform/agenda v1.0.0
git.coopgo.io/coopgo-platform/emailing v0.0.0-20241119141913-9836b30191c1
git.coopgo.io/coopgo-platform/fleets v0.0.0-20230310144446-feb935f8bf4e
git.coopgo.io/coopgo-platform/groups-management v0.0.0-20230310123255-5ef94ee0746c
git.coopgo.io/coopgo-platform/mobility-accounts v0.0.0-20230329105908-a76c0412a386
github.com/coreos/go-oidc/v3 v3.11.0
github.com/gorilla/securecookie v1.1.1
github.com/minio/minio-go/v7 v7.0.43
github.com/ory/viper v1.7.5
github.com/rs/zerolog v1.33.0
github.com/xuri/excelize/v2 v2.7.1
)
require (
github.com/cespare/xxhash v1.1.0 // indirect
ariga.io/atlas v0.12.0 // indirect
github.com/agext/levenshtein v1.2.1 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/dgraph-io/ristretto v0.0.3 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-jose/go-jose/v4 v4.0.2 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.10.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mb0/wkt v0.0.0-20170420051526-a30afd545ee1 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.3 // indirect
github.com/rs/xid v1.4.0 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/tidwall/pretty v1.1.0 // indirect
github.com/twpayne/go-geom v1.3.6 // indirect
github.com/twpayne/go-geom v1.5.7 // indirect
github.com/wneessen/go-mail v0.5.2 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.1 // indirect
github.com/xdg-go/stringprep v1.0.3 // indirect
github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 // indirect
github.com/xuri/nfp v0.0.0-20220409054826-5e722a1d9e22 // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
go.etcd.io/etcd/api/v3 v3.5.4 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect
go.mongodb.org/mongo-driver v1.10.1 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/crypto v0.8.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect
github.com/zclconf/go-cty v1.8.0 // indirect
go.etcd.io/etcd/api/v3 v3.5.6 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.6 // indirect
go.mongodb.org/mongo-driver v1.11.4 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.19.0 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/mail.v2 v2.3.1 // indirect
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
gopkg.in/square/go-jose.v2 v2.5.2-0.20210529014059-a5c7eec3c614 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

292
go.sum
View File

@ -1,3 +1,5 @@
ariga.io/atlas v0.12.0 h1:jDfjxT3ppKhzqLS26lZv9ni7p9TVNrhy7SQquaF7bPs=
ariga.io/atlas v0.12.0/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
@ -36,10 +38,10 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.coopgo.io/coopgo-platform/agenda v0.0.0-20230310121901-ef3add576f86 h1:pSNHhPU8NB35G14QsSyw/XwsTWZo0qGB0U0X0gzqR1s=
git.coopgo.io/coopgo-platform/agenda v0.0.0-20230310121901-ef3add576f86/go.mod h1:7jVyZSz//VW5+jlLeuwc+JJawNUhJZ7Vima+TdVwKfs=
git.coopgo.io/coopgo-platform/emailing v0.0.0-20221017030337-c71888d90c15 h1:+ZI4nGE6mqZ6pc7N/BizheEPRXn6Z84Sj7ikwfP2ZcU=
git.coopgo.io/coopgo-platform/emailing v0.0.0-20221017030337-c71888d90c15/go.mod h1:rmbqiHVkONcECOoPlsXlxZnD315Tiz2oRnn1M7646Kg=
git.coopgo.io/coopgo-platform/agenda v1.0.0 h1:rTHgva1JKKO0wAPlINegifMkHm+xOg3IWW4yQRy334w=
git.coopgo.io/coopgo-platform/agenda v1.0.0/go.mod h1:/hToSla0p6SeWn1zo1MDrfxdmo7RBdZDkbLqCVituIM=
git.coopgo.io/coopgo-platform/emailing v0.0.0-20241119141913-9836b30191c1 h1:gAhJ9wwlitMiETmnD4U2L6xLnVd5xE4hPX72IJ5s7+I=
git.coopgo.io/coopgo-platform/emailing v0.0.0-20241119141913-9836b30191c1/go.mod h1:EXy6NRvFfpW6yIHoZUixldkXrj1qzjCbTHpumDvzaKI=
git.coopgo.io/coopgo-platform/fleets v0.0.0-20230310144446-feb935f8bf4e h1:eHahRTKlC8aBWYCd6LbXNcX8HoQhuZj31OFWrw0EL0U=
git.coopgo.io/coopgo-platform/fleets v0.0.0-20230310144446-feb935f8bf4e/go.mod h1:s9OIFCNcjBAbBzRNHwoCTYV6kAntPG9CpT3GVweGdTY=
git.coopgo.io/coopgo-platform/groups-management v0.0.0-20230310123255-5ef94ee0746c h1:bY7PyrAgYY02f5IpDyf1WVfRqvWzivu31K6aEAYbWCw=
@ -50,27 +52,36 @@ github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DATA-DOG/go-sqlmock v1.3.2/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8=
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/alecthomas/assert/v2 v2.10.0 h1:jjRCHsj6hBJhkmhznrCzoNpbA3zqy0fYiUcYZP/GkPY=
github.com/alecthomas/assert/v2 v2.10.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM=
github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk=
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
@ -79,31 +90,22 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/containerd/continuity v0.0.0-20181203112020-004b46473808/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk=
github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc=
github.com/coreos/go-oidc/v3 v3.11.0 h1:Ia3MxdwpSw702YW0xgfmP1GVCMA9aEFWu12XUZ3/OtI=
github.com/coreos/go-oidc/v3 v3.11.0/go.mod h1:gE3LgjOgFoHi9a4ce4/tJczr0Ai2/BoDhf0r5lltWI0=
github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/d4l3k/messagediff v1.2.1/go.mod h1:Oozbb1TVXFac9FtSIxHBMnBCq2qeH/2KkEQxENCrlLo=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgraph-io/ristretto v0.0.1/go.mod h1:T40EBc7CJke8TkpiYfGGKAeFjSaxuFXhuXRyumBd6RE=
github.com/dgraph-io/ristretto v0.0.3 h1:jh22xisGBjrEVnRZ1DVTpBVQm0Xndu8sMl0CWDzSIBI=
github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@ -112,25 +114,29 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8=
github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-jose/go-jose/v4 v4.0.2 h1:R3l3kkBds16bO7ZFAEEcofK0MkrAJt3jlJznWZG0nvk=
github.com/go-jose/go-jose/v4 v4.0.2/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
@ -140,6 +146,8 @@ github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl
github.com/go-playground/validator/v10 v10.11.0 h1:0W+xRM511GY47Yy3bZUbJVitCNg2BOGlCyvTqsp/xIw=
github.com/go-playground/validator/v10 v10.11.0/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
@ -157,6 +165,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@ -172,8 +181,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@ -188,8 +198,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@ -207,12 +217,11 @@ github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLe
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
@ -226,6 +235,10 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg=
github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/huandu/xstrings v1.3.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
@ -238,25 +251,22 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY=
github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.1.0 h1:eyi1Ad2aNJMW95zcSbmGg7Cg6cq3ADwLpMAP96d8rF0=
github.com/klauspost/cpuid/v2 v2.1.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
@ -264,17 +274,24 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mb0/wkt v0.0.0-20170420051526-a30afd545ee1 h1:VCgV+ng800r1/AChRHzHbWCtQI06cPxoZQUljQHTyXc=
github.com/mb0/wkt v0.0.0-20170420051526-a30afd545ee1/go.mod h1:IhobDa5AIyiMAsnH/qkytD0NbG0JMOJ2ihQqe1NdXyg=
@ -285,7 +302,8 @@ github.com/minio/minio-go/v7 v7.0.43/go.mod h1:nCrRzjoSUQh8hgKKtu3Y708OLvRLtuASM
github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g=
github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM=
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
@ -305,18 +323,11 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U=
github.com/ory/dockertest v3.3.4+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs=
github.com/ory/dockertest/v3 v3.6.0/go.mod h1:4ZOpj8qBUmh8fcBSVzkH2bws2s91JdGvHUqan4GHEuQ=
github.com/ory/viper v1.7.5 h1:+xVdq7SU3e1vNaCsk/ixsfxE4zylk1TJUiJrY647jUE=
github.com/ory/viper v1.7.5/go.mod h1:ypOuyJmEUb3oENywQZRgeAMwqgOyDqwboO1tj3DjTaM=
github.com/paulmach/go.geojson v1.4.0 h1:5x5moCkCtDo5x8af62P9IOAYGQcYHtxz2QJ3x1DoCgY=
github.com/paulmach/go.geojson v1.4.0/go.mod h1:YaKx1hKpWF+T2oj2lFJPsW/t1Q5e1jQI61eoQSTwpIs=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg=
github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas=
github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU=
github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@ -325,8 +336,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8cTqKc=
github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
@ -352,37 +361,36 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY=
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 h1:TToq11gyfNlrMFZiYujSekIsPd9AmsA2Bj/iv+s4JHE=
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo=
github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk=
github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU=
github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw=
github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU=
github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
@ -390,21 +398,25 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tidwall/pretty v1.1.0 h1:K3hMW5epkdAVwibsQEfR/7Zj0Qgt4DxtNumTq/VloO8=
github.com/tidwall/pretty v1.1.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/twpayne/go-geom v1.2.1/go.mod h1:90yvs0wf/gyT5eQ9W4v5WOZ9w/Xnrj5RMlA9XNKqxyA=
github.com/twpayne/go-geom v1.3.6 h1:O27mIXZnMYiZi0ZD8ewjs/IT/ZOFVbZHBzPjA9skdmg=
github.com/twpayne/go-geom v1.3.6/go.mod h1:XTyWHR6+l9TUYONbbK4ImUTYbWDCu2ySSPrZmmiA0Pg=
github.com/twpayne/go-geom v1.5.7 h1:7fdceDUr03/MP7rAKOaTV6x9njMiQdxB/D0PDzMTCDc=
github.com/twpayne/go-geom v1.5.7/go.mod h1:y4fTAQtLedXW8eG2Yo4tYrIGN1yIwwKkmA+K3iSHKBA=
github.com/twpayne/go-kml v1.5.0/go.mod h1:g/OG8Q8JUxqFw8LGXE44W7osn1uXDAYaVFr1Yld43yc=
github.com/twpayne/go-kml v1.5.1/go.mod h1:kz8jAiIz6FIdU2Zjce9qGlVtgFYES9vt7BTPBHf5jl4=
github.com/twpayne/go-polyline v1.0.0/go.mod h1:ICh24bcLYBX8CknfvNPKqoTbe+eg+MX1NPyJmSBo7pU=
github.com/twpayne/go-waypoint v0.0.0-20200706203930-b263a7f6e4e8/go.mod h1:qj5pHncxKhu9gxtZEYWypA/z097sxhFlbTyOyt9gcnU=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/wneessen/go-mail v0.5.2 h1:MZKwgHJoRboLJ+EHMLuHpZc95wo+u1xViL/4XSswDT8=
github.com/wneessen/go-mail v0.5.2/go.mod h1:kRroJvEq2hOSEPFRiKjN7Csrz0G1w+RpiGR3b6yo+Ck=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E=
@ -425,16 +437,20 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
github.com/zclconf/go-cty v1.8.0 h1:s4AvqaeQzJIu3ndv4gVIhplVD0krU+bgrcLSVUnaWuA=
github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8=
gitlab.scity.coop/maas/navitia-golang v0.0.0-20220429110621-5c22d6efdd0c h1:pCazzEsTvjDopl3bvo6H2f2xjo1cDjOZ9QpJRNFCc00=
gitlab.scity.coop/maas/navitia-golang v0.0.0-20220429110621-5c22d6efdd0c/go.mod h1:M1U2osA6dYQF8zuJOTb/0O1F/Xgcb+4AkRdw+Un6Rp4=
go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc=
go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg=
go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4=
go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY=
go.mongodb.org/mongo-driver v1.10.1 h1:NujsPveKwHaWuKUer/ceo9DzEe7HIj1SlJ6uvXZG0S4=
go.mongodb.org/mongo-driver v1.10.1/go.mod h1:z4XpeoU6w+9Vht+jAFyLgVrD+jGSQQe0+CBWFHNiHt8=
go.etcd.io/etcd/api/v3 v3.5.6 h1:Cy2qx3npLcYqTKqGJzMypnMv2tiRyifZJ17BlWIWA7A=
go.etcd.io/etcd/api/v3 v3.5.6/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8=
go.etcd.io/etcd/client/pkg/v3 v3.5.6 h1:TXQWYceBKqLp4sa87rcPs11SXxUA/mHwH975v+BDvLU=
go.etcd.io/etcd/client/pkg/v3 v3.5.6/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ=
go.etcd.io/etcd/client/v3 v3.5.6 h1:coLs69PWCXE9G4FKquzNaSHrRyMCAXwF+IX1tAPVO8E=
go.etcd.io/etcd/client/v3 v3.5.6/go.mod h1:f6GRinRMCsFVv9Ht42EyY7nfsVGwrNO0WEoS2pRKzQk=
go.mongodb.org/mongo-driver v1.11.4 h1:4ayjakA013OdpGyL2K3ZqylTac/rMjrJOMZ1EHizXas=
go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
@ -442,27 +458,36 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U=
go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=
go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8=
go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@ -502,7 +527,11 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -516,7 +545,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@ -538,11 +566,15 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -552,8 +584,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE=
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -566,8 +598,12 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -577,20 +613,18 @@ golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200121082415-34d275377bf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -620,19 +654,32 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@ -643,8 +690,12 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@ -654,13 +705,11 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
@ -700,8 +749,11 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@ -731,7 +783,6 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
@ -771,8 +822,12 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I=
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ=
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro=
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU=
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7 h1:8EeVk1VKMD+GD/neyEHGmz7pFblqPjHoi+PGQIlLx2s=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@ -792,9 +847,9 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w=
google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k=
google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@ -807,10 +862,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
@ -820,21 +873,17 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/mail.v2 v2.3.1 h1:WYFn/oANrAGP2C0dcV6/pbkPzv8yGzqTjPmTeO7qoXk=
gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw=
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw=
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
gopkg.in/square/go-jose.v2 v2.5.2-0.20210529014059-a5c7eec3c614 h1:lwJmuuJQGclcankpPJwh8rorzB0bNbVALv8phDGh8TQ=
gopkg.in/square/go-jose.v2 v2.5.2-0.20210529014059-a5c7eec3c614/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
@ -844,7 +893,6 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

0
handlers/api/api.go Normal file → Executable file
View File

81
handlers/api/cache.go Normal file → Executable file
View File

@ -2,50 +2,69 @@ package api
import (
"encoding/json"
"fmt"
"net/http"
"strconv"
"github.com/rs/zerolog/log"
"github.com/gorilla/mux"
)
func (h APIHandler) GetCache(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
cacheid := vars["cacheid"]
d, err := h.cache.Get(cacheid)
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusNotFound)
return
}
result := d
if data, ok := d.([]any); ok {
if limitsmin, ok := r.URL.Query()["limits.min"]; ok {
min, _ := strconv.Atoi(limitsmin[0])
if limitsmax, ok := r.URL.Query()["limits.max"]; ok {
max, _ := strconv.Atoi(limitsmax[0])
if max > len(data) {
result = data[min:]
} else {
result = data[min:max]
}
} else {
result = data[min:]
}
// Use a channel to synchronize the goroutines
ch := make(chan []byte)
// Fetch data from cache asynchronously
go func() {
d, err := h.cache.Get(cacheid)
if err != nil {
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusNotFound)
ch <- nil
return
}
var data []any
if val, ok := d.([]any); ok {
data = val
} else {
data = []any{d}
}
j := toJSON(data, w, r)
ch <- j // Signal that the data has been fetched successfully
close(ch)
}()
// wait for the JSON marshaling goroutine to finish
j := <-ch
if j == nil {
return // Stop processing if an error occurred
}
j, err := json.Marshal(result)
if err != nil {
w.WriteHeader(http.StatusNotFound)
return
}
// Send the JSON response to the client
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "application/json")
w.Write(j)
<-ch
}
func toJSON(data []any, w http.ResponseWriter, r *http.Request) []byte {
result := data
if limitsmin, ok := r.URL.Query()["limits.min"]; ok {
min, _ := strconv.Atoi(limitsmin[0])
if limitsmax, ok := r.URL.Query()["limits.max"]; ok {
max, _ := strconv.Atoi(limitsmax[0])
if max > len(data) {
result = data[min:]
} else {
result = data[min:max]
}
} else {
result = data[min:]
}
}
j, err := json.Marshal(result)
if err != nil {
w.WriteHeader(http.StatusNotFound)
return nil
}
return j
}

6
handlers/api/export.go Normal file → Executable file
View File

@ -8,6 +8,7 @@ import (
"strconv"
"github.com/gorilla/mux"
"github.com/rs/zerolog/log"
)
type FlatMaps []map[string]any
@ -48,7 +49,7 @@ func (h APIHandler) CacheExport(w http.ResponseWriter, r *http.Request) {
d, err := h.cache.Get(cacheid)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Error getting cache")
w.WriteHeader(http.StatusNotFound)
return
}
@ -56,7 +57,6 @@ func (h APIHandler) CacheExport(w http.ResponseWriter, r *http.Request) {
if data, ok := d.([]any); ok {
flatmaps := FlatMaps{}
//fmt.Println(data)
for _, v := range data {
fm := map[string]any{}
@ -90,7 +90,7 @@ func flatten(prefix string, src map[string]any, dest map[string]any) {
dest[prefix+k+"."+strconv.Itoa(i)] = child[i]
}
default:
fmt.Println(prefix+k, " : ", v)
// log.Trace().Str("key", prefix+k).Any("value", v).Msg("")
dest[prefix+k] = v
}
}

0
handlers/api/geo.go Normal file → Executable file
View File

13
handlers/api/oidc.go Normal file → Executable file
View File

@ -2,15 +2,15 @@ package api
import (
"context"
"fmt"
"net/http"
"github.com/rs/zerolog/log"
)
func (h APIHandler) OAuth2Callback(w http.ResponseWriter, r *http.Request) {
oauth2Token, err := h.idp.OAuth2Config.Exchange(context.Background(), r.URL.Query().Get("code"))
if err != nil {
fmt.Println("Exchange error")
fmt.Println(err)
log.Error().Err(err).Msg("Exchange error")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -18,15 +18,14 @@ func (h APIHandler) OAuth2Callback(w http.ResponseWriter, r *http.Request) {
// Extract the ID Token from OAuth2 token.
rawIDToken, ok := oauth2Token.Extra("id_token").(string)
if !ok {
fmt.Println("issue retrieving token")
log.Error().Msg("Cannot retrieve ID token")
w.WriteHeader(http.StatusInternalServerError)
return
}
_, err = h.idp.TokenVerifier.Verify(context.Background(), rawIDToken)
if err != nil {
fmt.Println("not able to verify token")
fmt.Println(err)
log.Error().Err(err).Msg("Not able to verify token")
w.WriteHeader(http.StatusUnauthorized)
return
}
@ -42,7 +41,7 @@ func (h APIHandler) OAuth2Callback(w http.ResponseWriter, r *http.Request) {
}
if err = session.Save(r, w); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Cannot save session")
w.WriteHeader(http.StatusInternalServerError)
return
}

478
handlers/application/administration.go Normal file → Executable file
View File

@ -8,6 +8,7 @@ import (
"io"
"net/http"
"sort"
"sync"
"time"
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
@ -23,83 +24,95 @@ import (
mobilityaccountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/rs/zerolog/log"
"google.golang.org/protobuf/types/known/structpb"
)
func (h *ApplicationHandler) Administration(w http.ResponseWriter, r *http.Request) {
accounts, err := h.services.GetAccounts()
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
beneficiaries, err := h.services.GetBeneficiaries()
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
bookings, err := h.services.GetBookings()
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
request := &groupsmanagement.GetGroupsRequest{
Namespaces: []string{"parcoursmob_organizations"},
}
resp, err := h.services.GRPC.GroupsManagement.GetGroups(context.TODO(), request)
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
var groups = []groupstorage.Group{}
for _, group := range resp.Groups {
g := group.ToStorageType()
groups = append(groups, g)
}
sort.Sort(sorting.GroupsByName(groups))
////////////////////////////////////add event////////////////////////////////////////////
rresp, err := h.services.GRPC.Agenda.GetEvents(context.TODO(), &agenda.GetEventsRequest{
Namespaces: []string{"parcoursmob_dispositifs"},
})
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
responses := []agendastorage.Event{}
groupids := []string{}
for _, e := range rresp.Events {
groupids = append(groupids, e.Owners...)
responses = append(responses, e.ToStorageType())
}
sort.Sort(sorting.EventsByStartdate(responses))
groupsresp, err := h.services.GRPC.GroupsManagement.GetGroupsBatch(context.TODO(), &groupsmanagement.GetGroupsBatchRequest{
Groupids: groupids,
})
groupps := map[string]any{}
if err == nil {
for _, g := range groupsresp.Groups {
groupps[g.Id] = g.ToStorageType()
var (
wg sync.WaitGroup
accounts, beneficiaries []mobilityaccountsstorage.Account
bookings []fleetsstorage.Booking
accountsErr, beneficiariesErr, bookingsErr, groupsResponseErr, eventsResponseErr, groupsBatchErr error
groups = []groupstorage.Group{}
responses = []agendastorage.Event{}
groupsResponse *groupsmanagement.GetGroupsResponse
eventsResponse *agenda.GetEventsResponse
groupids = []string{}
groupsBatchResponse *groupsmanagement.GetGroupsBatchResponse
)
// Retrieve accounts in a goroutine
wg.Add(1)
go func() {
defer wg.Done()
accounts, accountsErr = h.services.GetAccounts()
}()
// Retrieve beneficiaries in a goroutine
wg.Add(1)
go func() {
defer wg.Done()
beneficiaries, beneficiariesErr = h.services.GetBeneficiaries()
}()
// Retrieve bookings in a goroutine
wg.Add(1)
go func() {
defer wg.Done()
bookings, bookingsErr = h.services.GetBookings()
}()
// Retrieve groupsRequest in a goroutine
wg.Add(1)
go func() {
defer wg.Done()
request := &groupsmanagement.GetGroupsRequest{
Namespaces: []string{"parcoursmob_organizations"},
}
groupsResponse, groupsResponseErr = h.services.GRPC.GroupsManagement.GetGroups(context.TODO(), request)
for _, group := range groupsResponse.Groups {
g := group.ToStorageType()
groups = append(groups, g)
}
sort.Sort(sorting.GroupsByName(groups))
}()
// Retrieve Events in a goroutine
wg.Add(1)
go func() {
defer wg.Done()
eventsResponse, eventsResponseErr = h.services.GRPC.Agenda.GetEvents(context.TODO(), &agenda.GetEventsRequest{
Namespaces: []string{"parcoursmob_dispositifs"},
})
for _, e := range eventsResponse.Events {
groupids = append(groupids, e.Owners...)
responses = append(responses, e.ToStorageType())
}
sort.Sort(sorting.EventsByStartdate(responses))
}()
wg.Add(1)
// Retrieve groupsBatch in a goroutine
go func() {
defer wg.Done()
groupsBatchResponse, groupsBatchErr = h.services.GRPC.GroupsManagement.GetGroupsBatch(context.TODO(), &groupsmanagement.GetGroupsBatchRequest{
Groupids: groupids,
})
groupps := map[string]any{}
if groupsBatchErr == nil {
for _, g := range groupsBatchResponse.Groups {
groupps[g.Id] = g.ToStorageType()
}
}
}()
wg.Wait()
if accountsErr != nil || beneficiariesErr != nil || bookingsErr != nil || groupsResponseErr != nil || eventsResponseErr != nil {
log.Error().
Any("accounts error", accountsErr).
Any("beneficiaries error", beneficiariesErr).
Any("bookings error", bookingsErr).
Any("groups response error", groupsResponseErr).
Any("events response error", eventsResponseErr).
Any("groups batch error", groupsBatchErr).
Msg("Error in retrieving administration data")
w.WriteHeader(http.StatusInternalServerError)
return
}
h.Renderer.Administration(w, r, accounts, beneficiaries, groups, bookings, responses)
}
@ -109,7 +122,7 @@ func (h *ApplicationHandler) AdministrationCreateGroup(w http.ResponseWriter, r
if r.FormValue("name") == "" {
fmt.Println("invalid name")
log.Error().Str("name", r.FormValue("name")).Msg("Invalid name")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -136,7 +149,7 @@ func (h *ApplicationHandler) AdministrationCreateGroup(w http.ResponseWriter, r
data, err := structpb.NewValue(dataMap)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Cannot create PB struct from data map")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -155,22 +168,23 @@ func (h *ApplicationHandler) AdministrationCreateGroup(w http.ResponseWriter, r
Namespace: "parcoursmob_roles",
},
}
_, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_organization)
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
go func() {
_, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_organization)
if err != nil {
log.Error().Err(err).Msg("Issue in Groups management service - AddGroup")
w.WriteHeader(http.StatusInternalServerError)
return
}
}()
// Create the admin role for the organization
_, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_role)
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
go func() {
_, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_role)
if err != nil {
log.Error().Err(err).Msg("Issue in Groups management service - AddGroup")
w.WriteHeader(http.StatusInternalServerError)
return
}
}()
http.Redirect(w, r, fmt.Sprintf("/app/administration/groups/%s", groupid), http.StatusFound)
return
}
@ -187,14 +201,14 @@ func (h *ApplicationHandler) AdministrationGroupDisplay(w http.ResponseWriter, r
resp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Issue in Groups management service - GetGroup")
w.WriteHeader(http.StatusInternalServerError)
return
}
groupmembers, admins, err := h.groupmembers(groupid)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("inssue retrieving group members")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -205,165 +219,165 @@ func (h *ApplicationHandler) AdministrationGroupDisplay(w http.ResponseWriter, r
func (h *ApplicationHandler) AdministrationGroupInviteAdmin(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
groupid := vars["groupid"]
var (
groupresp *groupsmanagement.GetGroupResponse
accountresp *accounts.GetAccountUsernameResponse
err error
)
go func() {
groupresp, err = h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), &groupsmanagement.GetGroupRequest{
Id: groupid,
Namespace: "parcoursmob_organizations",
})
groupresp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), &groupsmanagement.GetGroupRequest{
Id: groupid,
Namespace: "parcoursmob_organizations",
})
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
if err != nil {
log.Error().Err(err).Msg("Issue in Groups management service - GetGroup")
w.WriteHeader(http.StatusInternalServerError)
return
}
}()
r.ParseForm()
accountresp, err := h.services.GRPC.MobilityAccounts.GetAccountUsername(context.TODO(), &accounts.GetAccountUsernameRequest{
Username: r.FormValue("username"),
Namespace: "parcoursmob",
})
go func() {
accountresp, err = h.services.GRPC.MobilityAccounts.GetAccountUsername(context.TODO(), &accounts.GetAccountUsernameRequest{
Username: r.FormValue("username"),
Namespace: "parcoursmob",
})
if err == nil {
// Account already exists : adding the existing account to admin list
account := accountresp.Account.ToStorageType()
account.Data["groups"] = append(account.Data["groups"].([]any), groupid, groupid)
account.Data["groups"] = append(account.Data["groups"].([]any), groupid, groupid+":admin")
if err == nil {
// Account already exists : adding the existing account to admin list
account := accountresp.Account.ToStorageType()
account.Data["groups"] = append(account.Data["groups"].([]any), groupid, groupid)
account.Data["groups"] = append(account.Data["groups"].([]any), groupid, groupid+":admin")
as, _ := accounts.AccountFromStorageType(&account)
as, _ := accounts.AccountFromStorageType(&account)
_, err = h.services.GRPC.MobilityAccounts.UpdateData(
context.TODO(),
&accounts.UpdateDataRequest{
Account: as,
},
)
_, err = h.services.GRPC.MobilityAccounts.UpdateData(
context.TODO(),
&accounts.UpdateDataRequest{
Account: as,
},
)
data := map[string]any{
"group": groupresp.Group.ToStorageType().Data["name"],
}
fmt.Println(err)
if err := h.emailing.Send("onboarding.existing_administrator", r.FormValue("username"), data); err != nil {
log.Error().Err(err).Msg("Cannot send email")
}
data := map[string]any{
"group": groupresp.Group.ToStorageType().Data["name"],
}
http.Redirect(w, r, fmt.Sprintf("/app/administration/groups/%s", groupid), http.StatusFound)
return
} else {
// Onboard now administrator
onboarding := map[string]any{
"username": r.FormValue("username"),
"group": groupid,
"admin": true,
}
if err := h.emailing.Send("onboarding.existing_administrator", r.FormValue("username"), data); err != nil {
fmt.Println(err)
b := make([]byte, 16)
if _, err := io.ReadFull(rand.Reader, b); err != nil {
log.Error().Err(err).Msg("Issue creating random bytes")
w.WriteHeader(http.StatusInternalServerError)
return
}
key := base64.RawURLEncoding.EncodeToString(b)
h.cache.PutWithTTL("onboarding/"+key, onboarding, 168*time.Hour) // 1 week TTL
data := map[string]any{
"group": groupresp.Group.ToStorageType().Data["name"],
"key": key,
}
if err := h.emailing.Send("onboarding.new_administrator", r.FormValue("username"), data); err != nil {
log.Error().Err(err).Msg("Cannot send email")
w.WriteHeader(http.StatusInternalServerError)
return
}
}
http.Redirect(w, r, fmt.Sprintf("/app/administration/groups/%s", groupid), http.StatusFound)
return
} else {
// Onboard now administrator
onboarding := map[string]any{
"username": r.FormValue("username"),
"group": groupid,
"admin": true,
}
b := make([]byte, 16)
if _, err := io.ReadFull(rand.Reader, b); err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
key := base64.RawURLEncoding.EncodeToString(b)
h.cache.PutWithTTL("onboarding/"+key, onboarding, 168*time.Hour) // 1 week TTL
data := map[string]any{
"group": groupresp.Group.ToStorageType().Data["name"],
"key": key,
}
if err := h.emailing.Send("onboarding.new_administrator", r.FormValue("username"), data); err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
}
http.Redirect(w, r, fmt.Sprintf("/app/administration/groups/%s", groupid), http.StatusFound)
return
}()
}
func (h *ApplicationHandler) AdministrationGroupInviteMember(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
groupid := vars["groupid"]
var (
group storage.Group
)
groupCh := make(chan storage.Group)
go func() {
groupresp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), &groupsmanagement.GetGroupRequest{
Id: groupid,
Namespace: "parcoursmob_organizations",
})
groupresp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), &groupsmanagement.GetGroupRequest{
Id: groupid,
Namespace: "parcoursmob_organizations",
})
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
group := groupresp.Group.ToStorageType()
if err != nil {
log.Error().Err(err).Msg("Issue in Groups management service - GetGroup")
w.WriteHeader(http.StatusInternalServerError)
return
}
group := groupresp.Group.ToStorageType()
groupCh <- group
}()
r.ParseForm()
go func() {
group = <-groupCh
accountresp, err := h.services.GRPC.MobilityAccounts.GetAccountUsername(context.TODO(), &accounts.GetAccountUsernameRequest{
Username: r.FormValue("username"),
Namespace: "parcoursmob",
})
if err == nil {
account := accountresp.Account.ToStorageType()
account.Data["groups"] = append(account.Data["groups"].([]any), group.ID)
accountresp, err := h.services.GRPC.MobilityAccounts.GetAccountUsername(context.TODO(), &accounts.GetAccountUsernameRequest{
Username: r.FormValue("username"),
Namespace: "parcoursmob",
})
as, _ := accounts.AccountFromStorageType(&account)
if err == nil {
account := accountresp.Account.ToStorageType()
account.Data["groups"] = append(account.Data["groups"].([]any), group.ID)
_, err = h.services.GRPC.MobilityAccounts.UpdateData(
context.TODO(),
&accounts.UpdateDataRequest{
Account: as,
},
)
data := map[string]any{
"group": group.Data["name"],
}
as, _ := accounts.AccountFromStorageType(&account)
if err := h.emailing.Send("onboarding.existing_member", r.FormValue("username"), data); err != nil {
}
_, err = h.services.GRPC.MobilityAccounts.UpdateData(
context.TODO(),
&accounts.UpdateDataRequest{
Account: as,
},
)
fmt.Println(err)
data := map[string]any{
"group": group.Data["name"],
}
if err := h.emailing.Send("onboarding.existing_member", r.FormValue("username"), data); err != nil {
fmt.Println(err)
}
http.Redirect(w, r, "/app/group/settings", http.StatusFound)
return
} else {
// Onboard now administrator
onboarding := map[string]any{
"username": r.FormValue("username"),
"group": group.ID,
"admin": false,
}
b := make([]byte, 16)
if _, err := io.ReadFull(rand.Reader, b); err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
http.Redirect(w, r, "/app/group/settings", http.StatusFound)
return
} else {
// Onboard now administrator
onboarding := map[string]any{
"username": r.FormValue("username"),
"group": group.ID,
"admin": false,
}
b := make([]byte, 16)
if _, err := io.ReadFull(rand.Reader, b); err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
key := base64.RawURLEncoding.EncodeToString(b)
h.cache.PutWithTTL("onboarding/"+key, onboarding, 168*time.Hour) // 1 week TTL
data := map[string]any{
"group": group.Data["name"],
"key": key,
}
if err := h.emailing.Send("onboarding.new_member", r.FormValue("username"), data); err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
}
key := base64.RawURLEncoding.EncodeToString(b)
h.cache.PutWithTTL("onboarding/"+key, onboarding, 168*time.Hour) // 1 week TTL
data := map[string]any{
"group": group.Data["name"],
"key": key,
}
if err := h.emailing.Send("onboarding.new_member", r.FormValue("username"), data); err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
}
}()
http.Redirect(w, r, "/app/administration/groups/"+group.ID, http.StatusFound)
return
}
@ -394,7 +408,7 @@ func (h ApplicationHandler) AdminStatVehicles(w http.ResponseWriter, r *http.Req
}
reesp, err := h.services.GRPC.Fleets.GetVehicles(context.TODO(), reequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Issue in Fleets service - GetVehicles")
w.WriteHeader(http.StatusInternalServerError)
}
@ -432,7 +446,7 @@ func (h ApplicationHandler) AdminStatVehicles(w http.ResponseWriter, r *http.Req
Groupids: administrators,
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Issue in Groups management service - GetGroupsBatch")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -457,7 +471,7 @@ func (h ApplicationHandler) AdminStatBookings(w http.ResponseWriter, r *http.Req
}
reesp, err := h.services.GRPC.Fleets.GetVehicles(context.TODO(), reequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Issue in Fleets service - GetVehicles")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -483,7 +497,7 @@ func (h ApplicationHandler) AdminStatBookings(w http.ResponseWriter, r *http.Req
Namespaces: []string{"parcoursmob_organizations"},
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Issue in Groups management service - GetGroups")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -496,7 +510,7 @@ func (h ApplicationHandler) AdminStatBookings(w http.ResponseWriter, r *http.Req
Accountids: beneficiaries_ids,
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Issue in Mobility accounts service - GetAccountsBatch")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -525,7 +539,7 @@ func (h *ApplicationHandler) groupmembers(groupid string) (groupmembers []mobili
members, err := h.members()
if err != nil {
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Cannot get members")
return nil, nil, err
}
}
@ -551,7 +565,7 @@ func (h *ApplicationHandler) groupmembers(groupid string) (groupmembers []mobili
func (h ApplicationHandler) AdminStatBeneficaires(w http.ResponseWriter, r *http.Request) {
beneficiaries, err := h.services.GetBeneficiaries()
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Cannot get beneficiaries")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -566,7 +580,7 @@ func (h ApplicationHandler) AdminStatEvents(w http.ResponseWriter, r *http.Reque
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("Issue in Agenda service - GetEvents")
w.WriteHeader(http.StatusInternalServerError)
return
}

169
handlers/application/agenda.go Normal file → Executable file
View File

@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"sort"
"strconv"
@ -13,12 +14,15 @@ import (
formvalidators "git.coopgo.io/coopgo-apps/parcoursmob/utils/form-validators"
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
"git.coopgo.io/coopgo-apps/parcoursmob/utils/sorting"
filestorage "git.coopgo.io/coopgo-apps/parcoursmob/utils/storage"
agenda "git.coopgo.io/coopgo-platform/agenda/grpcapi"
agendastorage "git.coopgo.io/coopgo-platform/agenda/storage"
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
"git.coopgo.io/coopgo-platform/groups-management/storage"
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/rs/zerolog/log"
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/timestamppb"
)
@ -43,7 +47,7 @@ func (h *ApplicationHandler) AgendaHome(w http.ResponseWriter, r *http.Request)
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -78,7 +82,7 @@ func (h *ApplicationHandler) AgendaHistory(w http.ResponseWriter, r *http.Reques
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -119,10 +123,12 @@ func (h *ApplicationHandler) AgendaCreateEvent(w http.ResponseWriter, r *http.Re
eventForm, err := parseEventsForm(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
log.Debug().Any("eventFrom", eventForm).Msg("Form data submitted to create event")
data, _ := structpb.NewStruct(map[string]any{
"address": eventForm.Address,
@ -147,17 +153,52 @@ func (h *ApplicationHandler) AgendaCreateEvent(w http.ResponseWriter, r *http.Re
}
resp, err := h.services.GRPC.Agenda.CreateEvent(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
contentType := r.Header.Get("Content-Type")
if strings.HasPrefix(contentType, "multipart/form-data") {
err = r.ParseMultipartForm(100 * 1024 * 1024) // 100 MB limit
if err != nil {
log.Error().Err(err).Msg("Error parsing multipart form")
w.WriteHeader(http.StatusBadRequest)
return
}
file, header, err := r.FormFile("file-upload")
if err == nil {
defer file.Close()
document_type := r.FormValue("file_type")
document_name := r.FormValue("file_name")
fileid := uuid.NewString()
metadata := map[string]string{
"file_type": document_type,
"file_name": document_name,
}
if err := h.filestorage.Put(file, filestorage.PREFIX_AGENDA, fmt.Sprintf("%s/%s_%s", resp.Event.Id, fileid, header.Filename), header.Size, metadata); err != nil {
log.Error().Err(err).Msg("Error uploading file")
w.WriteHeader(http.StatusInternalServerError)
return
}
} else if err != http.ErrMissingFile {
log.Error().Err(err).Msg("Error retrieving file")
w.WriteHeader(http.StatusInternalServerError)
return
}
}
http.Redirect(w, r, fmt.Sprintf("/app/agenda/%s", resp.Event.Id), http.StatusFound)
return
}
h.Renderer.AgendaCreateEvent(w, r)
h.Renderer.AgendaCreateEvent(w, r, h.config.GetStringSlice("modules.agenda.documents_types"), h.config.GetStringMapString("storage.files.file_types"), nil)
}
func (h *ApplicationHandler) AgendaDisplayEvent(w http.ResponseWriter, r *http.Request) {
@ -170,7 +211,7 @@ func (h *ApplicationHandler) AgendaDisplayEvent(w http.ResponseWriter, r *http.R
resp, err := h.services.GRPC.Agenda.GetEvent(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -181,7 +222,7 @@ func (h *ApplicationHandler) AgendaDisplayEvent(w http.ResponseWriter, r *http.R
groupresp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), grouprequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -208,7 +249,7 @@ func (h *ApplicationHandler) AgendaDisplayEvent(w http.ResponseWriter, r *http.R
g := r.Context().Value(identification.GroupKey)
if g == nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -237,19 +278,24 @@ func (h *ApplicationHandler) AgendaDisplayEvent(w http.ResponseWriter, r *http.R
}
}
h.Renderer.AgendaDisplayEvent(w, r, resp.Event.ToStorageType(), groupresp.Group.ToStorageType(), subscribers, accounts)
documents := h.filestorage.List(filestorage.PREFIX_AGENDA + "/" + eventid)
events_file_types := h.config.GetStringSlice("modules.agenda.documents_types")
file_types_map := h.config.GetStringMapString("storage.files.file_types")
h.Renderer.AgendaDisplayEvent(w, r, resp.Event.ToStorageType(), groupresp.Group.ToStorageType(), events_file_types, file_types_map, documents, subscribers, accounts)
}
func (h *ApplicationHandler) AgendaSubscribeEvent(w http.ResponseWriter, r *http.Request) {
current_group, err := h.currentGroup(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
current_user_token, current_user_claims, err := h.currentUser(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -257,7 +303,7 @@ func (h *ApplicationHandler) AgendaSubscribeEvent(w http.ResponseWriter, r *http
eventid := vars["eventid"]
if err := r.ParseForm(); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -277,7 +323,7 @@ func (h *ApplicationHandler) AgendaSubscribeEvent(w http.ResponseWriter, r *http
}
datapb, err := structpb.NewStruct(data)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -290,7 +336,7 @@ func (h *ApplicationHandler) AgendaSubscribeEvent(w http.ResponseWriter, r *http
_, err = h.services.GRPC.Agenda.SubscribeEvent(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -366,7 +412,7 @@ func contains(s []*agenda.Subscription, e string) bool {
return false
}
///////////////////////////////Update Event/////////////////////////////////////////
// /////////////////////////////Update Event/////////////////////////////////////////
func (h *ApplicationHandler) AgendaUpdateEvent(w http.ResponseWriter, r *http.Request) {
adm := strings.Split(r.URL.Path, "/")
eventID := adm[3]
@ -376,7 +422,7 @@ func (h *ApplicationHandler) AgendaUpdateEvent(w http.ResponseWriter, r *http.Re
resp, err := h.services.GRPC.Agenda.GetEvent(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -391,7 +437,7 @@ func (h *ApplicationHandler) AgendaUpdateEvent(w http.ResponseWriter, r *http.Re
eventForm, err := parseEventsForm(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -422,7 +468,7 @@ func (h *ApplicationHandler) AgendaUpdateEvent(w http.ResponseWriter, r *http.Re
resp, err := h.services.GRPC.Agenda.UpdateEvent(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -443,7 +489,7 @@ func (h *ApplicationHandler) AgendaDeleteEvent(w http.ResponseWriter, r *http.Re
resp, err := h.services.GRPC.Agenda.GetEvent(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -473,7 +519,7 @@ func (h *ApplicationHandler) AgendaDeleteEvent(w http.ResponseWriter, r *http.Re
_, err := h.services.GRPC.Agenda.UpdateEvent(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -484,7 +530,7 @@ func (h *ApplicationHandler) AgendaDeleteEvent(w http.ResponseWriter, r *http.Re
h.Renderer.AgendaDeleteEvent(w, r, resp.Event.ToStorageType())
}
///////////////////////////Delete subscriber///////////////////////////////
// /////////////////////////Delete subscriber///////////////////////////////
func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
eventId := vars["eventid"]
@ -500,7 +546,7 @@ func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r
resp, err := h.services.GRPC.Agenda.GetEvent(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -522,14 +568,14 @@ func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r
current_group, err := h.currentGroup(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
current_user_token, current_user_claims, err := h.currentUser(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -562,7 +608,7 @@ func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r
datapb, err := structpb.NewStruct(data)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -583,18 +629,18 @@ func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r
// récupérer l'adresse mail de l'utilisateur qui a créé l'événement
mail := s_b_email
fmt.Println(mail)
log.Debug().Str("mail", mail).Msg("Email content")
_, err := h.services.GRPC.Agenda.DeleteSubscription(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
if err := h.emailing.Send("delete_subscriber.request", mail, data); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -605,7 +651,7 @@ func (h *ApplicationHandler) AgendaDeleteSubscribeEvent(w http.ResponseWriter, r
h.Renderer.AgendaDeleteSubscribeEvent(w, r, eventId)
}
////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////
// /////////////////////History Event////////////////////////
func (h *ApplicationHandler) AgendaHistoryEvent(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
@ -616,7 +662,7 @@ func (h *ApplicationHandler) AgendaHistoryEvent(w http.ResponseWriter, r *http.R
resp, err := h.services.GRPC.Agenda.GetEvent(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -627,7 +673,7 @@ func (h *ApplicationHandler) AgendaHistoryEvent(w http.ResponseWriter, r *http.R
groupresp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), grouprequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -654,7 +700,6 @@ func (h *ApplicationHandler) AgendaHistoryEvent(w http.ResponseWriter, r *http.R
g := r.Context().Value(identification.GroupKey)
if g == nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -685,3 +730,61 @@ func (h *ApplicationHandler) AgendaHistoryEvent(w http.ResponseWriter, r *http.R
h.Renderer.AgendaHistoryEvent(w, r, resp.Event.ToStorageType(), groupresp.Group.ToStorageType(), subscribers, accounts)
}
// //// ADD DOCUMENTS //////
func (h *ApplicationHandler) EventDocuments(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
eventID := vars["eventid"]
//r.ParseForm()
r.ParseMultipartForm(100 * 1024 * 1024)
document_type := r.FormValue("type")
document_name := r.FormValue("name")
file, header, err := r.FormFile("file-upload")
if err != nil {
log.Error().Err(err).Msg("")
return
}
defer file.Close()
fileid := uuid.NewString()
metadata := map[string]string{
"type": document_type,
"name": document_name,
}
if err := h.filestorage.Put(file, filestorage.PREFIX_AGENDA, fmt.Sprintf("%s/%s_%s", eventID, fileid, header.Filename), header.Size, metadata); err != nil {
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
http.Redirect(w, r, fmt.Sprintf("/app/agenda/%s", eventID), http.StatusFound)
}
func (h *ApplicationHandler) EventDocumentDownload(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
eventID := vars["eventid"]
document := vars["document"]
file, info, err := h.filestorage.Get(filestorage.PREFIX_AGENDA, fmt.Sprintf("%s/%s", eventID, document))
if err != nil {
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", info.ContentType)
if _, err = io.Copy(w, file); err != nil {
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
http.Redirect(w, r, fmt.Sprintf("/app/agenda/%s", eventID), http.StatusFound)
}

2
handlers/application/application.go Normal file → Executable file
View File

@ -10,7 +10,7 @@ import (
cache "git.coopgo.io/coopgo-apps/parcoursmob/utils/storage"
"git.coopgo.io/coopgo-platform/emailing"
"git.coopgo.io/coopgo-platform/groups-management/storage"
"github.com/coreos/go-oidc"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/spf13/viper"
)

209
handlers/application/beneficiaries.go Normal file → Executable file
View File

@ -8,7 +8,6 @@ import (
"fmt"
"image/png"
"io"
"log"
"net/http"
"sort"
"strconv"
@ -20,13 +19,17 @@ import (
profilepictures "git.coopgo.io/coopgo-apps/parcoursmob/utils/profile-pictures"
"git.coopgo.io/coopgo-apps/parcoursmob/utils/sorting"
filestorage "git.coopgo.io/coopgo-apps/parcoursmob/utils/storage"
agenda "git.coopgo.io/coopgo-platform/agenda/grpcapi"
agendastorage "git.coopgo.io/coopgo-platform/agenda/storage"
fleets "git.coopgo.io/coopgo-platform/fleets/grpcapi"
fleetsstorage "git.coopgo.io/coopgo-platform/fleets/storage"
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
"git.coopgo.io/coopgo-platform/groups-management/storage"
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
mobilityaccountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/rs/zerolog/log"
"google.golang.org/protobuf/types/known/structpb"
)
@ -41,11 +44,72 @@ type BeneficiariesForm struct {
Gender string `json:"gender"`
}
type Event_Beneficiary interface {
Name() string
Date() time.Time
DateEnd() time.Time
Type() string
Db() string
ID() string
Icons() string
Status() int
}
type Event struct {
IDVal string
NameVal string
DateVal time.Time
DateEndVal time.Time
TypeVal string
DbVal string
Deleted bool
IconSet string
StatusVal int
}
func (e Event) Name() string {
return e.NameVal
}
func (e Event) Date() time.Time {
return e.DateVal
}
func (e Event) DateEnd() time.Time {
return e.DateEndVal
}
func (e Event) Type() string {
return e.TypeVal
}
func (e Event) ID() string {
return e.IDVal
}
func (e Event) Db() string {
return e.DbVal
}
func (e Event) Icons() string {
return e.IconSet
}
func (e Event) Status() int {
return e.StatusVal
}
func sortByDate(events []Event_Beneficiary) {
sort.Slice(events, func(i, j int) bool {
return events[i].Date().After(events[j].Date())
})
}
func (h *ApplicationHandler) BeneficiariesList(w http.ResponseWriter, r *http.Request) {
accounts, err := h.beneficiaries(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -60,7 +124,7 @@ func (h *ApplicationHandler) BeneficiariesList(w http.ResponseWriter, r *http.Re
func (h *ApplicationHandler) BeneficiaryCreate(w http.ResponseWriter, r *http.Request) {
g := r.Context().Value(identification.GroupKey)
if g == nil {
fmt.Println("Create beneficiary : could not find group")
log.Error().Msg("Create beneficiary : could not find group")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -71,14 +135,14 @@ func (h *ApplicationHandler) BeneficiaryCreate(w http.ResponseWriter, r *http.Re
dataMap, err := parseBeneficiariesForm(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
data, err := structpb.NewValue(dataMap)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -93,7 +157,7 @@ func (h *ApplicationHandler) BeneficiaryCreate(w http.ResponseWriter, r *http.Re
resp, err := h.services.GRPC.MobilityAccounts.Register(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -106,7 +170,7 @@ func (h *ApplicationHandler) BeneficiaryCreate(w http.ResponseWriter, r *http.Re
_, err = h.services.GRPC.GroupsManagement.Subscribe(context.TODO(), subscribe)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -130,27 +194,122 @@ func (h *ApplicationHandler) BeneficiaryDisplay(w http.ResponseWriter, r *http.R
resp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
subscriptionrequest := &agenda.GetSubscriptionByUserRequest{
Subscriber: beneficiaryID,
}
subcriptionresp, err := h.services.GRPC.Agenda.GetSubscriptionByUser(context.TODO(), subscriptionrequest)
if err != nil {
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
events := []agendastorage.Event{}
currentTime := time.Now().Truncate(24 * time.Hour)
for _, e := range subcriptionresp.Subscription {
eventresquest := &agenda.GetEventRequest{
Id: e.Eventid,
}
eventresp, err := h.services.GRPC.Agenda.GetEvent(context.TODO(), eventresquest)
if err != nil {
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
events = append(events, eventresp.Event.ToStorageType())
}
sort.Sort(sorting.EventsByStartdate(events))
bookingsrequest := &fleets.GetDriverBookingsRequest{
Driver: beneficiaryID,
}
bookingsresp, err := h.services.GRPC.Fleets.GetDriverBookings(context.TODO(), bookingsrequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
bookings := []any{}
bookings := []fleetsstorage.Booking{}
for _, b := range bookingsresp.Bookings {
bookings = append(bookings, b.ToStorageType())
}
var events_list []Event_Beneficiary
var status_event int
for _, e := range events {
if e.Startdate.After(currentTime) {
status_event = 1
} else if e.Startdate.Before(currentTime) && e.Enddate.After(currentTime) || e.Enddate.Equal(currentTime) {
status_event = 2
} else {
status_event = 3
}
event := Event{
NameVal: e.Name,
DateVal: e.Startdate,
DateEndVal: e.Enddate,
TypeVal: e.Type,
IDVal: e.ID,
DbVal: "/app/agenda/",
IconSet: "calendar",
StatusVal: status_event,
}
events_list = append(events_list, event)
}
var status_booking int
for _, b := range bookings {
if b.Enddate.After(currentTime) || b.Enddate.Equal(currentTime) {
GetVehiculeRequest := &fleets.GetVehicleRequest{
Vehicleid: b.Vehicleid,
}
GetVehiculeResp, err := h.services.GRPC.Fleets.GetVehicle(context.Background(), GetVehiculeRequest)
if err != nil {
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
if b.Startdate.After(currentTime) {
status_booking = 1
} else if b.Startdate.Before(currentTime) && b.Enddate.After(currentTime) || b.Enddate.Equal(currentTime) {
status_booking = 2
} else {
status_booking = 3
}
event := Event{
NameVal: GetVehiculeResp.Vehicle.ToStorageType().Data["name"].(string),
DateVal: b.Startdate,
DateEndVal: b.Enddate,
TypeVal: "Réservation de véhicule",
IDVal: b.ID,
DbVal: "/app/vehicles-management/bookings/",
IconSet: "vehicle",
StatusVal: status_booking,
}
events_list = append(events_list, event)
}
}
sortByDate(events_list)
groupsrequest := &groupsmanagement.GetGroupsRequest{
Namespaces: []string{"parcoursmob_organizations"},
Member: beneficiaryID,
@ -158,7 +317,7 @@ func (h *ApplicationHandler) BeneficiaryDisplay(w http.ResponseWriter, r *http.R
groupsresp, err := h.services.GRPC.GroupsManagement.GetGroups(context.TODO(), groupsrequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
organizations := []any{}
@ -169,7 +328,7 @@ func (h *ApplicationHandler) BeneficiaryDisplay(w http.ResponseWriter, r *http.R
beneficiaries_file_types := h.config.GetStringSlice("modules.beneficiaries.documents_types")
file_types_map := h.config.GetStringMapString("storage.files.file_types")
h.Renderer.BeneficiaryDisplay(w, r, resp.Account.ToStorageType(), bookings, organizations, beneficiaries_file_types, file_types_map, documents)
h.Renderer.BeneficiaryDisplay(w, r, resp.Account.ToStorageType(), bookings, organizations, beneficiaries_file_types, file_types_map, documents, events_list)
}
func (h *ApplicationHandler) BeneficiaryUpdate(w http.ResponseWriter, r *http.Request) {
@ -180,14 +339,14 @@ func (h *ApplicationHandler) BeneficiaryUpdate(w http.ResponseWriter, r *http.Re
dataMap, err := parseBeneficiariesForm(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
data, err := structpb.NewValue(dataMap)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -203,7 +362,7 @@ func (h *ApplicationHandler) BeneficiaryUpdate(w http.ResponseWriter, r *http.Re
resp, err := h.services.GRPC.MobilityAccounts.UpdateData(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -219,7 +378,7 @@ func (h *ApplicationHandler) BeneficiaryUpdate(w http.ResponseWriter, r *http.Re
resp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -240,7 +399,7 @@ func (h *ApplicationHandler) BeneficiaryPicture(w http.ResponseWriter, r *http.R
resp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -253,13 +412,13 @@ func (h *ApplicationHandler) BeneficiaryPicture(w http.ResponseWriter, r *http.R
buffer := new(bytes.Buffer)
if err := png.Encode(buffer, picture); err != nil {
log.Println("unable to encode image.")
log.Error().Err(err).Msg("unable to encode image.")
}
w.Header().Set("Content-Type", "image/png")
w.Header().Set("Content-Length", strconv.Itoa(len(buffer.Bytes())))
if _, err := w.Write(buffer.Bytes()); err != nil {
log.Println("unable to write image.")
log.Error().Err(err).Msg("unable to write image.")
}
}
@ -275,7 +434,7 @@ func (h *ApplicationHandler) BeneficiaryDocuments(w http.ResponseWriter, r *http
file, header, err := r.FormFile("file-upload")
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return
}
defer file.Close()
@ -287,8 +446,10 @@ func (h *ApplicationHandler) BeneficiaryDocuments(w http.ResponseWriter, r *http
"name": document_name,
}
log.Debug().Any("metadata", metadata).Msg("Metadata")
if err := h.filestorage.Put(file, filestorage.PREFIX_BENEFICIARIES, fmt.Sprintf("%s/%s_%s", beneficiaryID, fileid, header.Filename), header.Size, metadata); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -304,14 +465,14 @@ func (h *ApplicationHandler) BeneficiaryDocumentDownload(w http.ResponseWriter,
file, info, err := h.filestorage.Get(filestorage.PREFIX_BENEFICIARIES, fmt.Sprintf("%s/%s", beneficiaryID, document))
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", info.ContentType)
if _, err = io.Copy(w, file); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -333,6 +494,8 @@ func filterAccount(r *http.Request, a *mobilityaccounts.Account) bool {
return true
}
// func BeneficiariesEventList()
func (h *ApplicationHandler) beneficiaries(r *http.Request) ([]mobilityaccountsstorage.Account, error) {
var accounts = []mobilityaccountsstorage.Account{}
g := r.Context().Value(identification.GroupKey)

28
handlers/application/dashboard.go Normal file → Executable file
View File

@ -2,7 +2,6 @@ package application
import (
"context"
"fmt"
"net/http"
"sort"
@ -10,8 +9,11 @@ import (
"git.coopgo.io/coopgo-apps/parcoursmob/utils/sorting"
agenda "git.coopgo.io/coopgo-platform/agenda/grpcapi"
agendastorage "git.coopgo.io/coopgo-platform/agenda/storage"
fleets "git.coopgo.io/coopgo-platform/fleets/grpcapi"
fleetstorage "git.coopgo.io/coopgo-platform/fleets/storage"
"git.coopgo.io/coopgo-platform/groups-management/storage"
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
"github.com/rs/zerolog/log"
"google.golang.org/protobuf/types/known/timestamppb"
)
@ -31,7 +33,7 @@ func (h *ApplicationHandler) Dashboard(w http.ResponseWriter, r *http.Request) {
resp, err := h.services.GRPC.MobilityAccounts.GetAccountsBatch(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -54,7 +56,7 @@ func (h *ApplicationHandler) Dashboard(w http.ResponseWriter, r *http.Request) {
members, _, err := h.groupmembers(group.ID)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -68,12 +70,26 @@ func (h *ApplicationHandler) Dashboard(w http.ResponseWriter, r *http.Request) {
Mindate: timestamppb.Now(),
})
for _, e := range eventsresp.Events {
events = append(events, e.ToStorageType())
if err == nil {
for _, e := range eventsresp.Events {
events = append(events, e.ToStorageType())
}
}
sort.Sort(sorting.EventsByStartdate(events))
h.Renderer.Dashboard(w, r, accounts, count, count_members, events)
bookings := []fleetstorage.Booking{}
bookingsresp, err := h.services.GRPC.Fleets.GetBookings(context.TODO(), &fleets.GetBookingsRequest{
Namespaces: []string{"parcoursmob_dispositifs"},
})
if err == nil {
for _, b := range bookingsresp.Bookings {
bookings = append(bookings, b.ToStorageType())
}
}
h.Renderer.Dashboard(w, r, accounts, count, count_members, events, bookings)
}

0
handlers/application/directory.go Normal file → Executable file
View File

14
handlers/application/group.go Normal file → Executable file
View File

@ -4,7 +4,6 @@ import (
"context"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"net/http"
"time"
@ -12,6 +11,7 @@ import (
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
"git.coopgo.io/coopgo-platform/groups-management/storage"
accounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
"github.com/rs/zerolog/log"
)
func (h *ApplicationHandler) GroupSettingsDisplay(w http.ResponseWriter, r *http.Request) {
@ -26,7 +26,7 @@ func (h *ApplicationHandler) GroupSettingsDisplay(w http.ResponseWriter, r *http
members, err := h.members()
if err != nil {
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -81,14 +81,16 @@ func (h *ApplicationHandler) GroupSettingsInviteMember(w http.ResponseWriter, r
},
)
fmt.Println(err)
if err != nil {
log.Error().Err(err).Msg("")
}
data := map[string]any{
"group": group.Data["name"],
}
if err := h.emailing.Send("onboarding.existing_member", r.FormValue("username"), data); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
http.Redirect(w, r, "/app/group/settings", http.StatusFound)
@ -103,7 +105,7 @@ func (h *ApplicationHandler) GroupSettingsInviteMember(w http.ResponseWriter, r
b := make([]byte, 16)
if _, err := io.ReadFull(rand.Reader, b); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -117,7 +119,7 @@ func (h *ApplicationHandler) GroupSettingsInviteMember(w http.ResponseWriter, r
}
if err := h.emailing.Send("onboarding.new_member", r.FormValue("username"), data); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}

21
handlers/application/group_module.go Normal file → Executable file
View File

@ -14,6 +14,7 @@ import (
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/rs/zerolog/log"
"google.golang.org/protobuf/types/known/structpb"
)
@ -45,7 +46,7 @@ func (h *ApplicationHandler) Groups(w http.ResponseWriter, r *http.Request) {
resp, err := h.services.GRPC.GroupsManagement.GetGroups(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -73,14 +74,12 @@ func (h *ApplicationHandler) CreateGroupModule(w http.ResponseWriter, r *http.Re
r.ParseForm()
if r.FormValue("name") == "" {
fmt.Println("invalid name")
log.Error().Msg("Invalid name")
w.WriteHeader(http.StatusBadRequest)
return
}
if r.FormValue("type") == "" {
fmt.Println("invalid type")
log.Error().Msg("Invalid type")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -96,7 +95,7 @@ func (h *ApplicationHandler) CreateGroupModule(w http.ResponseWriter, r *http.Re
data, err := structpb.NewValue(dataMap)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -111,7 +110,7 @@ func (h *ApplicationHandler) CreateGroupModule(w http.ResponseWriter, r *http.Re
_, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_organization)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -145,7 +144,7 @@ func (h *ApplicationHandler) DisplayGroupModule(w http.ResponseWriter, r *http.R
resp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -186,7 +185,7 @@ func (h *ApplicationHandler) DisplayGroupModule(w http.ResponseWriter, r *http.R
respbeneficiary, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), requestbeneficiary)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -201,7 +200,7 @@ func (h *ApplicationHandler) DisplayGroupModule(w http.ResponseWriter, r *http.R
_, err = h.services.GRPC.GroupsManagement.Subscribe(context.TODO(), subscribe)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -212,7 +211,7 @@ func (h *ApplicationHandler) DisplayGroupModule(w http.ResponseWriter, r *http.R
accountsBeneficaire, err := h.beneficiaries(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}

218
handlers/application/journeys.go Normal file → Executable file
View File

@ -17,6 +17,7 @@ import (
"github.com/google/uuid"
"github.com/gorilla/mux"
geojson "github.com/paulmach/go.geojson"
"github.com/rs/zerolog/log"
"gitlab.scity.coop/maas/navitia-golang"
"gitlab.scity.coop/maas/navitia-golang/types"
"google.golang.org/protobuf/types/known/structpb"
@ -27,12 +28,17 @@ var Arrive any
func (h *ApplicationHandler) JourneysSearch(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
var (
journeys_results *navitia.JourneyResults
carpool_results any
vehicle_results []any
)
vehiclech := make(chan []any, 1)
navitiaCh := make(chan *navitia.JourneyResults, 1)
carpoolCh := make(chan any, 1)
locTime, errTime := time.LoadLocation("Europe/Paris")
if errTime != nil {
fmt.Println("Loading timezone location Europe/Paris error : ")
fmt.Println("Missing zones in container ? ")
panic(errTime)
log.Panic().Err(errTime).Msg("Tried to load timezone location Europe/Paris. Error. Missing zones in container ?")
}
departuredate := r.FormValue("departuredate")
@ -59,102 +65,112 @@ func (h *ApplicationHandler) JourneysSearch(w http.ResponseWriter, r *http.Reque
departuregeo, err = geojson.UnmarshalFeature([]byte(departure))
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
destinationgeo, err = geojson.UnmarshalFeature([]byte(destination))
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
//TODO make it a library
session, _ := navitia.NewCustom(
h.config.GetString("services.navitia.api_key"),
"https://api.navitia.io/v1",
&http.Client{})
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusBadRequest)
return
}
request := navitia.JourneyRequest{
From: types.ID(fmt.Sprintf("%f", departuregeo.Geometry.Point[0]) + ";" + fmt.Sprintf("%f", departuregeo.Geometry.Point[1])),
To: types.ID(fmt.Sprintf("%f", destinationgeo.Geometry.Point[0]) + ";" + fmt.Sprintf("%f", destinationgeo.Geometry.Point[1])),
Date: departuredatetime.Add(-2 * time.Hour),
DateIsArrival: false, //TODO
}
journeys, err = session.Journeys(context.Background(), request)
if err != nil {
fmt.Println(err)
// w.WriteHeader(http.StatusBadRequest)
// return
}
//CARPOOL
// carpoolrequest := fmt.Sprintf(
// "https://api.rdex.ridygo.fr/journeys.json?p[driver][state]=1&frequency=punctual&p[passenger][state]=0&p[from][latitude]=%f&p[from][longitude]=%f&p[to][latitude]=%f&p[to][longitude]=%f&p[outward][mindate]=%s&p[outward][maxdate]=%s",
// departuregeo.Geometry.Point[1], departuregeo.Geometry.Point[0],
// destinationgeo.Geometry.Point[1], destinationgeo.Geometry.Point[0],
// departuredatetime.Format("2006-01-02"), departuredatetime.Add(24*time.Hour).Format("2006-01-02"))
carpoolrequest := "https://api.rdex.ridygo.fr/journeys.json"
client := &http.Client{}
req, err := http.NewRequest("GET", carpoolrequest, nil)
if err != nil {
fmt.Println(err)
}
req.URL.RawQuery = fmt.Sprintf(
"p[driver][state]=1&frequency=punctual&p[passenger][state]=0&p[from][latitude]=%f&p[from][longitude]=%f&p[to][latitude]=%f&p[to][longitude]=%f&p[outward][mindate]=%s&p[outward][maxdate]=%s",
departuregeo.Geometry.Point[1], departuregeo.Geometry.Point[0],
destinationgeo.Geometry.Point[1], destinationgeo.Geometry.Point[0],
departuredatetime.Format("2006-01-02"), departuredatetime.Format("2006-01-02"))
req.Header.Set("X-API-KEY", "123456")
resp, err := client.Do(req)
if err != nil {
fmt.Println(err)
}
if err == nil && resp.StatusCode == http.StatusOK {
err = json.NewDecoder(resp.Body).Decode(&carpoolresults)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
journeysRequest := func() {
//TODO make it a library
session, _ := navitia.NewCustom(
h.config.GetString("services.navitia.api_key"),
"https://api.navitia.io/v1",
&http.Client{})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
navitiaCh <- nil
return
}
if carpoolresults == nil {
request := navitia.JourneyRequest{
From: types.ID(fmt.Sprintf("%f", departuregeo.Geometry.Point[0]) + ";" + fmt.Sprintf("%f", departuregeo.Geometry.Point[1])),
To: types.ID(fmt.Sprintf("%f", destinationgeo.Geometry.Point[0]) + ";" + fmt.Sprintf("%f", destinationgeo.Geometry.Point[1])),
Date: departuredatetime.Add(-2 * time.Hour),
DateIsArrival: false, //TODO
}
journeys, err = session.Journeys(context.Background(), request)
if err != nil {
log.Error().Err(err).Msg("")
// w.WriteHeader(http.StatusBadRequest)
// return
}
navitiaCh <- journeys
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//CARPOOL
carpoolRequest := func() {
carpoolrequest := "https://api.rdex.ridygo.fr/journeys.json"
client := &http.Client{}
req, err := http.NewRequest("GET", carpoolrequest, nil)
if err != nil {
log.Error().Err(err).Msg("")
}
req.URL.RawQuery = fmt.Sprintf(
"p[driver][state]=1&frequency=punctual&p[passenger][state]=0&p[from][latitude]=%f&p[from][longitude]=%f&p[to][latitude]=%f&p[to][longitude]=%f&p[outward][mindate]=%s&p[outward][maxdate]=%s",
departuregeo.Geometry.Point[1], departuregeo.Geometry.Point[0],
destinationgeo.Geometry.Point[1], destinationgeo.Geometry.Point[0],
departuredatetime.Format("2006-01-02"), departuredatetime.Format("2006-01-02"))
req.Header.Set("X-API-KEY", "123456")
resp, err := client.Do(req)
if err != nil {
log.Error().Err(err).Msg("")
}
if err == nil && resp.StatusCode == http.StatusOK {
err = json.NewDecoder(resp.Body).Decode(&carpoolresults)
if err != nil {
log.Error().Err(err).Msg("")
}
if carpoolresults == nil {
carpoolresults = []any{}
}
} else {
carpoolresults = []any{}
}
} else {
carpoolresults = []any{}
carpoolCh <- carpoolresults
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Vehicles
vehiclerequest := &fleets.GetVehiclesRequest{
Namespaces: []string{"parcoursmob"},
}
vehicleresp, err := h.services.GRPC.Fleets.GetVehicles(context.TODO(), vehiclerequest)
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
}
for _, vehicle := range vehicleresp.Vehicles {
v := vehicle.ToStorageType()
if v.Free(departuredatetime.Add(-24*time.Hour), departuredatetime.Add(168*time.Hour)) {
vehicles = append(vehicles, v)
vehicleRequest := func() {
vehiclerequest := &fleets.GetVehiclesRequest{
Namespaces: []string{"parcoursmob"},
}
vehicleresp, err := h.services.GRPC.Fleets.GetVehicles(context.TODO(), vehiclerequest)
if err != nil {
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
}
for _, vehicle := range vehicleresp.Vehicles {
v := vehicle.ToStorageType()
if v.Free(departuredatetime.Add(-24*time.Hour), departuredatetime.Add(168*time.Hour)) {
vehicles = append(vehicles, v)
}
}
vehiclech <- vehicles
}
go journeysRequest()
go carpoolRequest()
go vehicleRequest()
carpool_results = <-carpoolCh
journeys_results = <-navitiaCh
vehicle_results = <-vehiclech
}
h.Renderer.JourneysSearch(w, r, carpoolresults, journeys, vehicles, searched, departuregeo, destinationgeo, departuredate, departuretime)
h.Renderer.JourneysSearch(w, r, carpool_results, journeys_results, vehicle_results, searched, departuregeo, destinationgeo, departuredate, departuretime)
}
type GroupsModule []groupstorage.Group
@ -173,7 +189,7 @@ func (h *ApplicationHandler) GroupsGestion(w http.ResponseWriter, r *http.Reques
resp, err := h.services.GRPC.GroupsManagement.GetGroups(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -224,7 +240,7 @@ func (h *ApplicationHandler) CreateGroup(w http.ResponseWriter, r *http.Request)
respbeneficiary, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), requestbeneficiary)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -241,14 +257,14 @@ func (h *ApplicationHandler) CreateGroup(w http.ResponseWriter, r *http.Request)
departurgeo, err = geojson.UnmarshalFeature([]byte(departure))
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
dstinationgeo, err = geojson.UnmarshalFeature([]byte(destination))
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -269,14 +285,14 @@ func (h *ApplicationHandler) CreateGroup(w http.ResponseWriter, r *http.Request)
if r.FormValue("name") == "" {
fmt.Println("invalid name")
log.Error().Msg("invalid name")
w.WriteHeader(http.StatusBadRequest)
return
}
if r.FormValue("number") == "" {
fmt.Println("invalid number of personne")
log.Error().Msg("invalid number of personne")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -313,7 +329,7 @@ func (h *ApplicationHandler) CreateGroup(w http.ResponseWriter, r *http.Request)
data, err := structpb.NewValue(dataMap)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -328,7 +344,7 @@ func (h *ApplicationHandler) CreateGroup(w http.ResponseWriter, r *http.Request)
_, err = h.services.GRPC.GroupsManagement.AddGroup(context.TODO(), request_organization)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -340,7 +356,7 @@ func (h *ApplicationHandler) CreateGroup(w http.ResponseWriter, r *http.Request)
}
accountsBeneficaire, err := h.beneficiaries(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -359,7 +375,7 @@ func (h *ApplicationHandler) DisplayGroupCovoiturage(w http.ResponseWriter, r *h
resp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -396,7 +412,7 @@ func (h *ApplicationHandler) DisplayGroupCovoiturage(w http.ResponseWriter, r *h
respbeneficiary, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), requestbeneficiary)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -411,7 +427,7 @@ func (h *ApplicationHandler) DisplayGroupCovoiturage(w http.ResponseWriter, r *h
_, err = h.services.GRPC.GroupsManagement.Subscribe(context.TODO(), subscribe)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -437,7 +453,7 @@ func (h *ApplicationHandler) DisplayGroupCovoiturage(w http.ResponseWriter, r *h
id := uuid.NewString()
data, err := structpb.NewValue(dataMap)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -453,7 +469,7 @@ func (h *ApplicationHandler) DisplayGroupCovoiturage(w http.ResponseWriter, r *h
_, err = h.services.GRPC.GroupsManagement.AddGroupMember(context.TODO(), request_organizatio)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -468,7 +484,7 @@ func (h *ApplicationHandler) DisplayGroupCovoiturage(w http.ResponseWriter, r *h
// }
// s, err := h.services.GRPC.GroupsManagement.GetGroupsBatchMember(context.TODO(), grp)
// if err != nil {
// fmt.Println(err)
// log.Error().Err(err).Msg("")
// w.WriteHeader(http.StatusInternalServerError)
// return
// }
@ -482,12 +498,10 @@ func (h *ApplicationHandler) DisplayGroupCovoiturage(w http.ResponseWriter, r *h
//////////find all groups to store the adresse passenger///////
///////////try to optimise the code ////////////////////////////
groups, _ := h.services.GetGroupsMemberMap(resp.Group.ToStorageType().ID)
//fmt.Println(groups)
var number string = strconv.Itoa(len(resp.Group.Members))
/////////////////////
accountsBeneficaire, err := h.beneficiaries(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -510,7 +524,7 @@ func (h *ApplicationHandler) UpdateGroupCovoiturage(w http.ResponseWriter, r *ht
resp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -523,7 +537,7 @@ func (h *ApplicationHandler) UpdateGroupCovoiturage(w http.ResponseWriter, r *ht
ressp, err := h.services.GRPC.GroupsManagement.GetGroupMember(context.TODO(), reequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -533,7 +547,7 @@ func (h *ApplicationHandler) UpdateGroupCovoiturage(w http.ResponseWriter, r *ht
_, errr := h.services.GRPC.GroupsManagement.UnsubscribeMember(context.TODO(), req)
if errr != nil {
fmt.Println(errr)
log.Error().Err(errr).Msg("Issue in groups management service - InsubscribeMember")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -550,7 +564,7 @@ func (h *ApplicationHandler) UpdateGroupCovoiturage(w http.ResponseWriter, r *ht
_, err := h.services.GRPC.GroupsManagement.Unsubscribe(context.TODO(), reequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}

19
handlers/application/members.go Normal file → Executable file
View File

@ -12,6 +12,7 @@ import (
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
"github.com/google/uuid"
"github.com/rs/zerolog/log"
"google.golang.org/protobuf/types/known/structpb"
)
@ -35,7 +36,7 @@ func (h *ApplicationHandler) MemberDisplay(w http.ResponseWriter, r *http.Reques
resp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -54,7 +55,7 @@ func (h *ApplicationHandler) MemberDisplay(w http.ResponseWriter, r *http.Reques
res, err := h.services.GRPC.GroupsManagement.GetGroupsBatch(context.TODO(), reques)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -77,14 +78,14 @@ func (h *ApplicationHandler) MemberUpdate(w http.ResponseWriter, r *http.Request
dataMap, err := parseUserForm(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
data, err := structpb.NewValue(dataMap)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -100,7 +101,7 @@ func (h *ApplicationHandler) MemberUpdate(w http.ResponseWriter, r *http.Request
resp, err := h.services.GRPC.MobilityAccounts.UpdateData(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -116,7 +117,7 @@ func (h *ApplicationHandler) MemberUpdate(w http.ResponseWriter, r *http.Request
resp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -160,7 +161,7 @@ func (h *ApplicationHandler) MembersList(w http.ResponseWriter, r *http.Request)
accounts, err := h.services.GetAccounts()
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -174,7 +175,7 @@ func (h *ApplicationHandler) MembersList(w http.ResponseWriter, r *http.Request)
resp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -195,7 +196,7 @@ func (h *ApplicationHandler) MembersList(w http.ResponseWriter, r *http.Request)
res, err := h.services.GRPC.GroupsManagement.GetGroupsBatch(context.TODO(), reques)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}

17
handlers/application/support.go Normal file → Executable file
View File

@ -1,10 +1,11 @@
package application
import (
"fmt"
"net/http"
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
"git.coopgo.io/coopgo-platform/emailing"
"github.com/rs/zerolog/log"
)
type Message struct {
@ -15,23 +16,29 @@ func (h *ApplicationHandler) SupportSend(w http.ResponseWriter, r *http.Request)
c := r.Context().Value(identification.ClaimsKey)
if c == nil {
fmt.Println("no current user claims")
log.Error().Msg("no current user claims")
w.WriteHeader(http.StatusInternalServerError)
return
}
current_user_claims := c.(map[string]any)
comment := r.PostFormValue(("comment"))
if r.Method == "POST" {
user_email := current_user_claims["email"].(string)
data := map[string]any{
"key": comment,
"user": current_user_claims["email"],
"user": user_email,
}
if err := h.emailing.Send("support.request", "support@parcoursmob.fr", data); err != nil {
fmt.Println(err)
log.Debug().Str("user_email", user_email).Msg("Sending message")
if err := h.emailing.Send("support.request", "support@parcoursmob.fr", data, emailing.WithReplyTo(user_email), emailing.WithTLSOpportunistic()); err != nil {
log.Error().Err(err).Msg("error sending email")
w.WriteHeader(http.StatusInternalServerError)
return
}
http.Redirect(w, r, "/app/", http.StatusFound)
return

101
handlers/application/vehicles-management.go Normal file → Executable file
View File

@ -17,9 +17,10 @@ import (
"git.coopgo.io/coopgo-platform/groups-management/storage"
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
mobilityaccountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
"github.com/coreos/go-oidc"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/rs/zerolog/log"
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/timestamppb"
)
@ -31,7 +32,7 @@ func (h *ApplicationHandler) VehiclesManagementOverview(w http.ResponseWriter, r
}
resp, err := h.services.GRPC.Fleets.GetVehicles(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
}
@ -60,9 +61,11 @@ func (h *ApplicationHandler) VehiclesManagementOverview(w http.ResponseWriter, r
}
}
driversMap, _ := h.services.GetBeneficiariesMap()
sort.Sort(sorting.VehiclesByLicencePlate(vehicles))
sort.Sort(sorting.BookingsByStartdate(bookings))
h.Renderer.VehiclesManagementOverview(w, r, vehicles, vehicles_map, bookings)
h.Renderer.VehiclesManagementOverview(w, r, vehicles, vehicles_map, driversMap, bookings)
}
func (h *ApplicationHandler) VehiclesManagementBookingsList(w http.ResponseWriter, r *http.Request) {
@ -72,7 +75,7 @@ func (h *ApplicationHandler) VehiclesManagementBookingsList(w http.ResponseWrite
}
resp, err := h.services.GRPC.Fleets.GetVehicles(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
}
@ -97,7 +100,9 @@ func (h *ApplicationHandler) VehiclesManagementBookingsList(w http.ResponseWrite
cacheid := uuid.NewString()
h.cache.PutWithTTL(cacheid, bookings, 1*time.Hour)
h.Renderer.VehiclesManagementBookingsList(w, r, vehicles_map, bookings, cacheid)
driversMap, _ := h.services.GetBeneficiariesMap()
h.Renderer.VehiclesManagementBookingsList(w, r, vehicles_map, driversMap, bookings, cacheid)
}
func (h *ApplicationHandler) VehiclesFleetAdd(w http.ResponseWriter, r *http.Request) {
@ -111,7 +116,7 @@ func (h *ApplicationHandler) VehiclesFleetAdd(w http.ResponseWriter, r *http.Req
group := g.(storage.Group)
if err := r.ParseForm(); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -124,7 +129,7 @@ func (h *ApplicationHandler) VehiclesFleetAdd(w http.ResponseWriter, r *http.Req
var address map[string]any
err := json.Unmarshal([]byte(v), &address)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -137,13 +142,15 @@ func (h *ApplicationHandler) VehiclesFleetAdd(w http.ResponseWriter, r *http.Req
dataMap["licence_plate"] = v
}
if v := r.FormValue("automatic"); v != "" {
fmt.Println(v)
dataMap["automatic"] = (v == "on")
}
if v := r.FormValue("kilometers"); v != "" {
dataMap["kilometers"] = v
}
data, err := structpb.NewValue(dataMap)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -163,7 +170,7 @@ func (h *ApplicationHandler) VehiclesFleetAdd(w http.ResponseWriter, r *http.Req
_, err = h.services.GRPC.Fleets.AddVehicle(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -186,7 +193,7 @@ func (h *ApplicationHandler) VehiclesFleetDisplay(w http.ResponseWriter, r *http
resp, err := h.services.GRPC.Fleets.GetVehicle(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -217,7 +224,7 @@ func (h ApplicationHandler) VehicleManagementBookingDisplay(w http.ResponseWrite
booking, err := h.services.GetBooking(bookingid)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -265,7 +272,7 @@ func (h ApplicationHandler) VehicleManagementBookingDisplay(w http.ResponseWrite
_, err := h.services.GRPC.Fleets.UpdateBooking(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -282,7 +289,7 @@ func (h ApplicationHandler) VehicleManagementBookingDisplay(w http.ResponseWrite
beneficiaryresp, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), beneficiaryrequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -296,7 +303,7 @@ func (h ApplicationHandler) VehicleManagementBookingDisplay(w http.ResponseWrite
groupresp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), grouprequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -311,7 +318,7 @@ func (h ApplicationHandler) VehicleManagementBookingDisplay(w http.ResponseWrite
alternativeresp, err := h.services.GRPC.Fleets.GetVehicles(context.TODO(), alternativerequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
alternatives := []any{}
@ -336,7 +343,7 @@ func (h ApplicationHandler) VehicleManagementBookingChangeVehicle(w http.Respons
booking, err := h.services.GetBooking(bookingid)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -351,7 +358,7 @@ func (h ApplicationHandler) VehicleManagementBookingChangeVehicle(w http.Respons
_, err = h.services.GRPC.Fleets.UpdateBooking(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -363,7 +370,7 @@ func (h ApplicationHandler) VehicleManagementBookingChangeVehicle(w http.Respons
func (h ApplicationHandler) VehiclesFleetMakeUnavailable(w http.ResponseWriter, r *http.Request) { // Get Group
g := r.Context().Value(identification.GroupKey)
if g == nil {
fmt.Println("no current group")
log.Error().Msg("no current group")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -372,7 +379,7 @@ func (h ApplicationHandler) VehiclesFleetMakeUnavailable(w http.ResponseWriter,
// Get current user ID
u := r.Context().Value(identification.IdtokenKey)
if u == nil {
fmt.Println("no current user")
log.Error().Msg("no current user")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -381,7 +388,7 @@ func (h ApplicationHandler) VehiclesFleetMakeUnavailable(w http.ResponseWriter,
// Get current user claims
c := r.Context().Value(identification.ClaimsKey)
if c == nil {
fmt.Println("no current user claims")
log.Error().Msg("no current user claims")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -416,7 +423,7 @@ func (h ApplicationHandler) VehiclesFleetMakeUnavailable(w http.ResponseWriter,
datapb, err := structpb.NewStruct(data)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -435,7 +442,7 @@ func (h ApplicationHandler) VehiclesFleetMakeUnavailable(w http.ResponseWriter,
_, err = h.services.GRPC.Fleets.CreateBooking(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -443,30 +450,6 @@ func (h ApplicationHandler) VehiclesFleetMakeUnavailable(w http.ResponseWriter,
http.Redirect(w, r, fmt.Sprintf("/app/vehicles-management/fleet/%s", vehicleid), http.StatusFound)
}
// func (h *ApplicationHandler) UnbookingVehicles(w http.ResponseWriter, r *http.Request) {
// request := &fleets.GetVehiclesRequest{
// Namespaces: []string{"parcoursmob"},
// }
// resp, err := h.services.GRPC.Fleets.GetVehicles(context.TODO(), request)
// if err != nil {
// fmt.Println(err)
// w.WriteHeader(http.StatusInternalServerError)
// }
// vehicles := []fleetsstorage.Vehicle{}
// fmt.Println(resp.Vehicles[0].Bookings)
// for i, vehicle := range resp.Vehicles {
// if len(resp.Vehicles[i].Bookings) == 0 {
// v := vehicle.ToStorageType()
// vehicles = append(vehicles, v)
// }
// }
// // if len(resp.Vehicle.ToStorageType().Bookings) == 0 {
// // h.Renderer.UnbookingVehicles(w, r, resp.Vehicle.ToStorageType())
// // }
// // fmt.Println(resp.Vehicle.ToStorageType().Bookings)
// fmt.Println(vehicles)
// h.Renderer.UnbookingVehicles(w, r, vehicles)
// }
func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
bookingid := vars["bookingid"]
@ -477,7 +460,7 @@ func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Req
resp, err := h.services.GRPC.Fleets.GetBooking(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -487,14 +470,14 @@ func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Req
current_group, err := h.currentGroup(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
current_user_token, current_user_claims, err := h.currentUser(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -534,7 +517,7 @@ func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Req
datapb, err := structpb.NewStruct(data)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -557,7 +540,7 @@ func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Req
_, err := h.services.GRPC.Fleets.UpdateBooking(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -579,7 +562,7 @@ func (h *ApplicationHandler) VehiclesFleetUpdate(w http.ResponseWriter, r *http.
resp, err := h.services.GRPC.Fleets.GetVehicle(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -590,7 +573,7 @@ func (h *ApplicationHandler) VehiclesFleetUpdate(w http.ResponseWriter, r *http.
if r.Method == "POST" {
fmt.Print(r.FormValue("vehicle_type"))
if err := r.ParseForm(); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -602,7 +585,7 @@ func (h *ApplicationHandler) VehiclesFleetUpdate(w http.ResponseWriter, r *http.
var address map[string]any
err := json.Unmarshal([]byte(v), &address)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -614,14 +597,16 @@ func (h *ApplicationHandler) VehiclesFleetUpdate(w http.ResponseWriter, r *http.
if v := r.FormValue("licence_plate"); v != "" {
dataMap["licence_plate"] = v
}
if v := r.FormValue("kilometers"); v != "" {
dataMap["kilometers"] = v
}
if v := r.FormValue("automatic"); v != "" {
fmt.Println(v)
dataMap["automatic"] = (v == "on")
}
data, err := structpb.NewValue(dataMap)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -639,7 +624,7 @@ func (h *ApplicationHandler) VehiclesFleetUpdate(w http.ResponseWriter, r *http.
resp, err := h.services.GRPC.Fleets.UpdateVehicle(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}

43
handlers/application/vehicles.go Normal file → Executable file
View File

@ -20,13 +20,13 @@ import (
mobilityaccountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/rs/zerolog/log"
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/timestamppb"
)
func (h ApplicationHandler) VehiclesSearch(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
var beneficiary mobilityaccountsstorage.Account
beneficiarydocuments := []filestorage.FileInfo{}
@ -52,7 +52,7 @@ func (h ApplicationHandler) VehiclesSearch(w http.ResponseWriter, r *http.Reques
respbeneficiary, err := h.services.GRPC.MobilityAccounts.GetAccount(context.TODO(), requestbeneficiary)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -71,7 +71,7 @@ func (h ApplicationHandler) VehiclesSearch(w http.ResponseWriter, r *http.Reques
resp, err := h.services.GRPC.Fleets.GetVehicles(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
}
@ -79,9 +79,7 @@ func (h ApplicationHandler) VehiclesSearch(w http.ResponseWriter, r *http.Reques
v := vehicle.ToStorageType()
if r.FormValue("type") == "Voiture" && automatic {
fmt.Println(v.Data["automatic"])
if auto, ok := v.Data["automatic"].(bool); !ok || !auto {
fmt.Println(v.Data["automatic"])
continue
}
}
@ -105,7 +103,7 @@ func (h ApplicationHandler) VehiclesSearch(w http.ResponseWriter, r *http.Reques
accounts, err := h.beneficiaries(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -116,7 +114,7 @@ func (h ApplicationHandler) VehiclesSearch(w http.ResponseWriter, r *http.Reques
Groupids: administrators,
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -136,17 +134,16 @@ func (h ApplicationHandler) VehiclesSearch(w http.ResponseWriter, r *http.Reques
}
func (h ApplicationHandler) Book(w http.ResponseWriter, r *http.Request) {
fmt.Println("Book")
current_group, err := h.currentGroup(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
current_user_token, current_user_claims, err := h.currentUser(r)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -159,7 +156,7 @@ func (h ApplicationHandler) Book(w http.ResponseWriter, r *http.Request) {
Vehicleid: vehicleid,
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte("Vehicle not found"))
w.Write([]byte(err.Error()))
@ -188,7 +185,7 @@ func (h ApplicationHandler) Book(w http.ResponseWriter, r *http.Request) {
}
datapb, err := structpb.NewStruct(data)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -213,7 +210,7 @@ func (h ApplicationHandler) Book(w http.ResponseWriter, r *http.Request) {
if existing_file == "" {
file, header, err := r.FormFile("doc-" + v)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte("Document manquant : " + v))
return
@ -228,7 +225,7 @@ func (h ApplicationHandler) Book(w http.ResponseWriter, r *http.Request) {
}
if err := h.filestorage.Put(file, filestorage.PREFIX_BOOKINGS, fmt.Sprintf("%s/%s_%s", booking.Id, fileid, header.Filename), header.Size, metadata); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -236,7 +233,7 @@ func (h ApplicationHandler) Book(w http.ResponseWriter, r *http.Request) {
path := strings.Split(existing_file, "/")
if err := h.filestorage.Copy(existing_file, fmt.Sprintf("%s/%s/%s", filestorage.PREFIX_BOOKINGS, booking.Id, path[len(path)-1])); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -245,7 +242,7 @@ func (h ApplicationHandler) Book(w http.ResponseWriter, r *http.Request) {
_, err = h.services.GRPC.Fleets.CreateBooking(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusBadRequest)
return
}
@ -253,7 +250,7 @@ func (h ApplicationHandler) Book(w http.ResponseWriter, r *http.Request) {
//NOTIFY GROUP MEMBERS
members, _, err := h.groupmembers(vehicle.Vehicle.Administrators[0])
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
} else {
for _, m := range members {
if email, ok := m.Data["email"].(string); ok {
@ -277,7 +274,7 @@ func (h ApplicationHandler) VehicleBookingDisplay(w http.ResponseWriter, r *http
}
resp, err := h.services.GRPC.Fleets.GetBooking(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -301,7 +298,7 @@ func (h ApplicationHandler) VehicleBookingDisplay(w http.ResponseWriter, r *http
groupresp, err := h.services.GRPC.GroupsManagement.GetGroup(context.TODO(), grouprequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -325,7 +322,7 @@ func (h ApplicationHandler) VehiclesBookingsList(w http.ResponseWriter, r *http.
request := &fleets.GetBookingsRequest{}
resp, err := h.services.GRPC.Fleets.GetBookings(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusNotFound)
return
}
@ -357,18 +354,18 @@ func (h *ApplicationHandler) BookingDocumentDownload(w http.ResponseWriter, r *h
bookingid := vars["bookingid"]
document := vars["document"]
fmt.Println(fmt.Sprintf("%s/%s", bookingid, document))
log.Debug().Str("booking id", bookingid).Str("document", document).Msg("Document and booking ID")
file, info, err := h.filestorage.Get(filestorage.PREFIX_BOOKINGS, fmt.Sprintf("%s/%s", bookingid, document))
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", info.ContentType)
if _, err = io.Copy(w, file); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}

0
handlers/auth/auth.go Normal file → Executable file
View File

0
handlers/auth/disconnect.go Normal file → Executable file
View File

6
handlers/auth/groups.go Normal file → Executable file
View File

@ -2,10 +2,10 @@ package auth
import (
"context"
"fmt"
"net/http"
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
"github.com/rs/zerolog/log"
)
func (h *AuthHandler) Groups(w http.ResponseWriter, r *http.Request) {
@ -42,7 +42,7 @@ func (h *AuthHandler) Groups(w http.ResponseWriter, r *http.Request) {
err = idtoken.Claims(&claims)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
g := claims["groups"]
@ -65,7 +65,7 @@ func (h *AuthHandler) Groups(w http.ResponseWriter, r *http.Request) {
resp, err := h.services.GRPC.GroupsManagement.GetGroupsBatch(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}

14
handlers/auth/lost_password.go Normal file → Executable file
View File

@ -4,12 +4,12 @@ import (
"context"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"net/http"
"time"
"git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
"github.com/rs/zerolog/log"
)
func (h *AuthHandler) LostPasswordInit(w http.ResponseWriter, r *http.Request) {
@ -22,14 +22,14 @@ func (h *AuthHandler) LostPasswordInit(w http.ResponseWriter, r *http.Request) {
Namespace: "parcoursmob",
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
http.Redirect(w, r, "/app/", http.StatusFound)
return
}
b := make([]byte, 16)
if _, err := io.ReadFull(rand.Reader, b); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -44,7 +44,7 @@ func (h *AuthHandler) LostPasswordInit(w http.ResponseWriter, r *http.Request) {
h.cache.PutWithTTL("retrieve-password/"+key, passwordretrieval, 72*time.Hour)
if err := h.emailing.Send("auth.retrieve_password", email, passwordretrieval); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -62,7 +62,7 @@ func (h *AuthHandler) LostPasswordRecover(w http.ResponseWriter, r *http.Request
key := r.FormValue("key")
recover, err := h.cache.Get("retrieve-password/" + key)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
h.Renderer.LostPasswordRecoverKO(w, r, key)
return
}
@ -81,13 +81,13 @@ func (h *AuthHandler) LostPasswordRecover(w http.ResponseWriter, r *http.Request
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
}
err = h.cache.Delete("retrieve-password/" + key)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
http.Redirect(w, r, "/app/", http.StatusFound)

11
handlers/auth/onboarding.go Normal file → Executable file
View File

@ -7,6 +7,7 @@ import (
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
ma "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
"github.com/rs/zerolog/log"
)
func (h *AuthHandler) Onboarding(w http.ResponseWriter, r *http.Request) {
@ -15,7 +16,7 @@ func (h *AuthHandler) Onboarding(w http.ResponseWriter, r *http.Request) {
key := r.FormValue("key")
onboarding, err := h.cache.Get("onboarding/" + key)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
h.Renderer.AuthOnboardingKO(w, r, key)
return
}
@ -24,7 +25,7 @@ func (h *AuthHandler) Onboarding(w http.ResponseWriter, r *http.Request) {
if r.Method == "POST" {
if r.FormValue("password") == "" {
fmt.Println("password is empty !")
log.Error().Msg("Password is empty")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -58,7 +59,7 @@ func (h *AuthHandler) Onboarding(w http.ResponseWriter, r *http.Request) {
acc, err := mobilityaccounts.AccountFromStorageType(account)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -70,14 +71,14 @@ func (h *AuthHandler) Onboarding(w http.ResponseWriter, r *http.Request) {
_, err = h.services.GRPC.MobilityAccounts.Register(context.TODO(), request)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
err = h.cache.Delete("onboarding/" + key)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
http.Redirect(w, r, "/app/", http.StatusFound)

16
handlers/exports/agenda.go Normal file → Executable file
View File

@ -3,6 +3,9 @@ package exports
import (
"context"
"fmt"
"net/http"
"sort"
"git.coopgo.io/coopgo-apps/parcoursmob/utils/sorting"
agenda "git.coopgo.io/coopgo-platform/agenda/grpcapi"
agendastorage "git.coopgo.io/coopgo-platform/agenda/storage"
@ -11,9 +14,8 @@ import (
accounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
accountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
"github.com/gorilla/mux"
"github.com/rs/zerolog/log"
"github.com/xuri/excelize/v2"
"net/http"
"sort"
)
func (h *ExportsHandler) Agenda(filter string) func(w http.ResponseWriter, r *http.Request) {
@ -24,7 +26,7 @@ func (h *ExportsHandler) Agenda(filter string) func(w http.ResponseWriter, r *ht
Namespaces: []string{"parcoursmob_dispositifs"},
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -59,7 +61,7 @@ func (h *ExportsHandler) Agenda(filter string) func(w http.ResponseWriter, r *ht
Accountids: beneficiaries_ids,
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -82,7 +84,7 @@ func (h *ExportsHandler) Agenda(filter string) func(w http.ResponseWriter, r *ht
Id: eventId,
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -107,7 +109,7 @@ func (h *ExportsHandler) Agenda(filter string) func(w http.ResponseWriter, r *ht
Accountids: beneficiaries_ids,
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -130,7 +132,7 @@ func (h *ExportsHandler) generateExcel(events []agendastorage.Event, groups map[
f := excelize.NewFile()
defer func() {
if err := f.Close(); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
}()
f.SetCellValue("Sheet1", "A1", "Evénement")

0
handlers/exports/exports.go Normal file → Executable file
View File

13
handlers/exports/fleets.go Normal file → Executable file
View File

@ -12,6 +12,7 @@ import (
groupsstorage "git.coopgo.io/coopgo-platform/groups-management/storage"
accounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
accountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
"github.com/rs/zerolog/log"
"github.com/xuri/excelize/v2"
)
@ -24,7 +25,7 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) {
}
reesp, err := h.services.GRPC.Fleets.GetVehicles(context.TODO(), reequest)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -34,7 +35,6 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) {
for _, vehicle := range reesp.Vehicles {
v := vehicle.ToStorageType()
fmt.Println(v)
for _, b := range v.Bookings {
bookings = append(bookings, b)
@ -45,14 +45,13 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) {
}
groups := map[string]groupsstorage.Group{}
admingroups, err := h.services.GRPC.GroupsManagement.GetGroups(context.TODO(), &groupsmanagement.GetGroupsRequest{
Namespaces: []string{"parcoursmob_organizations"},
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -65,7 +64,7 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) {
Accountids: beneficiaries_ids,
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
w.WriteHeader(http.StatusInternalServerError)
return
}
@ -80,7 +79,7 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) {
f := excelize.NewFile()
defer func() {
if err := f.Close(); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
}()
@ -127,7 +126,7 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) {
// filter by group
g := r.Context().Value(identification.GroupKey)
group := g.(groupsstorage.Group)
if bookedbygroup != group.ID {
continue
}

49
main.go Normal file → Executable file
View File

@ -1,11 +1,13 @@
package main
import (
"fmt"
"log"
"net/http"
"os"
"time"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"git.coopgo.io/coopgo-apps/parcoursmob/handlers/api"
"git.coopgo.io/coopgo-apps/parcoursmob/handlers/application"
"git.coopgo.io/coopgo-apps/parcoursmob/handlers/auth"
@ -18,7 +20,10 @@ import (
)
func main() {
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
cfg, err := ReadConfig()
if err != nil {
panic(err)
}
@ -30,26 +35,29 @@ func main() {
dev_env = cfg.GetBool("dev_env")
)
if dev_env {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
}
svc, err := services.NewServicesHandler(cfg)
if err != nil {
panic(err)
log.Panic().Err(err).Msg("Error creating services handler")
}
kv, err := cache.NewKVHandler(cfg)
if err != nil {
panic(err)
log.Panic().Err(err).Msg("Error creating KV handler")
}
filestorage, err := cache.NewFileStorage(cfg)
filestorage, _ := cache.NewFileStorage(cfg)
idp, err := identification.NewIdentificationProvider(cfg, svc, kv)
if err != nil {
panic(err)
log.Panic().Err(err).Msg("Error creating identification provider")
}
emailing, err := renderer.NewEmailingHandler(cfg)
if err != nil {
panic(err)
log.Panic().Err(err).Msg("Error creating emailing handler")
}
apiHandler, _ := api.NewAPIHandler(cfg, idp, svc, kv)
@ -57,11 +65,6 @@ func main() {
exportsHandler, _ := exports.NewExportsHandler(cfg, svc, emailing)
authHandler, _ := auth.NewAuthHandler(cfg, idp, svc, kv, emailing)
fmt.Println("Running", service_name, ":")
if dev_env {
fmt.Printf("\033]0;%s\007", service_name)
}
r := mux.NewRouter()
r.PathPrefix("/public/").Handler(http.StripPrefix("/public/", http.FileServer(http.Dir(templates_public_dir))))
@ -74,6 +77,10 @@ func main() {
r.HandleFunc("/auth/groups/switch", authHandler.GroupSwitch)
r.HandleFunc("/", redirectApp)
if dev_env {
r.Use(trackPage)
}
api_router := r.PathPrefix("/api").Subrouter()
api_router.HandleFunc("/", apiHandler.NotFound)
api_router.HandleFunc("/geo/autocomplete", apiHandler.GeoAutocomplete)
@ -163,6 +170,9 @@ func main() {
application.HandleFunc("/agenda/{eventid}/{subscribeid}/delete", applicationHandler.AgendaDeleteSubscribeEvent)
application.HandleFunc("/agenda/{eventid}/history", applicationHandler.AgendaHistoryEvent)
/////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////Add documents in event////////////////////////
application.HandleFunc("/agenda/{eventid}/documents", applicationHandler.EventDocuments)
application.HandleFunc("/agenda/{eventid}/documents/{document}", applicationHandler.EventDocumentDownload)
export := r.PathPrefix("/exports").Subrouter()
export.HandleFunc("/fleets/bookings", exportsHandler.Bookings)
@ -172,8 +182,6 @@ func main() {
export.Use(idp.Middleware)
export.Use(idp.GroupsMiddleware)
fmt.Println("-> HTTP server listening on", address)
srv := &http.Server{
Handler: r,
Addr: address,
@ -181,10 +189,19 @@ func main() {
ReadTimeout: 15 * time.Second,
}
log.Fatal(srv.ListenAndServe())
log.Info().Str("service_name", service_name).Str("address", address).Msg("Running HTTP server")
log.Fatal().Err(srv.ListenAndServe())
}
func redirectApp(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/app/", http.StatusFound)
}
func trackPage(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
log.Trace().Str("requested_uri", r.RequestURI).Msg("New request")
next.ServeHTTP(w, r.WithContext(r.Context()))
})
}

0
renderer/administration.go Normal file → Executable file
View File

36
renderer/agenda.go Normal file → Executable file
View File

@ -30,22 +30,31 @@ func (renderer *Renderer) AgendaHistory(w http.ResponseWriter, r *http.Request,
renderer.Render("agenda history", w, r, files, state)
}
func (renderer *Renderer) AgendaCreateEvent(w http.ResponseWriter, r *http.Request) {
func (renderer *Renderer) AgendaCreateEvent(w http.ResponseWriter, r *http.Request, events_file_types []string, file_types_map map[string]string, documents any) {
files := renderer.ThemeConfig.GetStringSlice("views.agenda.create_event.files")
state := NewState(r, renderer.ThemeConfig, agendaMenu)
state.ViewState = map[string]any{
"events_file_types": events_file_types,
"file_types_map": file_types_map,
"documents": documents,
}
renderer.Render("agenda create event", w, r, files, state)
}
func (renderer *Renderer) AgendaDisplayEvent(w http.ResponseWriter, r *http.Request, event any, group any, subscribers map[string]any, beneficiaries any) {
func (renderer *Renderer) AgendaDisplayEvent(w http.ResponseWriter, r *http.Request, event any, group any, events_file_types []string, file_types_map map[string]string, documents any, subscribers map[string]any, beneficiaries any) {
files := renderer.ThemeConfig.GetStringSlice("views.agenda.display_event.files")
state := NewState(r, renderer.ThemeConfig, agendaMenu)
state.ViewState = map[string]any{
"event": event,
"group": group,
"subscribers": subscribers,
"beneficiaries": beneficiaries,
"event": event,
"group": group,
"events_file_types": events_file_types,
"file_types_map": file_types_map,
"documents": documents,
"subscribers": subscribers,
"beneficiaries": beneficiaries,
}
renderer.Render("agenda create event", w, r, files, state)
@ -100,3 +109,18 @@ func (renderer *Renderer) AgendaDeleteEvent(w http.ResponseWriter, r *http.Reque
renderer.Render("event_deleteEvent", w, r, files, state)
}
////////Event documents////////////////////////
// func (renderer *Renderer) EventDocuments(w http.ResponseWriter, r *http.Request, event any, documents []any) {
// files := renderer.ThemeConfig.GetStringSlice("views.agenda.event_files.files")
// state := NewState(r, renderer.ThemeConfig, agendaMenu)
// state.ViewState = map[string]any{
// "event": event,
// "documents": documents,
// "eventid": event.(map[string]any)["id"],
// "eventtitle": event.(map[string]any)["title"],
// }
// renderer.Render("event_files", w, r, files, state)
// }

0
renderer/auth.go Normal file → Executable file
View File

5
renderer/beneficiaries.go Normal file → Executable file
View File

@ -5,6 +5,7 @@ import (
"html/template"
"net/http"
fleetsstorage "git.coopgo.io/coopgo-platform/fleets/storage"
mobilityaccountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
)
@ -52,7 +53,7 @@ type BeneficiariesDisplayState struct {
Beneficiary any
}
func (renderer *Renderer) BeneficiaryDisplay(w http.ResponseWriter, r *http.Request, beneficiary any, bookings []any, organizations []any, beneficiaries_file_types []string, file_types_map map[string]string, documents any) {
func (renderer *Renderer) BeneficiaryDisplay(w http.ResponseWriter, r *http.Request, beneficiary any, bookings []fleetsstorage.Booking, organizations []any, beneficiaries_file_types []string, file_types_map map[string]string, documents any, event interface{}) {
files := renderer.ThemeConfig.GetStringSlice("views.beneficiaries.display.files")
state := NewState(r, renderer.ThemeConfig, beneficiariesMenu)
state.ViewState = map[string]any{
@ -62,8 +63,8 @@ func (renderer *Renderer) BeneficiaryDisplay(w http.ResponseWriter, r *http.Requ
"file_types_map": file_types_map,
"documents": documents,
"organizations": organizations,
"event": event,
}
renderer.Render("beneficiaries_display", w, r, files, state)
}

4
renderer/dashboard.go Normal file → Executable file
View File

@ -4,11 +4,12 @@ import (
"net/http"
agendastorage "git.coopgo.io/coopgo-platform/agenda/storage"
fleetstorage "git.coopgo.io/coopgo-platform/fleets/storage"
)
const dashboardMenu = "dashboard"
func (renderer *Renderer) Dashboard(w http.ResponseWriter, r *http.Request, accounts []any, nbaccounts int, count_members int, events []agendastorage.Event) {
func (renderer *Renderer) Dashboard(w http.ResponseWriter, r *http.Request, accounts []any, nbaccounts int, count_members int, events []agendastorage.Event, fleets []fleetstorage.Booking) {
files := renderer.ThemeConfig.GetStringSlice("views.dashboard.files")
state := NewState(r, renderer.ThemeConfig, dashboardMenu)
state.ViewState = map[string]any{
@ -18,6 +19,7 @@ func (renderer *Renderer) Dashboard(w http.ResponseWriter, r *http.Request, acco
},
"count_members": count_members,
"events": events,
"fleets": fleets,
}
renderer.Render("dashboard", w, r, files, state)

0
renderer/directory.go Normal file → Executable file
View File

0
renderer/func-maps.go Normal file → Executable file
View File

0
renderer/group.go Normal file → Executable file
View File

0
renderer/group_module.go Normal file → Executable file
View File

0
renderer/journeys.go Normal file → Executable file
View File

0
renderer/layout.go Normal file → Executable file
View File

0
renderer/mailer.go Normal file → Executable file
View File

0
renderer/members.go Normal file → Executable file
View File

7
renderer/renderer.go Normal file → Executable file
View File

@ -9,7 +9,8 @@ import (
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
"git.coopgo.io/coopgo-platform/emailing"
"git.coopgo.io/coopgo-platform/groups-management/storage"
"github.com/coreos/go-oidc"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
)
@ -66,7 +67,7 @@ func (renderer *Renderer) Render(name string, w http.ResponseWriter, r *http.Req
err := t.ExecuteTemplate(w, "main", state)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
}
@ -95,7 +96,7 @@ func (renderer *Renderer) RenderNoLayout(name string, w http.ResponseWriter, r *
t = template.Must(t.ParseFiles(prefixed_files...))
err := t.ExecuteTemplate(w, "main", state)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
}

0
renderer/support.go Normal file → Executable file
View File

11
renderer/vehicle-management.go Normal file → Executable file
View File

@ -5,28 +5,31 @@ import (
filestorage "git.coopgo.io/coopgo-apps/parcoursmob/utils/storage"
fleetsstorage "git.coopgo.io/coopgo-platform/fleets/storage"
mobilityaccountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
)
const vehiclesmanagementMenu = "vehicles_management"
func (renderer *Renderer) VehiclesManagementOverview(w http.ResponseWriter, r *http.Request, vehicles []fleetsstorage.Vehicle, vehicles_map map[string]fleetsstorage.Vehicle, bookings []fleetsstorage.Booking) {
func (renderer *Renderer) VehiclesManagementOverview(w http.ResponseWriter, r *http.Request, vehicles []fleetsstorage.Vehicle, vehicles_map map[string]fleetsstorage.Vehicle, driversMap map[string]mobilityaccountsstorage.Account, bookings []fleetsstorage.Booking) {
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.overview.files")
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
state.ViewState = map[string]any{
"vehicles": vehicles,
"bookings": bookings,
"vehicles_map": vehicles_map,
"drivers_map": driversMap,
}
renderer.Render("fleet overview", w, r, files, state)
}
func (renderer *Renderer) VehiclesManagementBookingsList(w http.ResponseWriter, r *http.Request, vehicles_map map[string]fleetsstorage.Vehicle, bookings []fleetsstorage.Booking, cacheid string) {
func (renderer *Renderer) VehiclesManagementBookingsList(w http.ResponseWriter, r *http.Request, vehiclesMap map[string]fleetsstorage.Vehicle, driversMap map[string]mobilityaccountsstorage.Account, bookings []fleetsstorage.Booking, cacheid string) {
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.bookings_list.files")
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
state.ViewState = map[string]any{
"bookings": bookings,
"vehicles_map": vehicles_map,
"vehicles_map": vehiclesMap,
"drivers_map": driversMap,
"cacheid": cacheid,
}
@ -89,4 +92,4 @@ func (renderer *Renderer) UnbookingVehicle(w http.ResponseWriter, r *http.Reques
renderer.Render("vehicule unbooking", w, r, files, state)
}
}

0
renderer/vehicles.go Normal file → Executable file
View File

0
services/agenda.go Normal file → Executable file
View File

11
services/fleets.go Normal file → Executable file
View File

@ -7,6 +7,7 @@ import (
"git.coopgo.io/coopgo-apps/parcoursmob/utils/sorting"
fleets "git.coopgo.io/coopgo-platform/fleets/grpcapi"
"git.coopgo.io/coopgo-platform/fleets/storage"
"github.com/rs/zerolog/log"
"google.golang.org/grpc"
)
@ -56,13 +57,17 @@ func (s *ServicesHandler) GetBookings() (bookings []storage.Booking, err error)
func (s *ServicesHandler) GetVehiclesMap() (vehicles map[string]storage.Vehicle, err error) {
vehicles = map[string]storage.Vehicle{}
request := &fleets.GetVehiclesRequest{}
request := &fleets.GetVehiclesRequest{
Namespaces: []string{"parcoursmob"},
}
resp, err := s.GRPC.Fleets.GetVehicles(context.TODO(), request)
if err == nil {
if err != nil {
log.Error().Err(err).Msg("")
} else {
for _, vehicle := range resp.Vehicles {
vehicles[vehicle.Id] = vehicle.ToStorageType()
}
}
return
return vehicles, err
}

0
services/groupsmanagement.go Normal file → Executable file
View File

16
services/mobilityaccounts.go Normal file → Executable file
View File

@ -42,6 +42,22 @@ func (s *ServicesHandler) GetBeneficiaries() (accounts []storage.Account, err er
return
}
func (s *ServicesHandler) GetBeneficiariesMap() (accounts map[string]storage.Account, err error) {
accounts = map[string]storage.Account{}
request := &mobilityaccounts.GetAccountsRequest{
Namespaces: []string{"parcoursmob_beneficiaries"},
}
resp, err := s.GRPC.MobilityAccounts.GetAccounts(context.TODO(), request)
if err == nil {
for _, v := range resp.Accounts {
accounts[v.Id] = v.ToStorageType()
}
}
return
}
func (s *ServicesHandler) GetAccounts() (accounts []storage.Account, err error) {
accounts = []storage.Account{}
request := &mobilityaccounts.GetAccountsRequest{

0
services/services.go Normal file → Executable file
View File

1
themes Submodule

@ -0,0 +1 @@
Subproject commit db4c22699eff6756851b0d3eff430b7bbe4c1c1b

0
utils/form-validators/form-validators.go Normal file → Executable file
View File

0
utils/form-validators/phone-numbers.go Normal file → Executable file
View File

0
utils/icons/svg-icons.go Normal file → Executable file
View File

4
utils/identification/groups.go Normal file → Executable file
View File

@ -6,6 +6,7 @@ import (
"net/http"
groupsmanagement "git.coopgo.io/coopgo-platform/groups-management/grpcapi"
"github.com/rs/zerolog/log"
)
const GroupKey ContextKey = "group"
@ -19,7 +20,6 @@ func (p *IdentificationProvider) GroupsMiddleware(next http.Handler) http.Handle
o, ok := session.Values["organization"]
if !ok || o == nil {
fmt.Println("no organization")
http.Redirect(w, r, "/auth/groups/", http.StatusFound)
return
}
@ -29,7 +29,7 @@ func (p *IdentificationProvider) GroupsMiddleware(next http.Handler) http.Handle
claimgroups, ok := claims["groups"].([]any)
if !ok {
fmt.Println("cast issue")
log.Error().Msg("cast issue")
w.WriteHeader(http.StatusInternalServerError)
return
}

34
utils/identification/oidc.go Normal file → Executable file
View File

@ -4,14 +4,14 @@ import (
"context"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"net/http"
"git.coopgo.io/coopgo-apps/parcoursmob/services"
"git.coopgo.io/coopgo-apps/parcoursmob/utils/storage"
"github.com/coreos/go-oidc"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/gorilla/sessions"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
"golang.org/x/oauth2"
)
@ -40,7 +40,27 @@ func NewIdentificationProvider(cfg *viper.Viper, services *services.ServicesHand
provider, err := oidc.NewProvider(context.Background(), providerURL)
if err != nil {
return nil, err
var (
issuerUrl = cfg.GetString("identification.oidc.provider_config.issuer_url")
authUrl = cfg.GetString("identification.oidc.provider_config.auth_url")
tokenUrl = cfg.GetString("identification.oidc.provider_config.token_url")
userInfoUrl = cfg.GetString("identification.oidc.provider_config.user_info_url")
jwksUrl = cfg.GetString("identification.oidc.provider_config.jwks_url")
algorithms = []string{"RS256"}
)
if issuerUrl == "" || authUrl == "" || tokenUrl == "" || jwksUrl == "" {
return nil, err
}
providerConfig := oidc.ProviderConfig{
IssuerURL: issuerUrl,
AuthURL: authUrl,
TokenURL: tokenUrl,
UserInfoURL: userInfoUrl,
JWKSURL: jwksUrl,
Algorithms: algorithms,
}
provider = providerConfig.NewProvider(context.Background())
}
oauth2Config := oauth2.Config{
@ -71,18 +91,18 @@ func (p *IdentificationProvider) Middleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
session, err := p.SessionsStore.Get(r, "parcoursmob_session")
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
if session.Values["idtoken"] == nil || session.Values["idtoken"] == "" {
state, err := newState()
if err != nil {
panic(err)
}
session.Values["state"] = state
session.Save(r, w)
http.Redirect(w, r, p.OAuth2Config.AuthCodeURL(state), http.StatusFound)
url := p.OAuth2Config.AuthCodeURL(state)
http.Redirect(w, r, url, http.StatusFound)
return
}
@ -102,7 +122,7 @@ func (p *IdentificationProvider) Middleware(next http.Handler) http.Handler {
err = idtoken.Claims(&claims)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
}
ctx := context.WithValue(r.Context(), IdtokenKey, idtoken)

4
utils/profile-pictures/profile-pictures.go Normal file → Executable file
View File

@ -1,12 +1,12 @@
package profilepictures
import (
"fmt"
"image"
"image/color"
"image/draw"
"github.com/fogleman/gg"
"github.com/rs/zerolog/log"
"golang.org/x/image/font"
"golang.org/x/image/math/fixed"
)
@ -21,7 +21,7 @@ func DefaultProfilePicture(initials string) *image.RGBA {
ff, err := gg.LoadFontFace("themes/default/web/fonts/bitter.ttf", 150.0)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return img
}

0
utils/sorting/beneficiaries.go Normal file → Executable file
View File

0
utils/sorting/events.go Normal file → Executable file
View File

0
utils/sorting/fleets.go Normal file → Executable file
View File

0
utils/sorting/groups.go Normal file → Executable file
View File

0
utils/sorting/sorting.go Normal file → Executable file
View File

1
utils/storage/badger.go Normal file
View File

@ -0,0 +1 @@
package storage

0
utils/storage/cache.go Normal file → Executable file
View File

19
utils/storage/etcd.go Normal file → Executable file
View File

@ -8,6 +8,7 @@ import (
"fmt"
"time"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/client/v3/namespace"
@ -75,7 +76,7 @@ func NewEtcdHandler(cfg *viper.Viper) (*EtcdHandler, error) {
DialTimeout: 5 * time.Second,
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return nil, err
}
@ -92,7 +93,7 @@ func NewEtcdHandler(cfg *viper.Viper) (*EtcdHandler, error) {
func (s *EtcdHandler) Put(k string, v any) error {
data, err := s.serializer.Serialize(v)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
// _, err = s.Client.KV.Put(context.TODO(), k, data.String())
@ -100,7 +101,7 @@ func (s *EtcdHandler) Put(k string, v any) error {
_, err = s.Client.KV.Put(ctx, k, string(data))
cancel()
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
return nil
@ -109,13 +110,13 @@ func (s *EtcdHandler) Put(k string, v any) error {
func (s *EtcdHandler) PutWithTTL(k string, v any, duration time.Duration) error {
lease, err := s.Client.Lease.Grant(context.TODO(), int64(duration.Seconds()))
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
data, err := s.serializer.Serialize(v)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
// _, err = s.Client.KV.Put(context.TODO(), k, data.String(), clientv3.WithLease(lease.ID))
@ -124,7 +125,7 @@ func (s *EtcdHandler) PutWithTTL(k string, v any, duration time.Duration) error
cancel()
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
return nil
@ -135,14 +136,14 @@ func (s *EtcdHandler) Get(k string) (any, error) {
resp, err := s.Client.KV.Get(ctx, k)
cancel()
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return nil, err
}
for _, v := range resp.Kvs {
var data any
err := s.serializer.Deserialize([]byte(v.Value), &data)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return nil, err
}
// We return directly as we want to last revision of value
@ -156,7 +157,7 @@ func (s *EtcdHandler) Delete(k string) error {
_, err := s.Client.KV.Delete(ctx, k)
cancel()
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
return nil

1
utils/storage/files.go Normal file → Executable file
View File

@ -10,6 +10,7 @@ import (
const (
PREFIX_BENEFICIARIES = "beneficiaries"
PREFIX_BOOKINGS = "fleets_bookings"
PREFIX_AGENDA = "event_files"
)
type FileInfo struct {

2
utils/storage/kv.go Normal file → Executable file
View File

@ -15,4 +15,6 @@ type KVHandler interface {
func NewKVHandler(cfg *viper.Viper) (KVHandler, error) {
return NewEtcdHandler(cfg)
return nil, nil
}

14
utils/storage/minio.go Normal file → Executable file
View File

@ -2,12 +2,12 @@ package storage
import (
"context"
"fmt"
"io"
"strings"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
)
@ -23,7 +23,7 @@ func NewMinioStorageHandler(cfg *viper.Viper) (*MinioStorageHandler, error) {
Secure: cfg.GetBool("storage.files.minio.use_ssl"),
})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return nil, err
}
@ -53,13 +53,13 @@ func (s *MinioStorageHandler) List(prefix string) []FileInfo {
for object := range objectCh {
if object.Err != nil {
fmt.Println("Error : ", object.Err)
log.Error().Str("prefix", prefix).Err(object.Err).Msg("Error listing files for prefix")
continue
}
objinfo, err := s.Client.StatObject(context.Background(), s.BucketName, object.Key, minio.StatObjectOptions{})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
continue
}
@ -82,12 +82,12 @@ func (s *MinioStorageHandler) List(prefix string) []FileInfo {
func (s *MinioStorageHandler) Get(prefix string, file string) (io.Reader, *FileInfo, error) {
object, err := s.Client.GetObject(context.Background(), s.BucketName, prefix+"/"+file, minio.GetObjectOptions{})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return nil, nil, err
}
objinfo, err := s.Client.StatObject(context.Background(), s.BucketName, prefix+"/"+file, minio.StatObjectOptions{})
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return nil, nil, err
}
@ -117,7 +117,7 @@ func (s *MinioStorageHandler) Copy(src string, dst string) error {
_, err := s.Client.CopyObject(context.Background(), dstOpts, srcOpts)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
return nil

11
utils/storage/sessions.go Normal file → Executable file
View File

@ -11,6 +11,7 @@ import (
"github.com/gorilla/securecookie"
"github.com/gorilla/sessions"
"github.com/rs/zerolog/log"
)
// Amount of time for cookies/kv keys to expire.
@ -76,7 +77,7 @@ func (s *SessionStore) Save(r *http.Request, w http.ResponseWriter, session *ses
// Marked for deletion.
if session.Options.MaxAge <= 0 {
if err := s.delete(r.Context(), session); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
http.SetCookie(w, sessions.NewCookie(session.Name(), "", session.Options))
@ -87,13 +88,13 @@ func (s *SessionStore) Save(r *http.Request, w http.ResponseWriter, session *ses
}
if err := s.save(r.Context(), session); err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
encoded, err := securecookie.EncodeMulti(session.Name(), session.ID, s.Codecs...)
if err != nil {
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
http.SetCookie(w, sessions.NewCookie(session.Name(), encoded, session.Options))
@ -104,13 +105,11 @@ func (s *SessionStore) Save(r *http.Request, w http.ResponseWriter, session *ses
// save stores the session in kv.
func (s *SessionStore) save(ctx context.Context, session *sessions.Session) error {
m := make(map[string]interface{}, len(session.Values))
fmt.Println(m)
for k, v := range session.Values {
fmt.Println(v)
ks, ok := k.(string)
if !ok {
err := fmt.Errorf("non-string key value, cannot serialize session: %v", k)
fmt.Println(err)
log.Error().Err(err).Msg("")
return err
}
m[ks] = v