From 30a0837fb5c81c890d6d0572d70dcffdeacd9ba3 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 24 Nov 2020 12:54:48 -0500 Subject: [PATCH] API: Migrate to core-go --- api/go.mod | 13 +- api/go.sum | 309 ++++- api/gqlgen.yml | 4 +- api/graph/api/generated.go | 2449 ++++++++++++++++++++++----------- api/graph/complexity.go | 16 +- api/graph/model/acl.go | 52 +- api/graph/model/artifact.go | 57 +- api/graph/model/models_gen.go | 88 +- api/graph/model/repository.go | 71 +- api/graph/model/user.go | 59 +- api/graph/schema.graphqls | 69 +- api/graph/schema.resolvers.go | 184 ++- api/loaders/middleware.go | 391 +++--- api/server.go | 27 +- 14 files changed, 2569 insertions(+), 1220 deletions(-) diff --git a/api/go.mod b/api/go.mod index d7a835d..ba3d548 100644 --- a/api/go.mod +++ b/api/go.mod @@ -3,10 +3,9 @@ module git.sr.ht/~sircmpwn/git.sr.ht/api go 1.14 require ( + git.sr.ht/~sircmpwn/core-go v0.0.0-20201121171719-31fc9fce43e9 git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3 - git.sr.ht/~sircmpwn/go-bare v0.0.0-20200623145341-debb068b456a // indirect - git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200713173736-e357c3b281fd - github.com/99designs/gqlgen v0.11.4-0.20200512031635-40570d1b4d70 + github.com/99designs/gqlgen v0.13.0 github.com/Masterminds/squirrel v1.4.0 github.com/agnivade/levenshtein v1.1.0 // indirect github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 // indirect @@ -19,21 +18,19 @@ require ( github.com/gorilla/websocket v1.4.2 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/jcmturner/gokrb5/v8 v8.4.0 // indirect - github.com/lib/pq v1.7.0 + github.com/lib/pq v1.8.0 github.com/martinlindhe/base36 v1.1.0 github.com/matryer/moq v0.0.0-20200310130814-7721994d1b54 // indirect github.com/mitchellh/mapstructure v1.3.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.7.1 // indirect - github.com/prometheus/common v0.10.0 // indirect github.com/urfave/cli/v2 v2.2.0 // indirect github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec github.com/vektah/dataloaden v0.3.0 // indirect github.com/vektah/gqlparser v1.3.1 - github.com/vektah/gqlparser/v2 v2.0.1 - golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 + github.com/vektah/gqlparser/v2 v2.1.0 + golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect - golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae // indirect google.golang.org/protobuf v1.25.0 // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect gopkg.in/jcmturner/aescts.v1 v1.0.1 // indirect diff --git a/api/go.sum b/api/go.sum index a3bc88f..42ad465 100644 --- a/api/go.sum +++ b/api/go.sum @@ -1,19 +1,28 @@ 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= +git.sr.ht/~sircmpwn/core-go v0.0.0-20201121171719-31fc9fce43e9 h1:w0toCjfdNh2JE4tes7on3pr41reASuYewcH5wGwUz+U= +git.sr.ht/~sircmpwn/core-go v0.0.0-20201121171719-31fc9fce43e9/go.mod h1:LLLvDJIgVgmA/sHl0fzj9UvpFiLi0v8a/aiBc3g22ik= +git.sr.ht/~sircmpwn/dowork v0.0.0-20201013160733-35ca012e4dc8 h1:ltrdYYclC4wQEg3QdcG2hgYAFCk+6/l2vU1OXygKXVA= +git.sr.ht/~sircmpwn/dowork v0.0.0-20201013160733-35ca012e4dc8/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw= git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3 h1:4wDp4BKF7NQqoh73VXpZsB/t1OEhDpz/zEpmdQfbjDk= git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= git.sr.ht/~sircmpwn/go-bare v0.0.0-20200623145341-debb068b456a h1:bqT/ygbVtD6b/B/skCQ+hZI4OtwuyKFQJxwS3z1lY3g= git.sr.ht/~sircmpwn/go-bare v0.0.0-20200623145341-debb068b456a/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= -git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200608172945-9ecf6d2cf9c2 h1:gEkvj5toEIU9fwEFNR2Ni5BC7Gsh7XQ4d3k54Runjn8= -git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200608172945-9ecf6d2cf9c2/go.mod h1:V38DHc2+k1GmbNT4pE6OH/2fOXYcZHn9o/PUAEXH1P0= -git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200612165341-a069568d2138 h1:z7xo4KIDE1HDEHpSN4Vop8p0iG43RAkGdRVxXbCvblM= -git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200612165341-a069568d2138/go.mod h1:V38DHc2+k1GmbNT4pE6OH/2fOXYcZHn9o/PUAEXH1P0= -git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200713173736-e357c3b281fd h1:ZP3ZPyWOQw+g2q9tfYKjahA7mPDAjk+5c0kNpDW8RwY= -git.sr.ht/~sircmpwn/gql.sr.ht v0.0.0-20200713173736-e357c3b281fd/go.mod h1:V38DHc2+k1GmbNT4pE6OH/2fOXYcZHn9o/PUAEXH1P0= +git.sr.ht/~sircmpwn/go-bare v0.0.0-20200812160916-d2c72e1a5018 h1:89QMorzx6ML69PKPoayL3HuSfb7WqAlxD1dZ7DyzD0k= +git.sr.ht/~sircmpwn/go-bare v0.0.0-20200812160916-d2c72e1a5018/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/gqlgen v0.11.4-0.20200512031635-40570d1b4d70 h1:bZj4qAWfwu0SFTx5QsEI+y7JTji7L7ndm6snyDEIVLs= github.com/99designs/gqlgen v0.11.4-0.20200512031635-40570d1b4d70/go.mod h1:RgX5GRRdDWNkh4pBrdzNpNPFVsdoUFY2+adM6nb1N+4= +github.com/99designs/gqlgen v0.13.0 h1:haLTcUp3Vwp80xMVEg5KRNwzfUrgFdRmtBY8fuB8scA= +github.com/99designs/gqlgen v0.13.0/go.mod h1:NV130r6f4tpRWuAI+zsrSdooO/eWUv+Gyyoi3rEfXIk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/squirrel v1.4.0 h1:he5i/EXixZxrBUWcxzDYMiju9WZ3ld/l7QBNuo/eN3w= github.com/Masterminds/squirrel v1.4.0/go.mod h1:yaPeOnPG5ZRwL9oKdTsO/prlkPbXWZlRVMQ/gGlzIuA= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/agnivade/levenshtein v1.0.3 h1:M5ZnqLOoZR8ygVq0FfkXsNOKzMCk0xRiow0R5+5VkQ0= github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs= @@ -24,34 +33,82 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy 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/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5 h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4= github.com/alexbrainman/sspi v0.0.0-20180613141037-e580b900e9f5/go.mod h1:976q2ETgjT2snVCf2ZaBnyBbVoPERGjUz+0sofzEfro= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= 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 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emersion/go-message v0.11.1/go.mod h1:C4jnca5HOTo4bGN9YdqNQM9sITuT3Y0K6bSUw9RklvY= +github.com/emersion/go-message v0.13.1-0.20201112194930-f77964fe28bd h1:6CXxdoOzAyQForkd2U/JNceVyNpmg92alCU2R+4dwIY= +github.com/emersion/go-message v0.13.1-0.20201112194930-f77964fe28bd/go.mod h1:SXSs/8KamlsyxjpHL1Q3yf5Jrv7QG5icuvPK1SMcnzw= +github.com/emersion/go-pgpmail v0.1.0 h1:+NuU9UtGnmmKvmI8evxmTAPXfUod6Gbf2uYT7rxTZ7w= +github.com/emersion/go-pgpmail v0.1.0/go.mod h1:9Sy6uI+dlTN56tcWMtBQHqNDeea27xYItaiZ/3XC76g= +github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 h1:OJyUGMJTzHTd1XQp98QTaHernxMYzRaOasRir9hUlFQ= +github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ= +github.com/emersion/go-smtp v0.14.0 h1:RYW203p+EcPjL8Z/ZpT9lZ6iOc8MG1MQzEx1UKEkXlA= +github.com/emersion/go-smtp v0.14.0/go.mod h1:qm27SGYgoIPRot6ubfQ/GpiPy/g3PaZAVRxiO/sDUgQ= +github.com/emersion/go-textwrapper v0.0.0-20160606182133-d0e65e56babe/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U= +github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 h1:IbFBtwoTQyw0fIM5xv1HF+Y+3ZijDR839WMulgxCcUY= +github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U= github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fernet/fernet-go v0.0.0-20191111064656-eff2850e6001 h1:/UMxx5lGDg30aioUL9e7xJnbJfJeX7vhcm57fa5udaI= github.com/fernet/fernet-go v0.0.0-20191111064656-eff2850e6001/go.mod h1:2H9hjfbpSMHwY503FclkV/lZTBh2YlOmLLSda12uL8c= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-chi/chi v4.1.1+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= @@ -66,12 +123,22 @@ github.com/go-git/go-git/v5 v5.0.0 h1:k5RWPm4iJwYtfWoxIJy4wJX9ON7ihPeZZYC1fLYDnp github.com/go-git/go-git/v5 v5.0.0/go.mod h1:oYD8y9kWsGINPFJoLdaScGCN6dlKg23blmClfZwtUVA= 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/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= 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-redis/redis/v8 v8.2.3 h1:eNesND+DWt/sjQOtPFxAbQkTIXaXX00qNLxjVWkZ70k= +github.com/go-redis/redis/v8 v8.2.3/go.mod h1:ysgGY09J/QeDYbu3HikWEIPCwaeOkuNoTgKayTEaEOw= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 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= @@ -84,25 +151,62 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= @@ -120,13 +224,25 @@ github.com/jcmturner/gokrb5/v8 v8.4.0/go.mod h1:T1hnNppQsBtxW0tCHMHTkAt8n/sABdzZ github.com/jcmturner/rpc/v2 v2.0.2 h1:gMB4IwRXYsWw4Bc6o/az2HJgFUA1ffSh90i26ZJ6Xl0= github.com/jcmturner/rpc/v2 v2.0.2/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +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/kavu/go_reuseport v1.5.0 h1:UNuiY2OblcqAtVDE8Gsg1kZz8zbBWg907sP1ceBV+bk= +github.com/kavu/go_reuseport v1.5.0/go.mod h1:CG8Ee7ceMFSMnx/xr25Vm0qXaj2Z4i5PWoUx+JZ5/CU= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 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.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 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/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -141,21 +257,38 @@ github.com/lib/pq v1.6.0 h1:I5DPxhYJChW9KYc66se+oKFFQX6VuQrKiprsX6ivRZc= github.com/lib/pq v1.6.0/go.mod h1:4vXEAYvW1fRQ2/FhZ78H73A60MHw1geSm145z2mdY1g= github.com/lib/pq v1.7.0 h1:h93mCPfUSkaul3Ka/VG8uZdmW1uMHDGxzu0NWHuJmHY= github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.8.0 h1:9xohqzkUwzR4Ga4ivdTcawVS89YSDVxXMa3xJX3cGzg= +github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/martinlindhe/base36 v1.0.0 h1:eYsumTah144C0A8P1T/AVSUk5ZoLnhfYFM3OGQxB52A= github.com/martinlindhe/base36 v1.0.0/go.mod h1:+AtEs8xrBpCeYgSLoY/aJ6Wf37jtBuR0s35750M27+8= github.com/martinlindhe/base36 v1.1.0 h1:cIwvvwYse/0+1CkUPYH5ZvVIYG3JrILmQEIbLuar02Y= github.com/martinlindhe/base36 v1.1.0/go.mod h1:+AtEs8xrBpCeYgSLoY/aJ6Wf37jtBuR0s35750M27+8= github.com/matryer/moq v0.0.0-20200106131100-75d0ddfc0007/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/matryer/moq v0.0.0-20200310130814-7721994d1b54/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -164,45 +297,111 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.6.0 h1:YVPodQOcK15POxhgARIvnDRVpLcuK8mglnMrWfyrw6A= github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.14.0 h1:RHRyE8UocrbjU+6UvRzwi6HjiDfxrrBU91TtbKzkGp4= +github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.0 h1:jhMy6QXfi3y2HEzFoyuCj40z4OZIIHHPtFyCMftmvKA= github.com/prometheus/procfs v0.1.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 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/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 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/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/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= 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/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -210,22 +409,48 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= +github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec h1:DGmKwyZwEB8dI7tbLt/I/gQuP559o/0FrAkHKlQM/Ks= github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec/go.mod h1:owBmyHYMLkxyrugmfwE/DLJyW8Ro9mkphwuVErQ0iUw= github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= +github.com/vektah/dataloaden v0.3.0 h1:ZfVN2QD6swgvp+tDqdH/OIT/wu3Dhu0cus0k5gIZS84= github.com/vektah/dataloaden v0.3.0/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= github.com/vektah/gqlparser v1.3.1 h1:8b0IcD3qZKWJQHSzynbDlrtP3IxVydZ2DZepCGofqfU= github.com/vektah/gqlparser v1.3.1/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= github.com/vektah/gqlparser/v2 v2.0.1 h1:xgl5abVnsd4hkN9rk65OJID9bfcLSMuTaTcZj777q1o= github.com/vektah/gqlparser/v2 v2.0.1/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms= +github.com/vektah/gqlparser/v2 v2.1.0 h1:uiKJ+T5HMGGQM2kRKQ8Pxw8+Zq9qhhZhz/lieYvCMns= +github.com/vektah/gqlparser/v2 v2.1.0/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms= github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/otel v0.11.0 h1:IN2tzQa9Gc4ZVKnTaMbPVcHjvzOdg5n9QfnmlqiET7E= +go.opentelemetry.io/otel v0.11.0/go.mod h1:G8UCk+KooF2HLkgo8RHX9epABH/aRGYET7gQOqBVdB0= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/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-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -235,74 +460,133 @@ golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/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-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/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-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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/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= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 h1:OjiUf46hAmXblsZdnoSXsEUSKU8r1UEzcL5RVZ4gO9Y= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb h1:HS9IzC4UFbpMBLQUDSQcU+ViVT1vdFCQVjdPVpTlZrs= +golang.org/x/sys v0.0.0-20201013132646-2da7054afaeb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.4-0.20201021145329-22f1617af38e h1:0kyKOEC0chG7FKmnf/1uNwvDLc3NtNTRip2rXAN9nwI= +golang.org/x/text v0.3.4-0.20201021145329-22f1617af38e/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/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-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a h1:gILuVKC+ZPD6g/tj6zBOdnOH1ZHI0zZ86+KLMogc6/s= golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 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= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= 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= @@ -320,8 +604,13 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks 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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= @@ -329,15 +618,23 @@ gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuv gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= gopkg.in/mail.v2 v2.3.1 h1:WYFn/oANrAGP2C0dcV6/pbkPzv8yGzqTjPmTeO7qoXk= gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 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.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.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k= diff --git a/api/gqlgen.yml b/api/gqlgen.yml index 6a7800a..c696039 100644 --- a/api/gqlgen.yml +++ b/api/gqlgen.yml @@ -56,7 +56,7 @@ models: - github.com/99designs/gqlgen/graphql.Int32 Cursor: model: - - git.sr.ht/~sircmpwn/gql.sr.ht/model.Cursor + - git.sr.ht/~sircmpwn/core-go/model.Cursor Filter: model: - - git.sr.ht/~sircmpwn/gql.sr.ht/model.Filter + - git.sr.ht/~sircmpwn/core-go/model.Filter diff --git a/api/graph/api/generated.go b/api/graph/api/generated.go index 3b94502..5d30b96 100644 --- a/api/graph/api/generated.go +++ b/api/graph/api/generated.go @@ -12,8 +12,8 @@ import ( "sync/atomic" "time" + model1 "git.sr.ht/~sircmpwn/core-go/model" "git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model" - model1 "git.sr.ht/~sircmpwn/gql.sr.ht/model" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" gqlparser "github.com/vektah/gqlparser/v2" @@ -50,6 +50,8 @@ type ResolverRoot interface { } type DirectiveRoot struct { + Access func(ctx context.Context, obj interface{}, next graphql.Resolver, scope model.AccessScope, kind model.AccessKind) (res interface{}, err error) + Scopehelp func(ctx context.Context, obj interface{}, next graphql.Resolver, details string) (res interface{}, err error) } type ComplexityRoot struct { @@ -1247,6 +1249,27 @@ var sources = []*ast.Source{ scalar Time scalar Upload +# Used to provide a human-friendly description of an access scope +directive @scopehelp(details: String!) on ENUM_VALUE + +enum AccessScope { + PROFILE @scopehelp(details: "profile information") + REPOSITORIES @scopehelp(details: "repository metadata") + OBJECTS @scopehelp(details: "git objects & references") + ACLS @scopehelp(details: "access control lists") +} + +enum AccessKind { + RO @scopehelp(details: "read") + RW @scopehelp(details: "read and write") +} + +# Decorates fields for which access requires a particular OAuth 2.0 scope with +# read or write access. For the meta.sr.ht API, you have access to all public +# information without any special permissions - user profile information, +# public keys, and so on. +directive @access(scope: AccessScope!, kind: AccessKind!) on FIELD_DEFINITION + # https://semver.org type Version { major: Int! @@ -1282,7 +1305,7 @@ interface Entity { # prefixed with '~'. Additional entity types will be supported in the future. canonicalName: String! - repositories(cursor: Cursor, filter: Filter): RepositoryCursor! + repositories(cursor: Cursor, filter: Filter): RepositoryCursor! @access(scope: REPOSITORIES, kind: RO) } type User implements Entity { @@ -1296,14 +1319,14 @@ type User implements Entity { location: String bio: String - repositories(cursor: Cursor, filter: Filter): RepositoryCursor! + repositories(cursor: Cursor, filter: Filter): RepositoryCursor! @access(scope: REPOSITORIES, kind: RO) } type Repository { id: Int! created: Time! updated: Time! - owner: Entity! + owner: Entity! @access(scope: PROFILE, kind: RO) name: String! description: String visibility: Visibility! @@ -1312,19 +1335,19 @@ type Repository { # clone URL. upstreamUrl: String - accessControlList(cursor: Cursor): ACLCursor! + accessControlList(cursor: Cursor): ACLCursor! @access(scope: ACLS, kind: RO) ## Plumbing API: - objects(ids: [String!]): [Object]! - references(cursor: Cursor): ReferenceCursor! + objects(ids: [String!]): [Object]! @access(scope: OBJECTS, kind: RO) + references(cursor: Cursor): ReferenceCursor! @access(scope: OBJECTS, kind: RO) ## Porcelain API: # NOTE: revspecs are git-compatible, e.g. "HEAD~4", "master", "9790b10") # The HEAD reference for this repository (equivalent to the default branch) - HEAD: Reference + HEAD: Reference @access(scope: OBJECTS, kind: RO) # Returns a list of comments sorted by committer time (similar to ` + "`" + `git log` + "`" + `'s # default ordering). @@ -1332,13 +1355,13 @@ type Repository { # If ` + "`" + `from` + "`" + ` is specified, it is interpreted as a revspec to start logging # from. A clever reader may notice that using commits[-1].from + "^" as the # from parameter is equivalent to passing the cursor to the next call. - log(cursor: Cursor, from: String): CommitCursor! + log(cursor: Cursor, from: String): CommitCursor! @access(scope: OBJECTS, kind: RO) # Returns a tree entry for a given path, at the given revspec. - path(revspec: String = "HEAD", path: String!): TreeEntry + path(revspec: String = "HEAD", path: String!): TreeEntry @access(scope: OBJECTS, kind: RO) # Returns the commit for a given revspec. - revparse_single(revspec: String!): Commit + revparse_single(revspec: String!): Commit @access(scope: OBJECTS, kind: RO) } # A cursor for enumerating a list of repositories @@ -1405,7 +1428,7 @@ type ACL { id: Int! created: Time! repository: Repository! - entity: Entity! + entity: Entity! @access(scope: PROFILE, kind: RO) mode: AccessMode } @@ -1529,10 +1552,10 @@ type Query { version: Version! # Returns the authenticated user. - me: User! + me: User! @access(scope: PROFILE, kind: RO) # Returns a specific user. - user(username: String!): User + user(username: String!): User @access(scope: PROFILE, kind: RO) # Returns repositories that the authenticated user has access to. # @@ -1541,17 +1564,17 @@ type Query { # will be to return all repositories that the user either (1) has been given # explicit access to via ACLs or (2) has implicit access to either by # ownership or group membership. - repositories(cursor: Cursor, filter: Filter): RepositoryCursor + repositories(cursor: Cursor, filter: Filter): RepositoryCursor @access(scope: REPOSITORIES, kind: RO) # Returns a specific repository by ID. - repository(id: Int!): Repository + repository(id: Int!): Repository @access(scope: REPOSITORIES, kind: RO) # Returns a specific repository, owned by the authenticated user. - repositoryByName(name: String!): Repository + repositoryByName(name: String!): Repository @access(scope: REPOSITORIES, kind: RO) # Returns a specific repository, owned by the given canonical name (e.g. # "~sircmpwn"). - repositoryByOwner(owner: String!, repo: String!): Repository + repositoryByOwner(owner: String!, repo: String!): Repository @access(scope: REPOSITORIES, kind: RO) } input RepoInput { @@ -1561,15 +1584,15 @@ input RepoInput { } type Mutation { - createRepository(params: RepoInput): Repository! - updateRepository(id: ID!, params: RepoInput): Repository! - deleteRepository(id: ID!): Repository! + createRepository(params: RepoInput): Repository! @access(scope: REPOSITORIES, kind: RW) + updateRepository(id: ID!, params: RepoInput): Repository! @access(scope: REPOSITORIES, kind: RW) + deleteRepository(id: ID!): Repository! @access(scope: REPOSITORIES, kind: RW) - updateACL(repoId: ID!, mode: AccessMode!, entity: ID!): ACL! - deleteACL(repoId: Int!, entity: ID!): ACL! + updateACL(repoId: ID!, mode: AccessMode!, entity: ID!): ACL! @access(scope: ACLS, kind: RW) + deleteACL(repoId: Int!, entity: ID!): ACL! @access(scope: ACLS, kind: RW) - uploadArtifact(repoId: Int!, revspec: String!, file: Upload!): Artifact! - deleteArtifact(id: Int!): Artifact! + uploadArtifact(repoId: Int!, revspec: String!, file: Upload!): Artifact! @access(scope: OBJECTS, kind: RW) + deleteArtifact(id: Int!): Artifact! @access(scope: OBJECTS, kind: RW) } `, BuiltIn: false}, } @@ -1579,11 +1602,51 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) // region ***************************** args.gotpl ***************************** +func (ec *executionContext) dir_access_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.AccessScope + if tmp, ok := rawArgs["scope"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("scope")) + arg0, err = ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, tmp) + if err != nil { + return nil, err + } + } + args["scope"] = arg0 + var arg1 model.AccessKind + if tmp, ok := rawArgs["kind"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("kind")) + arg1, err = ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, tmp) + if err != nil { + return nil, err + } + } + args["kind"] = arg1 + return args, nil +} + +func (ec *executionContext) dir_scopehelp_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["details"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("details")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["details"] = arg0 + return args, nil +} + func (ec *executionContext) field_Mutation_createRepository_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 *model.RepoInput if tmp, ok := rawArgs["params"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("params")) arg0, err = ec.unmarshalORepoInput2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐRepoInput(ctx, tmp) if err != nil { return nil, err @@ -1598,6 +1661,7 @@ func (ec *executionContext) field_Mutation_deleteACL_args(ctx context.Context, r args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["repoId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoId")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -1606,6 +1670,7 @@ func (ec *executionContext) field_Mutation_deleteACL_args(ctx context.Context, r args["repoId"] = arg0 var arg1 string if tmp, ok := rawArgs["entity"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entity")) arg1, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -1620,6 +1685,7 @@ func (ec *executionContext) field_Mutation_deleteArtifact_args(ctx context.Conte args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -1634,6 +1700,7 @@ func (ec *executionContext) field_Mutation_deleteRepository_args(ctx context.Con args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -1648,6 +1715,7 @@ func (ec *executionContext) field_Mutation_updateACL_args(ctx context.Context, r args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["repoId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoId")) arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -1656,6 +1724,7 @@ func (ec *executionContext) field_Mutation_updateACL_args(ctx context.Context, r args["repoId"] = arg0 var arg1 model.AccessMode if tmp, ok := rawArgs["mode"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("mode")) arg1, err = ec.unmarshalNAccessMode2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessMode(ctx, tmp) if err != nil { return nil, err @@ -1664,6 +1733,7 @@ func (ec *executionContext) field_Mutation_updateACL_args(ctx context.Context, r args["mode"] = arg1 var arg2 string if tmp, ok := rawArgs["entity"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("entity")) arg2, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -1678,6 +1748,7 @@ func (ec *executionContext) field_Mutation_updateRepository_args(ctx context.Con args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNID2string(ctx, tmp) if err != nil { return nil, err @@ -1686,6 +1757,7 @@ func (ec *executionContext) field_Mutation_updateRepository_args(ctx context.Con args["id"] = arg0 var arg1 *model.RepoInput if tmp, ok := rawArgs["params"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("params")) arg1, err = ec.unmarshalORepoInput2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐRepoInput(ctx, tmp) if err != nil { return nil, err @@ -1700,6 +1772,7 @@ func (ec *executionContext) field_Mutation_uploadArtifact_args(ctx context.Conte args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["repoId"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repoId")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -1708,6 +1781,7 @@ func (ec *executionContext) field_Mutation_uploadArtifact_args(ctx context.Conte args["repoId"] = arg0 var arg1 string if tmp, ok := rawArgs["revspec"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("revspec")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -1716,6 +1790,7 @@ func (ec *executionContext) field_Mutation_uploadArtifact_args(ctx context.Conte args["revspec"] = arg1 var arg2 graphql.Upload if tmp, ok := rawArgs["file"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("file")) arg2, err = ec.unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, tmp) if err != nil { return nil, err @@ -1730,6 +1805,7 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -1744,7 +1820,8 @@ func (ec *executionContext) field_Query_repositories_args(ctx context.Context, r args := map[string]interface{}{} var arg0 *model1.Cursor if tmp, ok := rawArgs["cursor"]; ok { - arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, tmp) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor")) + arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp) if err != nil { return nil, err } @@ -1752,7 +1829,8 @@ func (ec *executionContext) field_Query_repositories_args(ctx context.Context, r args["cursor"] = arg0 var arg1 *model1.Filter if tmp, ok := rawArgs["filter"]; ok { - arg1, err = ec.unmarshalOFilter2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐFilter(ctx, tmp) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + arg1, err = ec.unmarshalOFilter2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐFilter(ctx, tmp) if err != nil { return nil, err } @@ -1766,6 +1844,7 @@ func (ec *executionContext) field_Query_repositoryByName_args(ctx context.Contex args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -1780,6 +1859,7 @@ func (ec *executionContext) field_Query_repositoryByOwner_args(ctx context.Conte args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["owner"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("owner")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -1788,6 +1868,7 @@ func (ec *executionContext) field_Query_repositoryByOwner_args(ctx context.Conte args["owner"] = arg0 var arg1 string if tmp, ok := rawArgs["repo"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("repo")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -1802,6 +1883,7 @@ func (ec *executionContext) field_Query_repository_args(ctx context.Context, raw args := map[string]interface{}{} var arg0 int if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) arg0, err = ec.unmarshalNInt2int(ctx, tmp) if err != nil { return nil, err @@ -1816,6 +1898,7 @@ func (ec *executionContext) field_Query_user_args(ctx context.Context, rawArgs m args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["username"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("username")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -1830,7 +1913,8 @@ func (ec *executionContext) field_Reference_artifacts_args(ctx context.Context, args := map[string]interface{}{} var arg0 *model1.Cursor if tmp, ok := rawArgs["cursor"]; ok { - arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, tmp) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor")) + arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp) if err != nil { return nil, err } @@ -1844,7 +1928,8 @@ func (ec *executionContext) field_Repository_accessControlList_args(ctx context. args := map[string]interface{}{} var arg0 *model1.Cursor if tmp, ok := rawArgs["cursor"]; ok { - arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, tmp) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor")) + arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp) if err != nil { return nil, err } @@ -1858,7 +1943,8 @@ func (ec *executionContext) field_Repository_log_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 *model1.Cursor if tmp, ok := rawArgs["cursor"]; ok { - arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, tmp) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor")) + arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp) if err != nil { return nil, err } @@ -1866,6 +1952,7 @@ func (ec *executionContext) field_Repository_log_args(ctx context.Context, rawAr args["cursor"] = arg0 var arg1 *string if tmp, ok := rawArgs["from"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("from")) arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) if err != nil { return nil, err @@ -1880,6 +1967,7 @@ func (ec *executionContext) field_Repository_objects_args(ctx context.Context, r args := map[string]interface{}{} var arg0 []string if tmp, ok := rawArgs["ids"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("ids")) arg0, err = ec.unmarshalOString2ᚕstringᚄ(ctx, tmp) if err != nil { return nil, err @@ -1894,6 +1982,7 @@ func (ec *executionContext) field_Repository_path_args(ctx context.Context, rawA args := map[string]interface{}{} var arg0 *string if tmp, ok := rawArgs["revspec"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("revspec")) arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) if err != nil { return nil, err @@ -1902,6 +1991,7 @@ func (ec *executionContext) field_Repository_path_args(ctx context.Context, rawA args["revspec"] = arg0 var arg1 string if tmp, ok := rawArgs["path"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) arg1, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -1916,7 +2006,8 @@ func (ec *executionContext) field_Repository_references_args(ctx context.Context args := map[string]interface{}{} var arg0 *model1.Cursor if tmp, ok := rawArgs["cursor"]; ok { - arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, tmp) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor")) + arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp) if err != nil { return nil, err } @@ -1930,6 +2021,7 @@ func (ec *executionContext) field_Repository_revparse_single_args(ctx context.Co args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["revspec"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("revspec")) arg0, err = ec.unmarshalNString2string(ctx, tmp) if err != nil { return nil, err @@ -1944,7 +2036,8 @@ func (ec *executionContext) field_Tree_entries_args(ctx context.Context, rawArgs args := map[string]interface{}{} var arg0 *model1.Cursor if tmp, ok := rawArgs["cursor"]; ok { - arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, tmp) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor")) + arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp) if err != nil { return nil, err } @@ -1958,6 +2051,7 @@ func (ec *executionContext) field_Tree_entry_args(ctx context.Context, rawArgs m args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["path"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) arg0, err = ec.unmarshalOString2string(ctx, tmp) if err != nil { return nil, err @@ -1972,7 +2066,8 @@ func (ec *executionContext) field_User_repositories_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 *model1.Cursor if tmp, ok := rawArgs["cursor"]; ok { - arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, tmp) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cursor")) + arg0, err = ec.unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, tmp) if err != nil { return nil, err } @@ -1980,7 +2075,8 @@ func (ec *executionContext) field_User_repositories_args(ctx context.Context, ra args["cursor"] = arg0 var arg1 *model1.Filter if tmp, ok := rawArgs["filter"]; ok { - arg1, err = ec.unmarshalOFilter2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐFilter(ctx, tmp) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("filter")) + arg1, err = ec.unmarshalOFilter2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐFilter(ctx, tmp) if err != nil { return nil, err } @@ -1994,6 +2090,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2008,6 +2105,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) if err != nil { return nil, err @@ -2033,10 +2131,11 @@ func (ec *executionContext) _ACL_id(ctx context.Context, field graphql.Collected } }() fc := &graphql.FieldContext{ - Object: "ACL", - Field: field, - Args: nil, - IsMethod: false, + Object: "ACL", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2067,10 +2166,11 @@ func (ec *executionContext) _ACL_created(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "ACL", - Field: field, - Args: nil, - IsMethod: false, + Object: "ACL", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2101,10 +2201,11 @@ func (ec *executionContext) _ACL_repository(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "ACL", - Field: field, - Args: nil, - IsMethod: true, + Object: "ACL", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2135,16 +2236,45 @@ func (ec *executionContext) _ACL_entity(ctx context.Context, field graphql.Colle } }() fc := &graphql.FieldContext{ - Object: "ACL", - Field: field, - Args: nil, - IsMethod: true, + Object: "ACL", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.ACL().Entity(rctx, obj) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.ACL().Entity(rctx, obj) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "PROFILE") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, obj, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(model.Entity); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Entity`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -2169,10 +2299,11 @@ func (ec *executionContext) _ACL_mode(ctx context.Context, field graphql.Collect } }() fc := &graphql.FieldContext{ - Object: "ACL", - Field: field, - Args: nil, - IsMethod: false, + Object: "ACL", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2200,10 +2331,11 @@ func (ec *executionContext) _ACLCursor_results(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "ACLCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "ACLCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2234,10 +2366,11 @@ func (ec *executionContext) _ACLCursor_cursor(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "ACLCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "ACLCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2254,7 +2387,7 @@ func (ec *executionContext) _ACLCursor_cursor(ctx context.Context, field graphql } res := resTmp.(*model1.Cursor) fc.Result = res - return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, field.Selections, res) } func (ec *executionContext) _Artifact_id(ctx context.Context, field graphql.CollectedField, obj *model.Artifact) (ret graphql.Marshaler) { @@ -2265,10 +2398,11 @@ func (ec *executionContext) _Artifact_id(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "Artifact", - Field: field, - Args: nil, - IsMethod: false, + Object: "Artifact", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2299,10 +2433,11 @@ func (ec *executionContext) _Artifact_created(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "Artifact", - Field: field, - Args: nil, - IsMethod: false, + Object: "Artifact", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2333,10 +2468,11 @@ func (ec *executionContext) _Artifact_filename(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "Artifact", - Field: field, - Args: nil, - IsMethod: false, + Object: "Artifact", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2367,10 +2503,11 @@ func (ec *executionContext) _Artifact_checksum(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "Artifact", - Field: field, - Args: nil, - IsMethod: false, + Object: "Artifact", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2401,10 +2538,11 @@ func (ec *executionContext) _Artifact_size(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "Artifact", - Field: field, - Args: nil, - IsMethod: false, + Object: "Artifact", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2435,10 +2573,11 @@ func (ec *executionContext) _Artifact_url(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "Artifact", - Field: field, - Args: nil, - IsMethod: true, + Object: "Artifact", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2469,10 +2608,11 @@ func (ec *executionContext) _ArtifactCursor_results(ctx context.Context, field g } }() fc := &graphql.FieldContext{ - Object: "ArtifactCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "ArtifactCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2503,10 +2643,11 @@ func (ec *executionContext) _ArtifactCursor_cursor(ctx context.Context, field gr } }() fc := &graphql.FieldContext{ - Object: "ArtifactCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "ArtifactCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2523,7 +2664,7 @@ func (ec *executionContext) _ArtifactCursor_cursor(ctx context.Context, field gr } res := resTmp.(*model1.Cursor) fc.Result = res - return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, field.Selections, res) } func (ec *executionContext) _BinaryBlob_type(ctx context.Context, field graphql.CollectedField, obj *model.BinaryBlob) (ret graphql.Marshaler) { @@ -2534,10 +2675,11 @@ func (ec *executionContext) _BinaryBlob_type(ctx context.Context, field graphql. } }() fc := &graphql.FieldContext{ - Object: "BinaryBlob", - Field: field, - Args: nil, - IsMethod: false, + Object: "BinaryBlob", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2568,10 +2710,11 @@ func (ec *executionContext) _BinaryBlob_id(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "BinaryBlob", - Field: field, - Args: nil, - IsMethod: false, + Object: "BinaryBlob", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2602,10 +2745,11 @@ func (ec *executionContext) _BinaryBlob_shortId(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "BinaryBlob", - Field: field, - Args: nil, - IsMethod: false, + Object: "BinaryBlob", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2636,10 +2780,11 @@ func (ec *executionContext) _BinaryBlob_raw(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "BinaryBlob", - Field: field, - Args: nil, - IsMethod: false, + Object: "BinaryBlob", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2670,10 +2815,11 @@ func (ec *executionContext) _BinaryBlob_base64(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "BinaryBlob", - Field: field, - Args: nil, - IsMethod: false, + Object: "BinaryBlob", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2704,10 +2850,11 @@ func (ec *executionContext) _Commit_type(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "Commit", - Field: field, - Args: nil, - IsMethod: false, + Object: "Commit", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2738,10 +2885,11 @@ func (ec *executionContext) _Commit_id(ctx context.Context, field graphql.Collec } }() fc := &graphql.FieldContext{ - Object: "Commit", - Field: field, - Args: nil, - IsMethod: false, + Object: "Commit", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2772,10 +2920,11 @@ func (ec *executionContext) _Commit_shortId(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "Commit", - Field: field, - Args: nil, - IsMethod: false, + Object: "Commit", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2806,10 +2955,11 @@ func (ec *executionContext) _Commit_raw(ctx context.Context, field graphql.Colle } }() fc := &graphql.FieldContext{ - Object: "Commit", - Field: field, - Args: nil, - IsMethod: false, + Object: "Commit", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2840,10 +2990,11 @@ func (ec *executionContext) _Commit_author(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "Commit", - Field: field, - Args: nil, - IsMethod: true, + Object: "Commit", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2874,10 +3025,11 @@ func (ec *executionContext) _Commit_committer(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "Commit", - Field: field, - Args: nil, - IsMethod: true, + Object: "Commit", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2908,10 +3060,11 @@ func (ec *executionContext) _Commit_message(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "Commit", - Field: field, - Args: nil, - IsMethod: true, + Object: "Commit", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2942,10 +3095,11 @@ func (ec *executionContext) _Commit_tree(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "Commit", - Field: field, - Args: nil, - IsMethod: true, + Object: "Commit", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -2976,10 +3130,11 @@ func (ec *executionContext) _Commit_parents(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "Commit", - Field: field, - Args: nil, - IsMethod: true, + Object: "Commit", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3010,10 +3165,11 @@ func (ec *executionContext) _Commit_diff(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "Commit", - Field: field, - Args: nil, - IsMethod: true, + Object: "Commit", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3044,10 +3200,11 @@ func (ec *executionContext) _CommitCursor_results(ctx context.Context, field gra } }() fc := &graphql.FieldContext{ - Object: "CommitCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "CommitCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3078,10 +3235,11 @@ func (ec *executionContext) _CommitCursor_cursor(ctx context.Context, field grap } }() fc := &graphql.FieldContext{ - Object: "CommitCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "CommitCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3098,7 +3256,7 @@ func (ec *executionContext) _CommitCursor_cursor(ctx context.Context, field grap } res := resTmp.(*model1.Cursor) fc.Result = res - return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_createRepository(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -3109,10 +3267,11 @@ func (ec *executionContext) _Mutation_createRepository(ctx context.Context, fiel } }() fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3124,8 +3283,36 @@ func (ec *executionContext) _Mutation_createRepository(ctx context.Context, fiel } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateRepository(rctx, args["params"].(*model.RepoInput)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateRepository(rctx, args["params"].(*model.RepoInput)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "REPOSITORIES") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RW") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Repository); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Repository`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3150,10 +3337,11 @@ func (ec *executionContext) _Mutation_updateRepository(ctx context.Context, fiel } }() fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3165,8 +3353,36 @@ func (ec *executionContext) _Mutation_updateRepository(ctx context.Context, fiel } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateRepository(rctx, args["id"].(string), args["params"].(*model.RepoInput)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateRepository(rctx, args["id"].(string), args["params"].(*model.RepoInput)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "REPOSITORIES") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RW") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Repository); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Repository`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3191,10 +3407,11 @@ func (ec *executionContext) _Mutation_deleteRepository(ctx context.Context, fiel } }() fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3206,8 +3423,36 @@ func (ec *executionContext) _Mutation_deleteRepository(ctx context.Context, fiel } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteRepository(rctx, args["id"].(string)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteRepository(rctx, args["id"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "REPOSITORIES") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RW") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Repository); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Repository`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3232,10 +3477,11 @@ func (ec *executionContext) _Mutation_updateACL(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3247,8 +3493,36 @@ func (ec *executionContext) _Mutation_updateACL(ctx context.Context, field graph } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateACL(rctx, args["repoId"].(string), args["mode"].(model.AccessMode), args["entity"].(string)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateACL(rctx, args["repoId"].(string), args["mode"].(model.AccessMode), args["entity"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "ACLS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RW") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ACL); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.ACL`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3273,10 +3547,11 @@ func (ec *executionContext) _Mutation_deleteACL(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3288,8 +3563,36 @@ func (ec *executionContext) _Mutation_deleteACL(ctx context.Context, field graph } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteACL(rctx, args["repoId"].(int), args["entity"].(string)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteACL(rctx, args["repoId"].(int), args["entity"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "ACLS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RW") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ACL); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.ACL`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3314,10 +3617,11 @@ func (ec *executionContext) _Mutation_uploadArtifact(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3329,8 +3633,36 @@ func (ec *executionContext) _Mutation_uploadArtifact(ctx context.Context, field } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UploadArtifact(rctx, args["repoId"].(int), args["revspec"].(string), args["file"].(graphql.Upload)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UploadArtifact(rctx, args["repoId"].(int), args["revspec"].(string), args["file"].(graphql.Upload)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "OBJECTS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RW") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Artifact); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Artifact`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3355,10 +3687,11 @@ func (ec *executionContext) _Mutation_deleteArtifact(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3370,8 +3703,36 @@ func (ec *executionContext) _Mutation_deleteArtifact(ctx context.Context, field } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteArtifact(rctx, args["id"].(int)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteArtifact(rctx, args["id"].(int)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "OBJECTS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RW") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Artifact); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Artifact`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3396,10 +3757,11 @@ func (ec *executionContext) _Query_version(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3430,16 +3792,45 @@ func (ec *executionContext) _Query_me(ctx context.Context, field graphql.Collect } }() fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Me(rctx) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Me(rctx) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "PROFILE") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.User); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.User`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3464,10 +3855,11 @@ func (ec *executionContext) _Query_user(ctx context.Context, field graphql.Colle } }() fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3479,8 +3871,36 @@ func (ec *executionContext) _Query_user(ctx context.Context, field graphql.Colle } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().User(rctx, args["username"].(string)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().User(rctx, args["username"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "PROFILE") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.User); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.User`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3502,10 +3922,11 @@ func (ec *executionContext) _Query_repositories(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3517,8 +3938,36 @@ func (ec *executionContext) _Query_repositories(ctx context.Context, field graph } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Repositories(rctx, args["cursor"].(*model1.Cursor), args["filter"].(*model1.Filter)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Repositories(rctx, args["cursor"].(*model1.Cursor), args["filter"].(*model1.Filter)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "REPOSITORIES") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.RepositoryCursor); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.RepositoryCursor`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3540,10 +3989,11 @@ func (ec *executionContext) _Query_repository(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3555,8 +4005,36 @@ func (ec *executionContext) _Query_repository(ctx context.Context, field graphql } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Repository(rctx, args["id"].(int)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Repository(rctx, args["id"].(int)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "REPOSITORIES") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Repository); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Repository`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3578,10 +4056,11 @@ func (ec *executionContext) _Query_repositoryByName(ctx context.Context, field g } }() fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3593,8 +4072,36 @@ func (ec *executionContext) _Query_repositoryByName(ctx context.Context, field g } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().RepositoryByName(rctx, args["name"].(string)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().RepositoryByName(rctx, args["name"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "REPOSITORIES") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Repository); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Repository`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3616,10 +4123,11 @@ func (ec *executionContext) _Query_repositoryByOwner(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3631,8 +4139,36 @@ func (ec *executionContext) _Query_repositoryByOwner(ctx context.Context, field } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().RepositoryByOwner(rctx, args["owner"].(string), args["repo"].(string)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().RepositoryByOwner(rctx, args["owner"].(string), args["repo"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "REPOSITORIES") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, nil, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Repository); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Repository`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -3654,10 +4190,11 @@ func (ec *executionContext) _Query___type(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3692,10 +4229,11 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3723,10 +4261,11 @@ func (ec *executionContext) _Reference_name(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "Reference", - Field: field, - Args: nil, - IsMethod: true, + Object: "Reference", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3757,10 +4296,11 @@ func (ec *executionContext) _Reference_target(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "Reference", - Field: field, - Args: nil, - IsMethod: true, + Object: "Reference", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3791,10 +4331,11 @@ func (ec *executionContext) _Reference_follow(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "Reference", - Field: field, - Args: nil, - IsMethod: true, + Object: "Reference", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3822,10 +4363,11 @@ func (ec *executionContext) _Reference_artifacts(ctx context.Context, field grap } }() fc := &graphql.FieldContext{ - Object: "Reference", - Field: field, - Args: nil, - IsMethod: true, + Object: "Reference", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3863,10 +4405,11 @@ func (ec *executionContext) _ReferenceCursor_results(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "ReferenceCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "ReferenceCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3897,10 +4440,11 @@ func (ec *executionContext) _ReferenceCursor_cursor(ctx context.Context, field g } }() fc := &graphql.FieldContext{ - Object: "ReferenceCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "ReferenceCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3917,7 +4461,7 @@ func (ec *executionContext) _ReferenceCursor_cursor(ctx context.Context, field g } res := resTmp.(*model1.Cursor) fc.Result = res - return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, field.Selections, res) } func (ec *executionContext) _Repository_id(ctx context.Context, field graphql.CollectedField, obj *model.Repository) (ret graphql.Marshaler) { @@ -3928,10 +4472,11 @@ func (ec *executionContext) _Repository_id(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: false, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3962,10 +4507,11 @@ func (ec *executionContext) _Repository_created(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: false, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -3996,10 +4542,11 @@ func (ec *executionContext) _Repository_updated(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: false, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4030,16 +4577,45 @@ func (ec *executionContext) _Repository_owner(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: true, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Repository().Owner(rctx, obj) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Repository().Owner(rctx, obj) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "PROFILE") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, obj, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(model.Entity); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Entity`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4064,10 +4640,11 @@ func (ec *executionContext) _Repository_name(ctx context.Context, field graphql. } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: false, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4098,10 +4675,11 @@ func (ec *executionContext) _Repository_description(ctx context.Context, field g } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: false, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4129,10 +4707,11 @@ func (ec *executionContext) _Repository_visibility(ctx context.Context, field gr } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: false, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4163,10 +4742,11 @@ func (ec *executionContext) _Repository_upstreamUrl(ctx context.Context, field g } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: false, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4194,10 +4774,11 @@ func (ec *executionContext) _Repository_accessControlList(ctx context.Context, f } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: true, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4209,8 +4790,36 @@ func (ec *executionContext) _Repository_accessControlList(ctx context.Context, f } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Repository().AccessControlList(rctx, obj, args["cursor"].(*model1.Cursor)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Repository().AccessControlList(rctx, obj, args["cursor"].(*model1.Cursor)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "ACLS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, obj, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ACLCursor); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.ACLCursor`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4235,10 +4844,11 @@ func (ec *executionContext) _Repository_objects(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: true, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4250,8 +4860,36 @@ func (ec *executionContext) _Repository_objects(ctx context.Context, field graph } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Repository().Objects(rctx, obj, args["ids"].([]string)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Repository().Objects(rctx, obj, args["ids"].([]string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "OBJECTS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, obj, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.([]model.Object); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be []git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Object`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4276,10 +4914,11 @@ func (ec *executionContext) _Repository_references(ctx context.Context, field gr } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: true, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4291,8 +4930,36 @@ func (ec *executionContext) _Repository_references(ctx context.Context, field gr } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Repository().References(rctx, obj, args["cursor"].(*model1.Cursor)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Repository().References(rctx, obj, args["cursor"].(*model1.Cursor)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "OBJECTS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, obj, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.ReferenceCursor); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.ReferenceCursor`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4317,16 +4984,45 @@ func (ec *executionContext) _Repository_HEAD(ctx context.Context, field graphql. } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: true, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Head(), nil + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Head(), nil + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "OBJECTS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, obj, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Reference); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Reference`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4348,10 +5044,11 @@ func (ec *executionContext) _Repository_log(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: true, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4363,8 +5060,36 @@ func (ec *executionContext) _Repository_log(ctx context.Context, field graphql.C } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Repository().Log(rctx, obj, args["cursor"].(*model1.Cursor), args["from"].(*string)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Repository().Log(rctx, obj, args["cursor"].(*model1.Cursor), args["from"].(*string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "OBJECTS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, obj, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.CommitCursor); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.CommitCursor`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4389,10 +5114,11 @@ func (ec *executionContext) _Repository_path(ctx context.Context, field graphql. } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: true, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4404,8 +5130,36 @@ func (ec *executionContext) _Repository_path(ctx context.Context, field graphql. } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Repository().Path(rctx, obj, args["revspec"].(*string), args["path"].(string)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Repository().Path(rctx, obj, args["revspec"].(*string), args["path"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "OBJECTS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, obj, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.TreeEntry); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.TreeEntry`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4427,10 +5181,11 @@ func (ec *executionContext) _Repository_revparse_single(ctx context.Context, fie } }() fc := &graphql.FieldContext{ - Object: "Repository", - Field: field, - Args: nil, - IsMethod: true, + Object: "Repository", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4442,8 +5197,36 @@ func (ec *executionContext) _Repository_revparse_single(ctx context.Context, fie } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Repository().RevparseSingle(rctx, obj, args["revspec"].(string)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Repository().RevparseSingle(rctx, obj, args["revspec"].(string)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "OBJECTS") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, obj, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.Commit); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.Commit`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -4465,10 +5248,11 @@ func (ec *executionContext) _RepositoryCursor_results(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "RepositoryCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "RepositoryCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4499,10 +5283,11 @@ func (ec *executionContext) _RepositoryCursor_cursor(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "RepositoryCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "RepositoryCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4519,7 +5304,7 @@ func (ec *executionContext) _RepositoryCursor_cursor(ctx context.Context, field } res := resTmp.(*model1.Cursor) fc.Result = res - return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, field.Selections, res) } func (ec *executionContext) _Signature_name(ctx context.Context, field graphql.CollectedField, obj *model.Signature) (ret graphql.Marshaler) { @@ -4530,10 +5315,11 @@ func (ec *executionContext) _Signature_name(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "Signature", - Field: field, - Args: nil, - IsMethod: false, + Object: "Signature", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4564,10 +5350,11 @@ func (ec *executionContext) _Signature_email(ctx context.Context, field graphql. } }() fc := &graphql.FieldContext{ - Object: "Signature", - Field: field, - Args: nil, - IsMethod: false, + Object: "Signature", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4598,10 +5385,11 @@ func (ec *executionContext) _Signature_time(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "Signature", - Field: field, - Args: nil, - IsMethod: false, + Object: "Signature", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4632,10 +5420,11 @@ func (ec *executionContext) _Tag_type(ctx context.Context, field graphql.Collect } }() fc := &graphql.FieldContext{ - Object: "Tag", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tag", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4666,10 +5455,11 @@ func (ec *executionContext) _Tag_id(ctx context.Context, field graphql.Collected } }() fc := &graphql.FieldContext{ - Object: "Tag", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tag", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4700,10 +5490,11 @@ func (ec *executionContext) _Tag_shortId(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "Tag", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tag", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4734,10 +5525,11 @@ func (ec *executionContext) _Tag_raw(ctx context.Context, field graphql.Collecte } }() fc := &graphql.FieldContext{ - Object: "Tag", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tag", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4768,10 +5560,11 @@ func (ec *executionContext) _Tag_target(ctx context.Context, field graphql.Colle } }() fc := &graphql.FieldContext{ - Object: "Tag", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tag", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4802,10 +5595,11 @@ func (ec *executionContext) _Tag_name(ctx context.Context, field graphql.Collect } }() fc := &graphql.FieldContext{ - Object: "Tag", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tag", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4836,10 +5630,11 @@ func (ec *executionContext) _Tag_tagger(ctx context.Context, field graphql.Colle } }() fc := &graphql.FieldContext{ - Object: "Tag", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tag", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4870,10 +5665,11 @@ func (ec *executionContext) _Tag_message(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "Tag", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tag", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4901,10 +5697,11 @@ func (ec *executionContext) _TextBlob_type(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "TextBlob", - Field: field, - Args: nil, - IsMethod: false, + Object: "TextBlob", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4935,10 +5732,11 @@ func (ec *executionContext) _TextBlob_id(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "TextBlob", - Field: field, - Args: nil, - IsMethod: false, + Object: "TextBlob", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -4969,10 +5767,11 @@ func (ec *executionContext) _TextBlob_shortId(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "TextBlob", - Field: field, - Args: nil, - IsMethod: false, + Object: "TextBlob", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5003,10 +5802,11 @@ func (ec *executionContext) _TextBlob_raw(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "TextBlob", - Field: field, - Args: nil, - IsMethod: false, + Object: "TextBlob", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5037,10 +5837,11 @@ func (ec *executionContext) _TextBlob_text(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "TextBlob", - Field: field, - Args: nil, - IsMethod: false, + Object: "TextBlob", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5071,10 +5872,11 @@ func (ec *executionContext) _Tree_type(ctx context.Context, field graphql.Collec } }() fc := &graphql.FieldContext{ - Object: "Tree", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tree", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5105,10 +5907,11 @@ func (ec *executionContext) _Tree_id(ctx context.Context, field graphql.Collecte } }() fc := &graphql.FieldContext{ - Object: "Tree", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tree", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5139,10 +5942,11 @@ func (ec *executionContext) _Tree_shortId(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "Tree", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tree", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5173,10 +5977,11 @@ func (ec *executionContext) _Tree_raw(ctx context.Context, field graphql.Collect } }() fc := &graphql.FieldContext{ - Object: "Tree", - Field: field, - Args: nil, - IsMethod: false, + Object: "Tree", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5207,10 +6012,11 @@ func (ec *executionContext) _Tree_entries(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "Tree", - Field: field, - Args: nil, - IsMethod: true, + Object: "Tree", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5248,10 +6054,11 @@ func (ec *executionContext) _Tree_entry(ctx context.Context, field graphql.Colle } }() fc := &graphql.FieldContext{ - Object: "Tree", - Field: field, - Args: nil, - IsMethod: true, + Object: "Tree", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5286,10 +6093,11 @@ func (ec *executionContext) _TreeEntry_id(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "TreeEntry", - Field: field, - Args: nil, - IsMethod: true, + Object: "TreeEntry", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5320,10 +6128,11 @@ func (ec *executionContext) _TreeEntry_name(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "TreeEntry", - Field: field, - Args: nil, - IsMethod: false, + Object: "TreeEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5354,10 +6163,11 @@ func (ec *executionContext) _TreeEntry_object(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "TreeEntry", - Field: field, - Args: nil, - IsMethod: true, + Object: "TreeEntry", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5388,10 +6198,11 @@ func (ec *executionContext) _TreeEntry_mode(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "TreeEntry", - Field: field, - Args: nil, - IsMethod: false, + Object: "TreeEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5422,10 +6233,11 @@ func (ec *executionContext) _TreeEntryCursor_results(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "TreeEntryCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "TreeEntryCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5456,10 +6268,11 @@ func (ec *executionContext) _TreeEntryCursor_cursor(ctx context.Context, field g } }() fc := &graphql.FieldContext{ - Object: "TreeEntryCursor", - Field: field, - Args: nil, - IsMethod: false, + Object: "TreeEntryCursor", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5476,7 +6289,7 @@ func (ec *executionContext) _TreeEntryCursor_cursor(ctx context.Context, field g } res := resTmp.(*model1.Cursor) fc.Result = res - return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, field.Selections, res) + return ec.marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx, field.Selections, res) } func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { @@ -5487,10 +6300,11 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte } }() fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: false, + Object: "User", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5521,10 +6335,11 @@ func (ec *executionContext) _User_created(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: false, + Object: "User", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5555,10 +6370,11 @@ func (ec *executionContext) _User_updated(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: false, + Object: "User", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5589,10 +6405,11 @@ func (ec *executionContext) _User_canonicalName(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: true, + Object: "User", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5623,10 +6440,11 @@ func (ec *executionContext) _User_username(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: false, + Object: "User", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5657,10 +6475,11 @@ func (ec *executionContext) _User_email(ctx context.Context, field graphql.Colle } }() fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: false, + Object: "User", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5691,10 +6510,11 @@ func (ec *executionContext) _User_url(ctx context.Context, field graphql.Collect } }() fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: false, + Object: "User", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5722,10 +6542,11 @@ func (ec *executionContext) _User_location(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: false, + Object: "User", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5753,10 +6574,11 @@ func (ec *executionContext) _User_bio(ctx context.Context, field graphql.Collect } }() fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: false, + Object: "User", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5784,10 +6606,11 @@ func (ec *executionContext) _User_repositories(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "User", - Field: field, - Args: nil, - IsMethod: true, + Object: "User", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5799,8 +6622,36 @@ func (ec *executionContext) _User_repositories(ctx context.Context, field graphq } fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.User().Repositories(rctx, obj, args["cursor"].(*model1.Cursor), args["filter"].(*model1.Filter)) + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.User().Repositories(rctx, obj, args["cursor"].(*model1.Cursor), args["filter"].(*model1.Filter)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + scope, err := ec.unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx, "REPOSITORIES") + if err != nil { + return nil, err + } + kind, err := ec.unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx, "RO") + if err != nil { + return nil, err + } + if ec.directives.Access == nil { + return nil, errors.New("directive access is not implemented") + } + return ec.directives.Access(ctx, obj, directive0, scope, kind) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*model.RepositoryCursor); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model.RepositoryCursor`, tmp) }) if err != nil { ec.Error(ctx, err) @@ -5825,10 +6676,11 @@ func (ec *executionContext) _Version_major(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "Version", - Field: field, - Args: nil, - IsMethod: false, + Object: "Version", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5859,10 +6711,11 @@ func (ec *executionContext) _Version_minor(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "Version", - Field: field, - Args: nil, - IsMethod: false, + Object: "Version", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5893,10 +6746,11 @@ func (ec *executionContext) _Version_patch(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "Version", - Field: field, - Args: nil, - IsMethod: false, + Object: "Version", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5927,10 +6781,11 @@ func (ec *executionContext) _Version_deprecationDate(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "Version", - Field: field, - Args: nil, - IsMethod: false, + Object: "Version", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5958,10 +6813,11 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -5992,10 +6848,11 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6023,10 +6880,11 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } }() fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6057,10 +6915,11 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6091,10 +6950,11 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: false, + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6125,10 +6985,11 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: false, + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6156,10 +7017,11 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6190,10 +7052,11 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } }() fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6221,10 +7084,11 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6255,10 +7119,11 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } }() fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6286,10 +7151,11 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6320,10 +7186,11 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6354,10 +7221,11 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } }() fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6388,10 +7256,11 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } }() fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6419,10 +7288,11 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6453,10 +7323,11 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6484,10 +7355,11 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6518,10 +7390,11 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } }() fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6549,10 +7422,11 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6583,10 +7457,11 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6617,10 +7492,11 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } }() fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6648,10 +7524,11 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } }() fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6679,10 +7556,11 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } }() fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6713,10 +7591,11 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6747,10 +7626,11 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6778,10 +7658,11 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6809,10 +7690,11 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6847,10 +7729,11 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6878,10 +7761,11 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } }() fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6909,10 +7793,11 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6947,10 +7832,11 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -6978,10 +7864,11 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) @@ -7017,12 +7904,16 @@ func (ec *executionContext) unmarshalInputFilter(ctx context.Context, obj interf switch k { case "count": var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("count")) it.Count, err = ec.unmarshalOInt2ᚖint(ctx, v) if err != nil { return it, err } case "search": var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("search")) it.Search, err = ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err @@ -7041,18 +7932,24 @@ func (ec *executionContext) unmarshalInputRepoInput(ctx context.Context, obj int switch k { case "name": var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) it.Name, err = ec.unmarshalNString2string(ctx, v) if err != nil { return it, err } case "description": var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) it.Description, err = ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } case "visibility": var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("visibility")) it.Visibility, err = ec.unmarshalOVisibility2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐVisibility(ctx, v) if err != nil { return it, err @@ -8610,15 +9507,36 @@ func (ec *executionContext) marshalNACLCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgi return ec._ACLCursor(ctx, sel, v) } +func (ec *executionContext) unmarshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx context.Context, v interface{}) (model.AccessKind, error) { + var res model.AccessKind + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNAccessKind2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessKind(ctx context.Context, sel ast.SelectionSet, v model.AccessKind) graphql.Marshaler { + return v +} + func (ec *executionContext) unmarshalNAccessMode2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessMode(ctx context.Context, v interface{}) (model.AccessMode, error) { var res model.AccessMode - return res, res.UnmarshalGQL(v) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNAccessMode2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessMode(ctx context.Context, sel ast.SelectionSet, v model.AccessMode) graphql.Marshaler { return v } +func (ec *executionContext) unmarshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx context.Context, v interface{}) (model.AccessScope, error) { + var res model.AccessScope + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNAccessScope2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessScope(ctx context.Context, sel ast.SelectionSet, v model.AccessScope) graphql.Marshaler { + return v +} + func (ec *executionContext) marshalNArtifact2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐArtifact(ctx context.Context, sel ast.SelectionSet, v model.Artifact) graphql.Marshaler { return ec._Artifact(ctx, sel, &v) } @@ -8685,7 +9603,8 @@ func (ec *executionContext) marshalNArtifactCursor2ᚖgitᚗsrᚗhtᚋאsircmpwn } func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - return graphql.UnmarshalBoolean(v) + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -8698,10 +9617,6 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se return res } -func (ec *executionContext) marshalNCommit2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐCommit(ctx context.Context, sel ast.SelectionSet, v model.Commit) graphql.Marshaler { - return ec._Commit(ctx, sel, &v) -} - func (ec *executionContext) marshalNCommit2ᚕᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐCommit(ctx context.Context, sel ast.SelectionSet, v []*model.Commit) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup @@ -8811,7 +9726,8 @@ func (ec *executionContext) marshalNEntity2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsr } func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { - return graphql.UnmarshalID(v) + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -8825,7 +9741,8 @@ func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.Selec } func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { - return graphql.UnmarshalInt(v) + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { @@ -8887,7 +9804,8 @@ func (ec *executionContext) marshalNObject2ᚕgitᚗsrᚗhtᚋאsircmpwnᚋgit func (ec *executionContext) unmarshalNObjectType2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐObjectType(ctx context.Context, v interface{}) (model.ObjectType, error) { var res model.ObjectType - return res, res.UnmarshalGQL(v) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNObjectType2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐObjectType(ctx context.Context, sel ast.SelectionSet, v model.ObjectType) graphql.Marshaler { @@ -9010,10 +9928,6 @@ func (ec *executionContext) marshalNRepositoryCursor2ᚖgitᚗsrᚗhtᚋאsircmp return ec._RepositoryCursor(ctx, sel, v) } -func (ec *executionContext) marshalNSignature2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐSignature(ctx context.Context, sel ast.SelectionSet, v model.Signature) graphql.Marshaler { - return ec._Signature(ctx, sel, &v) -} - func (ec *executionContext) marshalNSignature2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐSignature(ctx context.Context, sel ast.SelectionSet, v *model.Signature) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -9025,7 +9939,8 @@ func (ec *executionContext) marshalNSignature2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgi } func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { - return graphql.UnmarshalString(v) + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -9039,7 +9954,8 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S } func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { - return graphql.UnmarshalTime(v) + res, err := graphql.UnmarshalTime(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { @@ -9052,10 +9968,6 @@ func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel as return res } -func (ec *executionContext) marshalNTree2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐTree(ctx context.Context, sel ast.SelectionSet, v model.Tree) graphql.Marshaler { - return ec._Tree(ctx, sel, &v) -} - func (ec *executionContext) marshalNTree2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐTree(ctx context.Context, sel ast.SelectionSet, v *model.Tree) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -9118,7 +10030,8 @@ func (ec *executionContext) marshalNTreeEntryCursor2ᚖgitᚗsrᚗhtᚋאsircmpw } func (ec *executionContext) unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, v interface{}) (graphql.Upload, error) { - return graphql.UnmarshalUpload(v) + res, err := graphql.UnmarshalUpload(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, sel ast.SelectionSet, v graphql.Upload) graphql.Marshaler { @@ -9161,7 +10074,8 @@ func (ec *executionContext) marshalNVersion2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgit func (ec *executionContext) unmarshalNVisibility2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐVisibility(ctx context.Context, v interface{}) (model.Visibility, error) { var res model.Visibility - return res, res.UnmarshalGQL(v) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalNVisibility2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐVisibility(ctx context.Context, sel ast.SelectionSet, v model.Visibility) graphql.Marshaler { @@ -9210,7 +10124,8 @@ func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgq } func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { - return graphql.UnmarshalString(v) + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -9235,6 +10150,7 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte var err error res := make([]string, len(vSlice)) for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) if err != nil { return nil, err @@ -9381,7 +10297,8 @@ func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen } func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { - return graphql.UnmarshalString(v) + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -9394,10 +10311,6 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a return res } -func (ec *executionContext) marshalOACL2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐACL(ctx context.Context, sel ast.SelectionSet, v model.ACL) graphql.Marshaler { - return ec._ACL(ctx, sel, &v) -} - func (ec *executionContext) marshalOACL2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐACL(ctx context.Context, sel ast.SelectionSet, v *model.ACL) graphql.Marshaler { if v == nil { return graphql.Null @@ -9405,21 +10318,13 @@ func (ec *executionContext) marshalOACL2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsr return ec._ACL(ctx, sel, v) } -func (ec *executionContext) unmarshalOAccessMode2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessMode(ctx context.Context, v interface{}) (model.AccessMode, error) { - var res model.AccessMode - return res, res.UnmarshalGQL(v) -} - -func (ec *executionContext) marshalOAccessMode2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessMode(ctx context.Context, sel ast.SelectionSet, v model.AccessMode) graphql.Marshaler { - return v -} - func (ec *executionContext) unmarshalOAccessMode2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessMode(ctx context.Context, v interface{}) (*model.AccessMode, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOAccessMode2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessMode(ctx, v) - return &res, err + var res = new(model.AccessMode) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOAccessMode2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐAccessMode(ctx context.Context, sel ast.SelectionSet, v *model.AccessMode) graphql.Marshaler { @@ -9429,10 +10334,6 @@ func (ec *executionContext) marshalOAccessMode2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋg return v } -func (ec *executionContext) marshalOArtifact2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐArtifact(ctx context.Context, sel ast.SelectionSet, v model.Artifact) graphql.Marshaler { - return ec._Artifact(ctx, sel, &v) -} - func (ec *executionContext) marshalOArtifact2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐArtifact(ctx context.Context, sel ast.SelectionSet, v *model.Artifact) graphql.Marshaler { if v == nil { return graphql.Null @@ -9441,7 +10342,8 @@ func (ec *executionContext) marshalOArtifact2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgit } func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - return graphql.UnmarshalBoolean(v) + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { @@ -9452,19 +10354,15 @@ func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v int if v == nil { return nil, nil } - res, err := ec.unmarshalOBoolean2bool(ctx, v) - return &res, err + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { if v == nil { return graphql.Null } - return ec.marshalOBoolean2bool(ctx, sel, *v) -} - -func (ec *executionContext) marshalOCommit2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐCommit(ctx context.Context, sel ast.SelectionSet, v model.Commit) graphql.Marshaler { - return ec._Commit(ctx, sel, &v) + return graphql.MarshalBoolean(*v) } func (ec *executionContext) marshalOCommit2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐCommit(ctx context.Context, sel ast.SelectionSet, v *model.Commit) graphql.Marshaler { @@ -9474,63 +10372,43 @@ func (ec *executionContext) marshalOCommit2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgit return ec._Commit(ctx, sel, v) } -func (ec *executionContext) unmarshalOCursor2gitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx context.Context, v interface{}) (model1.Cursor, error) { - var res model1.Cursor - return res, res.UnmarshalGQL(v) -} - -func (ec *executionContext) marshalOCursor2gitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx context.Context, sel ast.SelectionSet, v model1.Cursor) graphql.Marshaler { - return v -} - -func (ec *executionContext) unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx context.Context, v interface{}) (*model1.Cursor, error) { +func (ec *executionContext) unmarshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx context.Context, v interface{}) (*model1.Cursor, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOCursor2gitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx, v) - return &res, err + var res = new(model1.Cursor) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐCursor(ctx context.Context, sel ast.SelectionSet, v *model1.Cursor) graphql.Marshaler { +func (ec *executionContext) marshalOCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐCursor(ctx context.Context, sel ast.SelectionSet, v *model1.Cursor) graphql.Marshaler { if v == nil { return graphql.Null } return v } -func (ec *executionContext) unmarshalOFilter2gitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐFilter(ctx context.Context, v interface{}) (model1.Filter, error) { - return ec.unmarshalInputFilter(ctx, v) -} - -func (ec *executionContext) unmarshalOFilter2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐFilter(ctx context.Context, v interface{}) (*model1.Filter, error) { +func (ec *executionContext) unmarshalOFilter2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋcoreᚑgoᚋmodelᚐFilter(ctx context.Context, v interface{}) (*model1.Filter, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOFilter2gitᚗsrᚗhtᚋאsircmpwnᚋgqlᚗsrᚗhtᚋmodelᚐFilter(ctx, v) - return &res, err -} - -func (ec *executionContext) unmarshalOInt2int(ctx context.Context, v interface{}) (int, error) { - return graphql.UnmarshalInt(v) -} - -func (ec *executionContext) marshalOInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { - return graphql.MarshalInt(v) + res, err := ec.unmarshalInputFilter(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOInt2int(ctx, v) - return &res, err + res, err := graphql.UnmarshalInt(v) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { if v == nil { return graphql.Null } - return ec.marshalOInt2int(ctx, sel, *v) + return graphql.MarshalInt(*v) } func (ec *executionContext) marshalOObject2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐObject(ctx context.Context, sel ast.SelectionSet, v model.Object) graphql.Marshaler { @@ -9540,10 +10418,6 @@ func (ec *executionContext) marshalOObject2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsr return ec._Object(ctx, sel, v) } -func (ec *executionContext) marshalOReference2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐReference(ctx context.Context, sel ast.SelectionSet, v model.Reference) graphql.Marshaler { - return ec._Reference(ctx, sel, &v) -} - func (ec *executionContext) marshalOReference2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐReference(ctx context.Context, sel ast.SelectionSet, v *model.Reference) graphql.Marshaler { if v == nil { return graphql.Null @@ -9551,20 +10425,12 @@ func (ec *executionContext) marshalOReference2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgi return ec._Reference(ctx, sel, v) } -func (ec *executionContext) unmarshalORepoInput2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐRepoInput(ctx context.Context, v interface{}) (model.RepoInput, error) { - return ec.unmarshalInputRepoInput(ctx, v) -} - func (ec *executionContext) unmarshalORepoInput2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐRepoInput(ctx context.Context, v interface{}) (*model.RepoInput, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalORepoInput2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐRepoInput(ctx, v) - return &res, err -} - -func (ec *executionContext) marshalORepository2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐRepository(ctx context.Context, sel ast.SelectionSet, v model.Repository) graphql.Marshaler { - return ec._Repository(ctx, sel, &v) + res, err := ec.unmarshalInputRepoInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalORepository2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐRepository(ctx context.Context, sel ast.SelectionSet, v *model.Repository) graphql.Marshaler { @@ -9574,10 +10440,6 @@ func (ec *executionContext) marshalORepository2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋg return ec._Repository(ctx, sel, v) } -func (ec *executionContext) marshalORepositoryCursor2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐRepositoryCursor(ctx context.Context, sel ast.SelectionSet, v model.RepositoryCursor) graphql.Marshaler { - return ec._RepositoryCursor(ctx, sel, &v) -} - func (ec *executionContext) marshalORepositoryCursor2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐRepositoryCursor(ctx context.Context, sel ast.SelectionSet, v *model.RepositoryCursor) graphql.Marshaler { if v == nil { return graphql.Null @@ -9586,7 +10448,8 @@ func (ec *executionContext) marshalORepositoryCursor2ᚖgitᚗsrᚗhtᚋאsircmp } func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { - return graphql.UnmarshalString(v) + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { @@ -9594,6 +10457,9 @@ func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.S } func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + if v == nil { + return nil, nil + } var vSlice []interface{} if v != nil { if tmp1, ok := v.([]interface{}); ok { @@ -9605,6 +10471,7 @@ func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v var err error res := make([]string, len(vSlice)) for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) if err != nil { return nil, err @@ -9629,42 +10496,30 @@ func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v in if v == nil { return nil, nil } - res, err := ec.unmarshalOString2string(ctx, v) - return &res, err + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { if v == nil { return graphql.Null } - return ec.marshalOString2string(ctx, sel, *v) -} - -func (ec *executionContext) unmarshalOTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { - return graphql.UnmarshalTime(v) -} - -func (ec *executionContext) marshalOTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { - return graphql.MarshalTime(v) + return graphql.MarshalString(*v) } func (ec *executionContext) unmarshalOTime2ᚖtimeᚐTime(ctx context.Context, v interface{}) (*time.Time, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOTime2timeᚐTime(ctx, v) - return &res, err + res, err := graphql.UnmarshalTime(v) + return &res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler { if v == nil { return graphql.Null } - return ec.marshalOTime2timeᚐTime(ctx, sel, *v) -} - -func (ec *executionContext) marshalOTreeEntry2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐTreeEntry(ctx context.Context, sel ast.SelectionSet, v model.TreeEntry) graphql.Marshaler { - return ec._TreeEntry(ctx, sel, &v) + return graphql.MarshalTime(*v) } func (ec *executionContext) marshalOTreeEntry2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐTreeEntry(ctx context.Context, sel ast.SelectionSet, v *model.TreeEntry) graphql.Marshaler { @@ -9674,10 +10529,6 @@ func (ec *executionContext) marshalOTreeEntry2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgi return ec._TreeEntry(ctx, sel, v) } -func (ec *executionContext) marshalOUser2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v model.User) graphql.Marshaler { - return ec._User(ctx, sel, &v) -} - func (ec *executionContext) marshalOUser2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler { if v == nil { return graphql.Null @@ -9685,21 +10536,13 @@ func (ec *executionContext) marshalOUser2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗs return ec._User(ctx, sel, v) } -func (ec *executionContext) unmarshalOVisibility2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐVisibility(ctx context.Context, v interface{}) (model.Visibility, error) { - var res model.Visibility - return res, res.UnmarshalGQL(v) -} - -func (ec *executionContext) marshalOVisibility2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐVisibility(ctx context.Context, sel ast.SelectionSet, v model.Visibility) graphql.Marshaler { - return v -} - func (ec *executionContext) unmarshalOVisibility2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐVisibility(ctx context.Context, v interface{}) (*model.Visibility, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOVisibility2gitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐVisibility(ctx, v) - return &res, err + var res = new(model.Visibility) + err := res.UnmarshalGQL(v) + return res, graphql.ErrorOnPath(ctx, err) } func (ec *executionContext) marshalOVisibility2ᚖgitᚗsrᚗhtᚋאsircmpwnᚋgitᚗsrᚗhtᚋapiᚋgraphᚋmodelᚐVisibility(ctx context.Context, sel ast.SelectionSet, v *model.Visibility) graphql.Marshaler { @@ -9829,10 +10672,6 @@ func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋg return ret } -func (ec *executionContext) marshalO__Schema2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v introspection.Schema) graphql.Marshaler { - return ec.___Schema(ctx, sel, &v) -} - func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { if v == nil { return graphql.Null @@ -9840,10 +10679,6 @@ func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlge return ec.___Schema(ctx, sel, v) } -func (ec *executionContext) marshalO__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { - return ec.___Type(ctx, sel, &v) -} - func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/api/graph/complexity.go b/api/graph/complexity.go index 093f1d9..70948e1 100644 --- a/api/graph/complexity.go +++ b/api/graph/complexity.go @@ -1,12 +1,12 @@ package graph import ( - gqlmodel "git.sr.ht/~sircmpwn/gql.sr.ht/model" + "git.sr.ht/~sircmpwn/core-go/model" "git.sr.ht/~sircmpwn/git.sr.ht/api/graph/api" ) -func cursorComplexity(c int, cursor *gqlmodel.Cursor) int { +func cursorComplexity(c int, cursor *model.Cursor) int { if cursor != nil { return c * cursor.Count } @@ -14,29 +14,29 @@ func cursorComplexity(c int, cursor *gqlmodel.Cursor) int { } func ApplyComplexity(conf *api.Config) { - conf.Complexity.Query.Repositories = func(c int, cursor *gqlmodel.Cursor, filter *gqlmodel.Filter) int { + conf.Complexity.Query.Repositories = func(c int, cursor *model.Cursor, filter *model.Filter) int { c = cursorComplexity(c, cursor) if filter != nil && filter.Count != nil { c *= *filter.Count } return c } - conf.Complexity.Repository.AccessControlList = func(c int, cursor *gqlmodel.Cursor) int { + conf.Complexity.Repository.AccessControlList = func(c int, cursor *model.Cursor) int { return cursorComplexity(c, cursor) } - conf.Complexity.Repository.Log = func(c int, cursor *gqlmodel.Cursor, from *string) int { + conf.Complexity.Repository.Log = func(c int, cursor *model.Cursor, from *string) int { return cursorComplexity(c, cursor) } conf.Complexity.Repository.Objects = func(c int, ids []string) int { return c * len(ids) } - conf.Complexity.Repository.References = func(c int, cursor *gqlmodel.Cursor) int { + conf.Complexity.Repository.References = func(c int, cursor *model.Cursor) int { return cursorComplexity(c, cursor) } - conf.Complexity.Tree.Entries = func(c int, cursor *gqlmodel.Cursor) int { + conf.Complexity.Tree.Entries = func(c int, cursor *model.Cursor) int { return cursorComplexity(c, cursor) } - conf.Complexity.User.Repositories = func(c int, cursor *gqlmodel.Cursor, filter *gqlmodel.Filter) int { + conf.Complexity.User.Repositories = func(c int, cursor *model.Cursor, filter *model.Filter) int { c = cursorComplexity(c, cursor) if filter != nil && filter.Count != nil { c *= *filter.Count diff --git a/api/graph/model/acl.go b/api/graph/model/acl.go index 9b6659a..4024397 100644 --- a/api/graph/model/acl.go +++ b/api/graph/model/acl.go @@ -8,8 +8,8 @@ import ( sq "github.com/Masterminds/squirrel" - "git.sr.ht/~sircmpwn/gql.sr.ht/database" - "git.sr.ht/~sircmpwn/gql.sr.ht/model" + "git.sr.ht/~sircmpwn/core-go/database" + "git.sr.ht/~sircmpwn/core-go/model" ) // TODO: Drop updated column from database @@ -22,6 +22,7 @@ type ACL struct { UserID int alias string + fields *database.ModelFields } func (acl *ACL) As(alias string) *ACL { @@ -29,29 +30,36 @@ func (acl *ACL) As(alias string) *ACL { return acl } -func (acl *ACL) Select(ctx context.Context) []string { - cols := database.ColumnsFor(ctx, acl.alias, map[string]string{ - "id": "id", - "created": "created", - "mode": "mode", - }) - return append(cols, - database.WithAlias(acl.alias, "id"), - database.WithAlias(acl.alias, "repo_id"), - database.WithAlias(acl.alias, "user_id")) +func (acl *ACL) Alias() string { + return acl.alias } -func (acl *ACL) Fields(ctx context.Context) []interface{} { - fields := database.FieldsFor(ctx, map[string]interface{}{ - "id": &acl.ID, - "created": &acl.Created, - "mode": &acl.Mode, - }) - return append(fields, &acl.ID, &acl.RepoID, &acl.UserID) +func (acl *ACL) Table() string { + return "access" +} + +func (acl *ACL) Fields() *database.ModelFields { + if acl.fields != nil { + return acl.fields + } + acl.fields = &database.ModelFields{ + Fields: []*database.FieldMap{ + { "id", "id", &acl.ID }, + { "created", "created", &acl.Created }, + { "mode", "mode", &acl.Mode }, + + // Always fetch: + { "id", "", &acl.ID }, + { "repo_id", "", &acl.RepoID }, + { "user_id", "", &acl.UserID }, + }, + } + return acl.fields } func (acl *ACL) QueryWithCursor(ctx context.Context, - db *sql.DB, q sq.SelectBuilder, cur *model.Cursor) ([]*ACL, *model.Cursor) { + runner sq.BaseRunner, q sq.SelectBuilder, + cur *model.Cursor) ([]*ACL, *model.Cursor) { var ( err error rows *sql.Rows @@ -65,7 +73,7 @@ func (acl *ACL) QueryWithCursor(ctx context.Context, OrderBy(database.WithAlias(acl.alias, "id") + " DESC"). Limit(uint64(cur.Count + 1)) - if rows, err = q.RunWith(db).QueryContext(ctx); err != nil { + if rows, err = q.RunWith(runner).QueryContext(ctx); err != nil { panic(err) } defer rows.Close() @@ -73,7 +81,7 @@ func (acl *ACL) QueryWithCursor(ctx context.Context, var acls []*ACL for rows.Next() { var acl ACL - if err := rows.Scan(acl.Fields(ctx)...); err != nil { + if err := rows.Scan(database.Scan(ctx, &acl)...); err != nil { panic(err) } acls = append(acls, &acl) diff --git a/api/graph/model/artifact.go b/api/graph/model/artifact.go index 7c5d88b..33579f9 100644 --- a/api/graph/model/artifact.go +++ b/api/graph/model/artifact.go @@ -8,8 +8,8 @@ import ( sq "github.com/Masterminds/squirrel" - "git.sr.ht/~sircmpwn/gql.sr.ht/database" - "git.sr.ht/~sircmpwn/gql.sr.ht/model" + "git.sr.ht/~sircmpwn/core-go/database" + "git.sr.ht/~sircmpwn/core-go/model" ) type Artifact struct { @@ -21,6 +21,7 @@ type Artifact struct { alias string commit string + fields *database.ModelFields } func (a *Artifact) As(alias string) *Artifact { @@ -28,32 +29,38 @@ func (a *Artifact) As(alias string) *Artifact { return a } -func (a *Artifact) Select(ctx context.Context) []string { - cols := database.ColumnsFor(ctx, a.alias, map[string]string{ - "id": "id", - "created": "created", - "filename": "filename", - "checksum": "checksum", - "size": "size", - }) - return append(cols, - database.WithAlias(a.alias, "commit"), - database.WithAlias(a.alias, "filename")) +func (a *Artifact) Alias() string { + return a.alias } -func (a *Artifact) Fields(ctx context.Context) []interface{} { - fields := database.FieldsFor(ctx, map[string]interface{}{ - "id": &a.ID, - "created": &a.Created, - "filename": &a.Filename, - "checksum": &a.Checksum, - "size": &a.Size, - }) - return append(fields, &a.commit, &a.Filename) +func (a *Artifact) Table() string { + return "artifacts" +} + +func (a *Artifact) Fields() *database.ModelFields { + if a.fields != nil { + return a.fields + } + a.fields = &database.ModelFields{ + Fields: []*database.FieldMap{ + { "id", "id", &a.ID }, + { "created", "created", &a.Created }, + { "filename", "filename", &a.Filename }, + { "checksum", "checksum", &a.Checksum }, + { "size", "size", &a.Size }, + + // Always fetch: + { "id", "", &a.ID }, + { "commit", "", &a.commit }, + { "filename", "", &a.Filename }, + }, + } + return a.fields } func (a *Artifact) QueryWithCursor(ctx context.Context, - db *sql.DB, q sq.SelectBuilder, cur *model.Cursor) ([]*Artifact, *model.Cursor) { + runner sq.BaseRunner, q sq.SelectBuilder, + cur *model.Cursor) ([]*Artifact, *model.Cursor) { var ( err error rows *sql.Rows @@ -67,7 +74,7 @@ func (a *Artifact) QueryWithCursor(ctx context.Context, OrderBy(database.WithAlias(a.alias, "id") + " DESC"). Limit(uint64(cur.Count + 1)) - if rows, err = q.RunWith(db).QueryContext(ctx); err != nil { + if rows, err = q.RunWith(runner).QueryContext(ctx); err != nil { panic(err) } defer rows.Close() @@ -75,7 +82,7 @@ func (a *Artifact) QueryWithCursor(ctx context.Context, var artifacts []*Artifact for rows.Next() { var a Artifact - if err := rows.Scan(a.Fields(ctx)...); err != nil { + if err := rows.Scan(database.Scan(ctx, &a)...); err != nil { panic(err) } artifacts = append(artifacts, &a) diff --git a/api/graph/model/models_gen.go b/api/graph/model/models_gen.go index 51494ee..53d4a3c 100644 --- a/api/graph/model/models_gen.go +++ b/api/graph/model/models_gen.go @@ -8,7 +8,7 @@ import ( "strconv" "time" - "git.sr.ht/~sircmpwn/gql.sr.ht/model" + "git.sr.ht/~sircmpwn/core-go/model" ) type Blob interface { @@ -81,6 +81,47 @@ type Version struct { DeprecationDate *time.Time `json:"deprecationDate"` } +type AccessKind string + +const ( + AccessKindRo AccessKind = "RO" + AccessKindRw AccessKind = "RW" +) + +var AllAccessKind = []AccessKind{ + AccessKindRo, + AccessKindRw, +} + +func (e AccessKind) IsValid() bool { + switch e { + case AccessKindRo, AccessKindRw: + return true + } + return false +} + +func (e AccessKind) String() string { + return string(e) +} + +func (e *AccessKind) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AccessKind(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AccessKind", str) + } + return nil +} + +func (e AccessKind) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + type AccessMode string const ( @@ -122,6 +163,51 @@ func (e AccessMode) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } +type AccessScope string + +const ( + AccessScopeProfile AccessScope = "PROFILE" + AccessScopeRepositories AccessScope = "REPOSITORIES" + AccessScopeObjects AccessScope = "OBJECTS" + AccessScopeACLS AccessScope = "ACLS" +) + +var AllAccessScope = []AccessScope{ + AccessScopeProfile, + AccessScopeRepositories, + AccessScopeObjects, + AccessScopeACLS, +} + +func (e AccessScope) IsValid() bool { + switch e { + case AccessScopeProfile, AccessScopeRepositories, AccessScopeObjects, AccessScopeACLS: + return true + } + return false +} + +func (e AccessScope) String() string { + return string(e) +} + +func (e *AccessScope) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = AccessScope(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid AccessScope", str) + } + return nil +} + +func (e AccessScope) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} + type ObjectType string const ( diff --git a/api/graph/model/repository.go b/api/graph/model/repository.go index 8b64d55..0670abb 100644 --- a/api/graph/model/repository.go +++ b/api/graph/model/repository.go @@ -10,8 +10,8 @@ import ( "github.com/go-git/go-git/v5/plumbing" sq "github.com/Masterminds/squirrel" - "git.sr.ht/~sircmpwn/gql.sr.ht/database" - "git.sr.ht/~sircmpwn/gql.sr.ht/model" + "git.sr.ht/~sircmpwn/core-go/database" + "git.sr.ht/~sircmpwn/core-go/model" ) type Repository struct { @@ -26,8 +26,9 @@ type Repository struct { Path string OwnerID int - alias string - repo *RepoWrapper + alias string + repo *RepoWrapper + fields *database.ModelFields } func (r *Repository) Repo() *RepoWrapper { @@ -60,37 +61,41 @@ func (r *Repository) As(alias string) *Repository { return r } -func (r *Repository) Select(ctx context.Context) []string { - cols := database.ColumnsFor(ctx, r.alias, map[string]string{ - "id": "id", - "created": "created", - "updated": "updated", - "name": "name", - "description": "description", - "visibility": "visibility", - "upstreamUrl": "upstream_uri", - }) - return append(cols, - database.WithAlias(r.alias, "path"), - database.WithAlias(r.alias, "owner_id"), - database.WithAlias(r.alias, "updated")) +func (r *Repository) Alias() string { + return r.alias } -func (r *Repository) Fields(ctx context.Context) []interface{} { - fields := database.FieldsFor(ctx, map[string]interface{}{ - "id": &r.ID, - "created": &r.Created, - "updated": &r.Updated, - "name": &r.Name, - "description": &r.Description, - "visibility": &r.Visibility, - "upstreamUrl": &r.UpstreamURL, - }) - return append(fields, &r.Path, &r.OwnerID, &r.Updated) +func (r *Repository) Table() string { + return "repository" } -func (r *Repository) QueryWithCursor(ctx context.Context, db *sql.DB, - q sq.SelectBuilder, cur *model.Cursor) ([]*Repository, *model.Cursor) { +func (r *Repository) Fields() *database.ModelFields { + if r.fields != nil { + return r.fields + } + r.fields = &database.ModelFields{ + Fields: []*database.FieldMap{ + { "id", "id", &r.ID }, + { "created", "created", &r.Created }, + { "updated", "updated", &r.Updated }, + { "name", "name", &r.Name }, + { "description", "description", &r.Description }, + { "visibility", "visibility", &r.Visibility }, + { "upstream_uri", "upstreamUrl", &r.UpstreamURL }, + + // Always fetch: + { "id", "", &r.ID }, + { "path", "", &r.Path }, + { "owner_id", "", &r.OwnerID }, + { "updated", "", &r.Updated }, + }, + } + return r.fields +} + +func (r *Repository) QueryWithCursor(ctx context.Context, + runner sq.BaseRunner, q sq.SelectBuilder, + cur *model.Cursor) ([]*Repository, *model.Cursor) { var ( err error rows *sql.Rows @@ -105,7 +110,7 @@ func (r *Repository) QueryWithCursor(ctx context.Context, db *sql.DB, OrderBy(database.WithAlias(r.alias, "updated") + " DESC"). Limit(uint64(cur.Count + 1)) - if rows, err = q.RunWith(db).QueryContext(ctx); err != nil { + if rows, err = q.RunWith(runner).QueryContext(ctx); err != nil { panic(err) } defer rows.Close() @@ -113,7 +118,7 @@ func (r *Repository) QueryWithCursor(ctx context.Context, db *sql.DB, var repos []*Repository for rows.Next() { var repo Repository - if err := rows.Scan(repo.Fields(ctx)...); err != nil { + if err := rows.Scan(database.Scan(ctx, &repo)...); err != nil { panic(err) } repos = append(repos, &repo) diff --git a/api/graph/model/user.go b/api/graph/model/user.go index dd7226f..2e4552a 100644 --- a/api/graph/model/user.go +++ b/api/graph/model/user.go @@ -1,10 +1,9 @@ package model import ( - "context" "time" - "git.sr.ht/~sircmpwn/gql.sr.ht/database" + "git.sr.ht/~sircmpwn/core-go/database" ) type User struct { @@ -17,7 +16,8 @@ type User struct { Location *string `json:"location"` Bio *string `json:"bio"` - alias string + alias string + fields *database.ModelFields } func (User) IsEntity() {} @@ -31,32 +31,33 @@ func (u *User) As(alias string) *User { return u } -func (u *User) Select(ctx context.Context) []string { - cols := database.ColumnsFor(ctx, u.alias, map[string]string{ - "id": "id", - "created": "created", - "updated": "updated", - "username": "username", - "email": "email", - "url": "url", - "location": "location", - "bio": "bio", - }) - return append(cols, - database.WithAlias(u.alias, "id"), - database.WithAlias(u.alias, "username")) +func (u *User) Alias() string { + return u.alias } -func (u *User) Fields(ctx context.Context) []interface{} { - fields := database.FieldsFor(ctx, map[string]interface{}{ - "id": &u.ID, - "created": &u.Created, - "updated": &u.Updated, - "username": &u.Username, - "email": &u.Email, - "url": &u.URL, - "location": &u.Location, - "bio": &u.Bio, - }) - return append(fields, &u.ID, &u.Username) +func (u *User) Table() string { + return "user" +} + +func (u *User) Fields() *database.ModelFields { + if u.fields != nil { + return u.fields + } + u.fields = &database.ModelFields{ + Fields: []*database.FieldMap{ + { "id", "id", &u.ID }, + { "created", "created", &u.Created }, + { "updated", "updated", &u.Updated }, + { "username", "username", &u.Username }, + { "email", "email", &u.Email }, + { "url", "url", &u.URL }, + { "location", "location", &u.Location }, + { "bio", "bio", &u.Bio }, + + // Always fetch: + { "id", "", &u.ID }, + { "username", "", &u.Username }, + }, + } + return u.fields } diff --git a/api/graph/schema.graphqls b/api/graph/schema.graphqls index e4b55ba..22c0825 100644 --- a/api/graph/schema.graphqls +++ b/api/graph/schema.graphqls @@ -2,6 +2,27 @@ scalar Cursor scalar Time scalar Upload +# Used to provide a human-friendly description of an access scope +directive @scopehelp(details: String!) on ENUM_VALUE + +enum AccessScope { + PROFILE @scopehelp(details: "profile information") + REPOSITORIES @scopehelp(details: "repository metadata") + OBJECTS @scopehelp(details: "git objects & references") + ACLS @scopehelp(details: "access control lists") +} + +enum AccessKind { + RO @scopehelp(details: "read") + RW @scopehelp(details: "read and write") +} + +# Decorates fields for which access requires a particular OAuth 2.0 scope with +# read or write access. For the meta.sr.ht API, you have access to all public +# information without any special permissions - user profile information, +# public keys, and so on. +directive @access(scope: AccessScope!, kind: AccessKind!) on FIELD_DEFINITION + # https://semver.org type Version { major: Int! @@ -37,7 +58,7 @@ interface Entity { # prefixed with '~'. Additional entity types will be supported in the future. canonicalName: String! - repositories(cursor: Cursor, filter: Filter): RepositoryCursor! + repositories(cursor: Cursor, filter: Filter): RepositoryCursor! @access(scope: REPOSITORIES, kind: RO) } type User implements Entity { @@ -51,14 +72,14 @@ type User implements Entity { location: String bio: String - repositories(cursor: Cursor, filter: Filter): RepositoryCursor! + repositories(cursor: Cursor, filter: Filter): RepositoryCursor! @access(scope: REPOSITORIES, kind: RO) } type Repository { id: Int! created: Time! updated: Time! - owner: Entity! + owner: Entity! @access(scope: PROFILE, kind: RO) name: String! description: String visibility: Visibility! @@ -67,19 +88,19 @@ type Repository { # clone URL. upstreamUrl: String - accessControlList(cursor: Cursor): ACLCursor! + accessControlList(cursor: Cursor): ACLCursor! @access(scope: ACLS, kind: RO) ## Plumbing API: - objects(ids: [String!]): [Object]! - references(cursor: Cursor): ReferenceCursor! + objects(ids: [String!]): [Object]! @access(scope: OBJECTS, kind: RO) + references(cursor: Cursor): ReferenceCursor! @access(scope: OBJECTS, kind: RO) ## Porcelain API: # NOTE: revspecs are git-compatible, e.g. "HEAD~4", "master", "9790b10") # The HEAD reference for this repository (equivalent to the default branch) - HEAD: Reference + HEAD: Reference @access(scope: OBJECTS, kind: RO) # Returns a list of comments sorted by committer time (similar to `git log`'s # default ordering). @@ -87,13 +108,13 @@ type Repository { # If `from` is specified, it is interpreted as a revspec to start logging # from. A clever reader may notice that using commits[-1].from + "^" as the # from parameter is equivalent to passing the cursor to the next call. - log(cursor: Cursor, from: String): CommitCursor! + log(cursor: Cursor, from: String): CommitCursor! @access(scope: OBJECTS, kind: RO) # Returns a tree entry for a given path, at the given revspec. - path(revspec: String = "HEAD", path: String!): TreeEntry + path(revspec: String = "HEAD", path: String!): TreeEntry @access(scope: OBJECTS, kind: RO) # Returns the commit for a given revspec. - revparse_single(revspec: String!): Commit + revparse_single(revspec: String!): Commit @access(scope: OBJECTS, kind: RO) } # A cursor for enumerating a list of repositories @@ -160,7 +181,7 @@ type ACL { id: Int! created: Time! repository: Repository! - entity: Entity! + entity: Entity! @access(scope: PROFILE, kind: RO) mode: AccessMode } @@ -284,10 +305,10 @@ type Query { version: Version! # Returns the authenticated user. - me: User! + me: User! @access(scope: PROFILE, kind: RO) # Returns a specific user. - user(username: String!): User + user(username: String!): User @access(scope: PROFILE, kind: RO) # Returns repositories that the authenticated user has access to. # @@ -296,17 +317,17 @@ type Query { # will be to return all repositories that the user either (1) has been given # explicit access to via ACLs or (2) has implicit access to either by # ownership or group membership. - repositories(cursor: Cursor, filter: Filter): RepositoryCursor + repositories(cursor: Cursor, filter: Filter): RepositoryCursor @access(scope: REPOSITORIES, kind: RO) # Returns a specific repository by ID. - repository(id: Int!): Repository + repository(id: Int!): Repository @access(scope: REPOSITORIES, kind: RO) # Returns a specific repository, owned by the authenticated user. - repositoryByName(name: String!): Repository + repositoryByName(name: String!): Repository @access(scope: REPOSITORIES, kind: RO) # Returns a specific repository, owned by the given canonical name (e.g. # "~sircmpwn"). - repositoryByOwner(owner: String!, repo: String!): Repository + repositoryByOwner(owner: String!, repo: String!): Repository @access(scope: REPOSITORIES, kind: RO) } input RepoInput { @@ -316,13 +337,13 @@ input RepoInput { } type Mutation { - createRepository(params: RepoInput): Repository! - updateRepository(id: ID!, params: RepoInput): Repository! - deleteRepository(id: ID!): Repository! + createRepository(params: RepoInput): Repository! @access(scope: REPOSITORIES, kind: RW) + updateRepository(id: ID!, params: RepoInput): Repository! @access(scope: REPOSITORIES, kind: RW) + deleteRepository(id: ID!): Repository! @access(scope: REPOSITORIES, kind: RW) - updateACL(repoId: ID!, mode: AccessMode!, entity: ID!): ACL! - deleteACL(repoId: Int!, entity: ID!): ACL! + updateACL(repoId: ID!, mode: AccessMode!, entity: ID!): ACL! @access(scope: ACLS, kind: RW) + deleteACL(repoId: Int!, entity: ID!): ACL! @access(scope: ACLS, kind: RW) - uploadArtifact(repoId: Int!, revspec: String!, file: Upload!): Artifact! - deleteArtifact(id: Int!): Artifact! + uploadArtifact(repoId: Int!, revspec: String!, file: Upload!): Artifact! @access(scope: OBJECTS, kind: RW) + deleteArtifact(id: Int!): Artifact! @access(scope: OBJECTS, kind: RW) } diff --git a/api/graph/schema.resolvers.go b/api/graph/schema.resolvers.go index bc89c32..3a460e2 100644 --- a/api/graph/schema.resolvers.go +++ b/api/graph/schema.resolvers.go @@ -5,17 +5,18 @@ package graph import ( "context" + "database/sql" "fmt" "sort" "strings" + "git.sr.ht/~sircmpwn/core-go/auth" + "git.sr.ht/~sircmpwn/core-go/config" + "git.sr.ht/~sircmpwn/core-go/database" + coremodel "git.sr.ht/~sircmpwn/core-go/model" "git.sr.ht/~sircmpwn/git.sr.ht/api/graph/api" "git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model" "git.sr.ht/~sircmpwn/git.sr.ht/api/loaders" - "git.sr.ht/~sircmpwn/gql.sr.ht/auth" - "git.sr.ht/~sircmpwn/gql.sr.ht/config" - "git.sr.ht/~sircmpwn/gql.sr.ht/database" - gqlmodel "git.sr.ht/~sircmpwn/gql.sr.ht/model" "github.com/99designs/gqlgen/graphql" git "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" @@ -28,14 +29,19 @@ func (r *aCLResolver) Repository(ctx context.Context, obj *model.ACL) (*model.Re // frequently utilized endpoint, so I'm not especially interested in the // extra work/cruft. repo := (&model.Repository{}).As(`repo`) - query := database. - Select(ctx, repo). - From(`repository repo`). - Join(`access acl ON acl.repo_id = repo.id`). - Where(`acl.id = ?`, obj.ID) - row := query.RunWith(database.ForContext(ctx)).QueryRow() - if err := row.Scan(repo.Fields(ctx)...); err != nil { - panic(err) + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func(tx *sql.Tx) error { + query := database. + Select(ctx, repo). + From(`repository repo`). + Join(`access acl ON acl.repo_id = repo.id`). + Where(`acl.id = ?`, obj.ID) + row := query.RunWith(tx).QueryRow() + return row.Scan(database.Scan(ctx, repo)...) + }); err != nil { + panic(err) // Invariant } return repo, nil } @@ -45,14 +51,19 @@ func (r *aCLResolver) Entity(ctx context.Context, obj *model.ACL) (model.Entity, // frequently utilized endpoint, so I'm not especially interested in the // extra work/cruft. user := (&model.User{}).As(`u`) - query := database. - Select(ctx, user). - From(`"user" u`). - Join(`access acl ON acl.user_id = u.id`). - Where(`acl.id = ?`, obj.ID) - row := query.RunWith(database.ForContext(ctx)).QueryRow() - if err := row.Scan(user.Fields(ctx)...); err != nil { - panic(err) + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func(tx *sql.Tx) error { + query := database. + Select(ctx, user). + From(`"user" u`). + Join(`access acl ON acl.user_id = u.id`). + Where(`acl.id = ?`, obj.ID) + row := query.RunWith(tx).QueryRow() + return row.Scan(database.Scan(ctx, user)...) + }); err != nil { + panic(err) // Invariant } return user, nil } @@ -118,7 +129,7 @@ func (r *queryResolver) Version(ctx context.Context) (*model.Version, error) { func (r *queryResolver) Me(ctx context.Context) (*model.User, error) { user := auth.ForContext(ctx) return &model.User{ - ID: user.ID, + ID: user.UserID, Created: user.Created, Updated: user.Updated, Username: user.Username, @@ -133,18 +144,27 @@ func (r *queryResolver) User(ctx context.Context, username string) (*model.User, return loaders.ForContext(ctx).UsersByName.Load(username) } -func (r *queryResolver) Repositories(ctx context.Context, cursor *gqlmodel.Cursor, filter *gqlmodel.Filter) (*model.RepositoryCursor, error) { +func (r *queryResolver) Repositories(ctx context.Context, cursor *coremodel.Cursor, filter *coremodel.Filter) (*model.RepositoryCursor, error) { if cursor == nil { - cursor = gqlmodel.NewCursor(filter) + cursor = coremodel.NewCursor(filter) + } + + var repos []*model.Repository + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func(tx *sql.Tx) error { + repo := (&model.Repository{}).As(`repo`) + query := database. + Select(ctx, repo). + From(`repository repo`). + Where(`repo.owner_id = ?`, auth.ForContext(ctx).UserID) + repos, cursor = repo.QueryWithCursor(ctx, tx, query, cursor) + return nil + }); err != nil { + return nil, err } - repo := (&model.Repository{}).As(`repo`) - query := database. - Select(ctx, repo). - From(`repository repo`). - Where(`repo.owner_id = ?`, auth.ForContext(ctx).ID) - - repos, cursor := repo.QueryWithCursor(ctx, database.ForContext(ctx), query, cursor) return &model.RepositoryCursor{repos, cursor}, nil } @@ -166,10 +186,10 @@ func (r *queryResolver) RepositoryByOwner(ctx context.Context, owner string, rep RepositoriesByOwnerRepoName.Load([2]string{owner, repo}) } -func (r *referenceResolver) Artifacts(ctx context.Context, obj *model.Reference, cursor *gqlmodel.Cursor) (*model.ArtifactCursor, error) { +func (r *referenceResolver) Artifacts(ctx context.Context, obj *model.Reference, cursor *coremodel.Cursor) (*model.ArtifactCursor, error) { // XXX: This could utilize a loader if it ever becomes a bottleneck if cursor == nil { - cursor = gqlmodel.NewCursor(nil) + cursor = coremodel.NewCursor(nil) } repo := obj.Repo.Repo() @@ -190,14 +210,23 @@ func (r *referenceResolver) Artifacts(ctx context.Context, obj *model.Reference, panic(fmt.Errorf("Expected artifact to be attached to tag")) } - artifact := (&model.Artifact{}).As(`art`) - query := database. - Select(ctx, artifact). - From(`artifacts art`). - Where(`art.repo_id = ?`, obj.Repo.ID). - Where(`art.commit = ?`, tag.Target.String()) + var arts []*model.Artifact + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func(tx *sql.Tx) error { + artifact := (&model.Artifact{}).As(`art`) + query := database. + Select(ctx, artifact). + From(`artifacts art`). + Where(`art.repo_id = ?`, obj.Repo.ID). + Where(`art.commit = ?`, tag.Target.String()) + arts, cursor = artifact.QueryWithCursor(ctx, tx, query, cursor) + return nil + }); err != nil { + return nil, err + } - arts, cursor := artifact.QueryWithCursor(ctx, database.ForContext(ctx), query, cursor) return &model.ArtifactCursor{arts, cursor}, nil } @@ -205,20 +234,29 @@ func (r *repositoryResolver) Owner(ctx context.Context, obj *model.Repository) ( return loaders.ForContext(ctx).UsersByID.Load(obj.OwnerID) } -func (r *repositoryResolver) AccessControlList(ctx context.Context, obj *model.Repository, cursor *gqlmodel.Cursor) (*model.ACLCursor, error) { +func (r *repositoryResolver) AccessControlList(ctx context.Context, obj *model.Repository, cursor *coremodel.Cursor) (*model.ACLCursor, error) { if cursor == nil { - cursor = gqlmodel.NewCursor(nil) + cursor = coremodel.NewCursor(nil) + } + + var acls []*model.ACL + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func(tx *sql.Tx) error { + acl := (&model.ACL{}).As(`acl`) + query := database. + Select(ctx, acl). + From(`access acl`). + Join(`repository repo ON acl.repo_id = repo.id`). + Where(`acl.repo_id = ?`, obj.ID). + Where(`repo.owner_id = ?`, auth.ForContext(ctx).UserID) + acls, cursor = acl.QueryWithCursor(ctx, tx, query, cursor) + return nil + }); err != nil { + return nil, err } - acl := (&model.ACL{}).As(`acl`) - query := database. - Select(ctx, acl). - From(`access acl`). - Join(`repository repo ON acl.repo_id = repo.id`). - Where(`acl.repo_id = ?`, obj.ID). - Where(`repo.owner_id = ?`, auth.ForContext(ctx).ID) - - acls, cursor := acl.QueryWithCursor(ctx, database.ForContext(ctx), query, cursor) return &model.ACLCursor{acls, cursor}, nil } @@ -235,7 +273,7 @@ func (r *repositoryResolver) Objects(ctx context.Context, obj *model.Repository, return objects, nil } -func (r *repositoryResolver) References(ctx context.Context, obj *model.Repository, cursor *gqlmodel.Cursor) (*model.ReferenceCursor, error) { +func (r *repositoryResolver) References(ctx context.Context, obj *model.Repository, cursor *coremodel.Cursor) (*model.ReferenceCursor, error) { repo := obj.Repo() repo.Lock() defer repo.Unlock() @@ -246,7 +284,7 @@ func (r *repositoryResolver) References(ctx context.Context, obj *model.Reposito defer iter.Close() if cursor == nil { - cursor = gqlmodel.NewCursor(nil) + cursor = coremodel.NewCursor(nil) } var refs []*model.Reference @@ -271,7 +309,7 @@ func (r *repositoryResolver) References(ctx context.Context, obj *model.Reposito } if len(refs) > cursor.Count { - cursor = &gqlmodel.Cursor{ + cursor = &coremodel.Cursor{ Count: cursor.Count, Next: refs[cursor.Count].Name(), Search: cursor.Search, @@ -284,9 +322,9 @@ func (r *repositoryResolver) References(ctx context.Context, obj *model.Reposito return &model.ReferenceCursor{refs, cursor}, nil } -func (r *repositoryResolver) Log(ctx context.Context, obj *model.Repository, cursor *gqlmodel.Cursor, from *string) (*model.CommitCursor, error) { +func (r *repositoryResolver) Log(ctx context.Context, obj *model.Repository, cursor *coremodel.Cursor, from *string) (*model.CommitCursor, error) { if cursor == nil { - cursor = gqlmodel.NewCursor(nil) + cursor = coremodel.NewCursor(nil) if from != nil { cursor.Next = *from } @@ -326,7 +364,7 @@ func (r *repositoryResolver) Log(ctx context.Context, obj *model.Repository, cur }) if len(commits) > cursor.Count { - cursor = &gqlmodel.Cursor{ + cursor = &coremodel.Cursor{ Count: cursor.Count, Next: commits[cursor.Count].ID, Search: "", @@ -393,10 +431,10 @@ func (r *repositoryResolver) RevparseSingle(ctx context.Context, obj *model.Repo return commit, nil } -func (r *treeResolver) Entries(ctx context.Context, obj *model.Tree, cursor *gqlmodel.Cursor) (*model.TreeEntryCursor, error) { +func (r *treeResolver) Entries(ctx context.Context, obj *model.Tree, cursor *coremodel.Cursor) (*model.TreeEntryCursor, error) { if cursor == nil { // TODO: Filter? - cursor = gqlmodel.NewCursor(nil) + cursor = coremodel.NewCursor(nil) } entries := obj.GetEntries() @@ -413,7 +451,7 @@ func (r *treeResolver) Entries(ctx context.Context, obj *model.Tree, cursor *gql } if len(entries) > cursor.Count { - cursor = &gqlmodel.Cursor{ + cursor = &coremodel.Cursor{ Count: cursor.Count, Next: entries[cursor.Count].Name, Search: cursor.Search, @@ -426,18 +464,26 @@ func (r *treeResolver) Entries(ctx context.Context, obj *model.Tree, cursor *gql return &model.TreeEntryCursor{entries, cursor}, nil } -func (r *userResolver) Repositories(ctx context.Context, obj *model.User, cursor *gqlmodel.Cursor, filter *gqlmodel.Filter) (*model.RepositoryCursor, error) { +func (r *userResolver) Repositories(ctx context.Context, obj *model.User, cursor *coremodel.Cursor, filter *coremodel.Filter) (*model.RepositoryCursor, error) { if cursor == nil { - cursor = gqlmodel.NewCursor(filter) + cursor = coremodel.NewCursor(filter) + } + + var repos []*model.Repository + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func(tx *sql.Tx) error { + repo := (&model.Repository{}).As(`repo`) + query := database. + Select(ctx, repo). + From(`repository repo`). + Where(`repo.owner_id = ?`, obj.ID) + repos, cursor = repo.QueryWithCursor(ctx, tx, query, cursor) + return nil + }); err != nil { + return nil, err } - - repo := (&model.Repository{}).As(`repo`) - query := database. - Select(ctx, repo). - From(`repository repo`). - Where(`repo.owner_id = ?`, obj.ID) - - repos, cursor := repo.QueryWithCursor(ctx, database.ForContext(ctx), query, cursor) return &model.RepositoryCursor{repos, cursor}, nil } diff --git a/api/loaders/middleware.go b/api/loaders/middleware.go index 9350921..2186c7d 100644 --- a/api/loaders/middleware.go +++ b/api/loaders/middleware.go @@ -16,8 +16,8 @@ import ( sq "github.com/Masterminds/squirrel" "github.com/lib/pq" - "git.sr.ht/~sircmpwn/gql.sr.ht/auth" - "git.sr.ht/~sircmpwn/gql.sr.ht/database" + "git.sr.ht/~sircmpwn/core-go/auth" + "git.sr.ht/~sircmpwn/core-go/database" "git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model" ) @@ -35,257 +35,286 @@ type Loaders struct { RepositoriesByOwnerRepoName RepositoriesByOwnerRepoNameLoader } -func fetchUsersByID(ctx context.Context, - db *sql.DB) func(ids []int) ([]*model.User, []error) { +func fetchUsersByID(ctx context.Context) func(ids []int) ([]*model.User, []error) { return func(ids []int) ([]*model.User, []error) { - var ( - err error - rows *sql.Rows - ) - query := database. - Select(ctx, (&model.User{}).As(`u`)). - From(`"user" u`). - Where(sq.Expr(`u.id = ANY(?)`, pq.Array(ids))) - if rows, err = query.RunWith(db).QueryContext(ctx); err != nil { - panic(err) - } - defer rows.Close() + users := make([]*model.User, len(ids)) + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func (tx *sql.Tx) error { + var ( + err error + rows *sql.Rows + ) + query := database. + Select(ctx, (&model.User{}).As(`u`)). + From(`"user" u`). + Where(sq.Expr(`u.id = ANY(?)`, pq.Array(ids))) + if rows, err = query.RunWith(tx).QueryContext(ctx); err != nil { + panic(err) + } + defer rows.Close() - usersById := map[int]*model.User{} - for rows.Next() { - var user model.User - if err := rows.Scan(user.Fields(ctx)...); err != nil { + usersById := map[int]*model.User{} + for rows.Next() { + var user model.User + if err := rows.Scan(database.Scan(ctx, &user)...); err != nil { + panic(err) + } + usersById[user.ID] = &user + } + if err = rows.Err(); err != nil { panic(err) } - usersById[user.ID] = &user - } - if err = rows.Err(); err != nil { - panic(err) - } - users := make([]*model.User, len(ids)) - for i, id := range ids { - users[i] = usersById[id] + for i, id := range ids { + users[i] = usersById[id] + } + return nil + }); err != nil { + panic(err) } - return users, nil } } -func fetchUsersByName(ctx context.Context, - db *sql.DB) func(names []string) ([]*model.User, []error) { +func fetchUsersByName(ctx context.Context) func(names []string) ([]*model.User, []error) { return func(names []string) ([]*model.User, []error) { - var ( - err error - rows *sql.Rows - ) - query := database. - Select(ctx, (&model.User{}).As(`u`)). - From(`"user" u`). - Where(sq.Expr(`u.username = ANY(?)`, pq.Array(names))) - if rows, err = query.RunWith(db).QueryContext(ctx); err != nil { - panic(err) - } - defer rows.Close() + users := make([]*model.User, len(names)) + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func (tx *sql.Tx) error { + var ( + err error + rows *sql.Rows + ) + query := database. + Select(ctx, (&model.User{}).As(`u`)). + From(`"user" u`). + Where(sq.Expr(`u.username = ANY(?)`, pq.Array(names))) + if rows, err = query.RunWith(tx).QueryContext(ctx); err != nil { + panic(err) + } + defer rows.Close() - usersByName := map[string]*model.User{} - for rows.Next() { - user := model.User{} - if err := rows.Scan(user.Fields(ctx)...); err != nil { + usersByName := map[string]*model.User{} + for rows.Next() { + user := model.User{} + if err := rows.Scan(database.Scan(ctx, &user)...); err != nil { + panic(err) + } + usersByName[user.Username] = &user + } + if err = rows.Err(); err != nil { panic(err) } - usersByName[user.Username] = &user - } - if err = rows.Err(); err != nil { - panic(err) - } - users := make([]*model.User, len(names)) - for i, name := range names { - users[i] = usersByName[name] + for i, name := range names { + users[i] = usersByName[name] + } + return nil + }); err != nil { + panic(err) } - return users, nil } } -func fetchRepositoriesByID(ctx context.Context, - db *sql.DB) func(ids []int) ([]*model.Repository, []error) { +func fetchRepositoriesByID(ctx context.Context) func(ids []int) ([]*model.Repository, []error) { return func(ids []int) ([]*model.Repository, []error) { - var ( - err error - rows *sql.Rows - ) - authUser := auth.ForContext(ctx) - query := database. - Select(ctx, (&model.Repository{}).As(`repo`)). - Distinct(). - From(`repository repo`). - LeftJoin(`access ON repo.id = access.repo_id`). - Where(sq.And{ - sq.Expr(`repo.id = ANY(?)`, pq.Array(ids)), - sq.Or{ - sq.Expr(`? IN (access.user_id, repo.owner_id)`, authUser.ID), - sq.Expr(`repo.visibility != 'private'`), - }, - }) - if rows, err = query.RunWith(db).QueryContext(ctx); err != nil { - panic(err) - } - defer rows.Close() + repos := make([]*model.Repository, len(ids)) + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func (tx *sql.Tx) error { + var ( + err error + rows *sql.Rows + ) + auser := auth.ForContext(ctx) + query := database. + Select(ctx, (&model.Repository{}).As(`repo`)). + Distinct(). + From(`repository repo`). + LeftJoin(`access ON repo.id = access.repo_id`). + Where(sq.And{ + sq.Expr(`repo.id = ANY(?)`, pq.Array(ids)), + sq.Or{ + sq.Expr(`? IN (access.user_id, repo.owner_id)`, auser.UserID), + sq.Expr(`repo.visibility != 'private'`), + }, + }) + if rows, err = query.RunWith(tx).QueryContext(ctx); err != nil { + panic(err) + } + defer rows.Close() - reposById := map[int]*model.Repository{} - for rows.Next() { - repo := model.Repository{} - if err := rows.Scan(repo.Fields(ctx)...); err != nil { + reposById := map[int]*model.Repository{} + for rows.Next() { + repo := model.Repository{} + if err := rows.Scan(database.Scan(ctx, &repo)...); err != nil { + panic(err) + } + reposById[repo.ID] = &repo + } + if err = rows.Err(); err != nil { panic(err) } - reposById[repo.ID] = &repo - } - if err = rows.Err(); err != nil { - panic(err) - } - repos := make([]*model.Repository, len(ids)) - for i, id := range ids { - repos[i] = reposById[id] + for i, id := range ids { + repos[i] = reposById[id] + } + return nil + }); err != nil { + panic(err) } - return repos, nil } } -func fetchRepositoriesByName(ctx context.Context, - db *sql.DB) func(names []string) ([]*model.Repository, []error) { +func fetchRepositoriesByName(ctx context.Context) func(names []string) ([]*model.Repository, []error) { return func(names []string) ([]*model.Repository, []error) { - var ( - err error - rows *sql.Rows - ) - query := database. - Select(ctx, (&model.Repository{}).As(`repo`)). - Distinct(). - From(`repository repo`). - Where(sq.And{ - sq.Expr(`repo.name = ANY(?)`, pq.Array(names)), - sq.Expr(`repo.owner_id = ?`, auth.ForContext(ctx).ID), - }) - if rows, err = query.RunWith(db).QueryContext(ctx); err != nil { - panic(err) - } - defer rows.Close() + repos := make([]*model.Repository, len(names)) + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func (tx *sql.Tx) error { + var ( + err error + rows *sql.Rows + ) + query := database. + Select(ctx, (&model.Repository{}).As(`repo`)). + Distinct(). + From(`repository repo`). + Where(sq.And{ + sq.Expr(`repo.name = ANY(?)`, pq.Array(names)), + sq.Expr(`repo.owner_id = ?`, auth.ForContext(ctx).UserID), + }) + if rows, err = query.RunWith(tx).QueryContext(ctx); err != nil { + panic(err) + } + defer rows.Close() - reposByName := map[string]*model.Repository{} - for rows.Next() { - repo := model.Repository{} - if err := rows.Scan(repo.Fields(ctx)...); err != nil { + reposByName := map[string]*model.Repository{} + for rows.Next() { + repo := model.Repository{} + if err := rows.Scan(database.Scan(ctx, &repo)...); err != nil { + panic(err) + } + reposByName[repo.Name] = &repo + } + if err = rows.Err(); err != nil { panic(err) } - reposByName[repo.Name] = &repo - } - if err = rows.Err(); err != nil { - panic(err) - } - repos := make([]*model.Repository, len(names)) - for i, name := range names { - repos[i] = reposByName[name] + for i, name := range names { + repos[i] = reposByName[name] + } + return nil + }); err != nil { + panic(err) } - return repos, nil } } -func fetchRepositoriesByOwnerRepoName(ctx context.Context, - db *sql.DB) func(names [][2]string) ([]*model.Repository, []error) { +func fetchRepositoriesByOwnerRepoName(ctx context.Context) func(names [][2]string) ([]*model.Repository, []error) { return func(names [][2]string) ([]*model.Repository, []error) { - var ( - err error - rows *sql.Rows - _names []string = make([]string, len(names)) - ) - for i, name := range names { - // This is a hack, but it works around limitations with PostgreSQL - // and is guaranteed to work because / is invalid in both usernames - // and repo names - _names[i] = name[0] + "/" + name[1] - } - query := database. - Select(ctx). - Prefix(`WITH user_repo AS ( - SELECT - substring(un for position('/' in un)-1) AS owner, - substring(un from position('/' in un)+1) AS repo - FROM unnest(?::text[]) un)`, pq.Array(_names)). - Columns((&model.Repository{}).As(`repo`).Select(ctx)...). - Columns(`u.username`). - Distinct(). - From(`user_repo ur`). - Join(`"user" u on ur.owner = u.username`). - Join(`repository repo ON ur.repo = repo.name - AND u.id = repo.owner_id`). - LeftJoin(`access ON repo.id = access.repo_id`). - Where(sq.Or{ - sq.Expr(`? IN (access.user_id, repo.owner_id)`, - auth.ForContext(ctx).ID), - sq.Expr(`repo.visibility != 'private'`), - }) - if rows, err = query.RunWith(db).QueryContext(ctx); err != nil { - panic(err) - } - defer rows.Close() + repos := make([]*model.Repository, len(names)) + if err := database.WithTx(ctx, &sql.TxOptions{ + Isolation: 0, + ReadOnly: true, + }, func (tx *sql.Tx) error { + var ( + err error + rows *sql.Rows + _names []string = make([]string, len(names)) + ) + for i, name := range names { + // This is a hack, but it works around limitations with PostgreSQL + // and is guaranteed to work because / is invalid in both usernames + // and repo names + _names[i] = name[0] + "/" + name[1] + } + query := database. + Select(ctx). + Prefix(`WITH user_repo AS ( + SELECT + substring(un for position('/' in un)-1) AS owner, + substring(un from position('/' in un)+1) AS repo + FROM unnest(?::text[]) un)`, pq.Array(_names)). + Columns(database.Columns(ctx, (&model.Repository{}).As(`repo`))...). + Columns(`u.username`). + Distinct(). + From(`user_repo ur`). + Join(`"user" u on ur.owner = u.username`). + Join(`repository repo ON ur.repo = repo.name + AND u.id = repo.owner_id`). + LeftJoin(`access ON repo.id = access.repo_id`). + Where(sq.Or{ + sq.Expr(`? IN (access.user_id, repo.owner_id)`, + auth.ForContext(ctx).UserID), + sq.Expr(`repo.visibility != 'private'`), + }) + if rows, err = query.RunWith(tx).QueryContext(ctx); err != nil { + panic(err) + } + defer rows.Close() - reposByOwnerRepoName := map[[2]string]*model.Repository{} - for rows.Next() { - var ownerName string - repo := model.Repository{} - if err := rows.Scan(append( - repo.Fields(ctx), &ownerName)...); err != nil { + reposByOwnerRepoName := map[[2]string]*model.Repository{} + for rows.Next() { + var ownerName string + repo := model.Repository{} + if err := rows.Scan(append( + database.Scan(ctx, &repo), &ownerName)...); err != nil { + panic(err) + } + reposByOwnerRepoName[[2]string{ownerName, repo.Name}] = &repo + } + if err = rows.Err(); err != nil { panic(err) } - reposByOwnerRepoName[[2]string{ownerName, repo.Name}] = &repo - } - if err = rows.Err(); err != nil { - panic(err) - } - repos := make([]*model.Repository, len(names)) - for i, name := range names { - repos[i] = reposByOwnerRepoName[name] + for i, name := range names { + repos[i] = reposByOwnerRepoName[name] + } + return nil + }); err != nil { + panic(err) } - return repos, nil } } func Middleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - db := database.ForContext(r.Context()) ctx := context.WithValue(r.Context(), loadersCtxKey, &Loaders{ UsersByID: UsersByIDLoader{ maxBatch: 100, wait: 1 * time.Millisecond, - fetch: fetchUsersByID(r.Context(), db), + fetch: fetchUsersByID(r.Context()), }, UsersByName: UsersByNameLoader{ maxBatch: 100, wait: 1 * time.Millisecond, - fetch: fetchUsersByName(r.Context(), db), + fetch: fetchUsersByName(r.Context()), }, RepositoriesByID: RepositoriesByIDLoader{ maxBatch: 100, wait: 1 * time.Millisecond, - fetch: fetchRepositoriesByID(r.Context(), db), + fetch: fetchRepositoriesByID(r.Context()), }, RepositoriesByName: RepositoriesByNameLoader{ maxBatch: 100, wait: 1 * time.Millisecond, - fetch: fetchRepositoriesByName(r.Context(), db), + fetch: fetchRepositoriesByName(r.Context()), }, RepositoriesByOwnerRepoName: RepositoriesByOwnerRepoNameLoader{ maxBatch: 100, wait: 1 * time.Millisecond, - fetch: fetchRepositoriesByOwnerRepoName(r.Context(), db), + fetch: fetchRepositoriesByOwnerRepoName(r.Context()), }, }) r = r.WithContext(ctx) diff --git a/api/server.go b/api/server.go index 40152f5..089e8e2 100644 --- a/api/server.go +++ b/api/server.go @@ -1,20 +1,37 @@ package main import ( - "git.sr.ht/~sircmpwn/gql.sr.ht" + "context" + + "git.sr.ht/~sircmpwn/core-go/config" + "git.sr.ht/~sircmpwn/core-go/server" + "github.com/99designs/gqlgen/graphql" "git.sr.ht/~sircmpwn/git.sr.ht/api/graph" "git.sr.ht/~sircmpwn/git.sr.ht/api/graph/api" + "git.sr.ht/~sircmpwn/git.sr.ht/api/graph/model" "git.sr.ht/~sircmpwn/git.sr.ht/api/loaders" ) func main() { - appConfig := gql.LoadConfig(":5101") + appConfig := config.LoadConfig(":5101") gqlConfig := api.Config{Resolvers: &graph.Resolver{}} - graph.ApplyComplexity(&gqlConfig) + gqlConfig.Directives.Access = func(ctx context.Context, obj interface{}, + next graphql.Resolver, scope model.AccessScope, + kind model.AccessKind) (interface{}, error) { + return server.Access(ctx, obj, next, scope.String(), kind.String()) + } schema := api.NewExecutableSchema(gqlConfig) - router := gql.MakeRouter("git.sr.ht", appConfig, schema, loaders.Middleware) - gql.ListenAndServe(router) + scopes := make([]string, len(model.AllAccessScope)) + for i, s := range model.AllAccessScope { + scopes[i] = s.String() + } + + server.NewServer("git.sr.ht", appConfig). + WithDefaultMiddleware(). + WithMiddleware(loaders.Middleware). + WithSchema(schema, scopes). + Run() } -- 2.38.4