diff --git a/go.mod b/go.mod index 438087c58..88c87b57b 100644 --- a/go.mod +++ b/go.mod @@ -29,16 +29,19 @@ require ( github.com/sanity-io/litter v1.2.0 github.com/sgotti/gexpect v0.0.0-20210315095146-1ec64e69809b github.com/spf13/cobra v0.0.5 + github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 // indirect + github.com/swaggo/http-swagger v1.2.0 // indirect + github.com/swaggo/swag v1.7.8 // indirect github.com/xanzy/go-gitlab v0.26.0 go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 go.starlark.net v0.0.0-20200203144150-6677ee5c7211 go.uber.org/zap v1.13.0 golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d - golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 gopkg.in/src-d/go-billy.v4 v4.3.2 gopkg.in/src-d/go-git.v4 v4.13.1 - gopkg.in/yaml.v2 v2.2.8 + gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.17.3 k8s.io/apimachinery v0.17.3 k8s.io/client-go v0.17.3 diff --git a/go.sum b/go.sum index 60758e7c4..f5c283309 100644 --- a/go.sum +++ b/go.sum @@ -27,6 +27,8 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14= +github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/Masterminds/squirrel v1.2.0 h1:K1NhbTO21BWG47IVR0OnIZuE0LZcXAYqywrC3Ko53KI= github.com/Masterminds/squirrel v1.2.0/go.mod h1:yaPeOnPG5ZRwL9oKdTsO/prlkPbXWZlRVMQ/gGlzIuA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -36,9 +38,13 @@ github.com/Microsoft/hcsshim v0.8.7 h1:ptnOoufxGSzauVTsdE+wMYnCWA301PdoN4xg5oRdZ github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/agiledragon/gomonkey/v2 v2.3.1 h1:k+UnUY0EMNYUFUAQVETGY9uUTxjMdnUkP0ARyJS1zzs= +github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -90,7 +96,9 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea h1:n2Ltr3SrfQlf/9nOna1DoGKxLx3qTSI8Ttl6Xrqp6mw= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/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/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -144,14 +152,22 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= @@ -244,6 +260,8 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 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= @@ -264,13 +282,13 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/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 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= @@ -280,6 +298,8 @@ github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -318,6 +338,8 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -336,6 +358,14 @@ github.com/opencontainers/runc v0.1.1 h1:GlxAyO6x8rfZYN9Tt0Kti5a/cP41iuiO2yYT0IJ github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= +github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE= +github.com/otiai10/copy v1.7.0/go.mod h1:rmRl6QPdJj6EiUqXQ/4Nn2lLXoNQjFCQbbNrxgc/t3U= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0 h1:TJIWdbX0B+kpNagQrjgq8bCMrbhiuX73M2XwgtDMoOI= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.3 h1:7JgpsBaN0uMkyju4tbYHu0mnM55hNKVYLsXmwr15NQI= +github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= @@ -365,6 +395,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sanity-io/litter v1.2.0 h1:DGJO0bxH/+C2EukzOSBmAlxmkhVMGqzvcx/rvySYw9M= github.com/sanity-io/litter v1.2.0/go.mod h1:JF6pZUFgu2Q0sBZ+HSV35P8TVPI1TTzEwyu9FXAw2W4= @@ -374,6 +405,7 @@ github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sgotti/gexpect v0.0.0-20210315095146-1ec64e69809b h1:rGT0mqolw5UvjfByF0vWfFEhtL7Hn6P7dNKz7iHBMdA= github.com/sgotti/gexpect v0.0.0-20210315095146-1ec64e69809b/go.mod h1:iw90eoXMZYeYjqjjf85v5Soj3BXaF4hXI0SbESk5kTw= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -381,8 +413,9 @@ github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4 github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -409,14 +442,23 @@ github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRci github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= 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/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2 h1:+iNTcqQJy0OZ5jk6a5NLib47eqXK8uYcPX+O4+cBpEM= +github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= +github.com/swaggo/http-swagger v1.2.0 h1:G5EBD5nvw379l2sFhact660YDT++eLviczLPrgNw/lU= +github.com/swaggo/http-swagger v1.2.0/go.mod h1:P7+V1SLG2zloe+VvAGL7WgFimhJACaBLAv2N7YQ0ikI= +github.com/swaggo/swag v1.7.8 h1:w249t0l/kc/DKMGlS0fppNJQxKyJ8heNaUWB6nsH3zc= +github.com/swaggo/swag v1.7.8/go.mod h1:gZ+TJ2w/Ve1RwQsA2IRoSOTidHz6DX+PIG8GWvbnoLU= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8 h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/vdemeester/k8s-pkg-credentialprovider v0.0.0-20200107171650-7c61ffa44238/go.mod h1:JwQJCMWpUDqjZrB5jpw0f5VbN7U95zxFy1ZDpoEarGo= github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= github.com/xanzy/go-gitlab v0.26.0 h1:eAnJRBUC+GDJSy8OoGCZBqBMpXsGOOT235TFm/F8C0Q= @@ -429,6 +471,7 @@ github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0= @@ -478,6 +521,8 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 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.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= @@ -498,8 +543,10 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/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-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -510,8 +557,9 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ 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 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= @@ -538,13 +586,20 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210314195730-07df6a141424 h1:+39ahH47SWi1PhMRAHfIrm8f69HRZ5K2koXH6dmO8TQ= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210314195730-07df6a141424/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= @@ -569,13 +624,16 @@ golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDq golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200115165105-de0b1760071a h1:bEJ3JL2YUH3tt9KX9dsy0WUF3WOrhjtNjK93o0svepY= golang.org/x/tools v0.0.0-20200115165105-de0b1760071a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ= +golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= 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= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= @@ -600,8 +658,9 @@ google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRn gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +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= @@ -627,9 +686,14 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN 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.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/services/gateway/docs/docs.go b/internal/services/gateway/docs/docs.go new file mode 100644 index 000000000..c8cedfa7d --- /dev/null +++ b/internal/services/gateway/docs/docs.go @@ -0,0 +1,3632 @@ +// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT +// This file was generated by swaggo/swag +package docs + +import ( + "bytes" + "encoding/json" + "strings" + "text/template" + + "github.com/swaggo/swag" +) + +var doc = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "contact": {}, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/auth/authorize": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Authorize", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Authorize", + "parameters": [ + { + "description": "Authorize request", + "name": "authorize", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.LoginUserRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.AuthorizeResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/auth/login": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Login", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Login", + "parameters": [ + { + "description": "Login request", + "name": "login", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.LoginUserRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.LoginUserResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/auth/register": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Register", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Register", + "parameters": [ + { + "description": "Register request", + "name": "register", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.RegisterUserRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.RegisterUserResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/orgs": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return organizations list", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Return organizations list", + "parameters": [ + { + "type": "integer", + "description": "limit response size", + "name": "limit", + "in": "query" + }, + { + "type": "boolean", + "description": "ascending ordering", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "description": "start organization ref", + "name": "start", + "in": "query" + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.OrgResponse" + } + } + }, + "400": { + "description": "bad request" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create an organization", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Create an organization", + "parameters": [ + { + "description": "Organization request", + "name": "organization", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateOrgRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.OrgResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/orgs/{orgref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return an organization", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Return an organization", + "parameters": [ + { + "type": "string", + "description": "Organization ref", + "name": "orgref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.OrgResponse" + } + }, + "404": { + "description": "not found" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete an organization", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Delete an organization", + "parameters": [ + { + "type": "string", + "description": "Organization ref", + "name": "orgref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/orgs/{orgref}/members": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return organization members", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Return organization members", + "parameters": [ + { + "type": "string", + "description": "Organization ref", + "name": "orgref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.OrgMembersResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/orgs/{orgref}/members/{userref}": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Add an organization member", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Add an organization member", + "parameters": [ + { + "type": "string", + "description": "Organization ref", + "name": "orgref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + }, + { + "description": "Organization member request", + "name": "organization_member", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.AddOrgMemberRequest" + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.AddOrgMemberResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Remove an organization member", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Remove an organization member", + "parameters": [ + { + "type": "string", + "description": "Organization ref", + "name": "orgref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projectgroups": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a projectggroup", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Create a projectgroup", + "parameters": [ + { + "description": "Projectgroup request", + "name": "projectgroup", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateProjectGroupRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.ProjectGroupResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projectgroups/{projectgroupref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a projectggroup", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Return a projectgroup", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.ProjectGroupResponse" + } + }, + "404": { + "description": "not found" + } + } + }, + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a projectggroup", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Update a projectgroup", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + }, + { + "description": "Projectgroup request", + "name": "projectgroup", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateProjectGroupRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.ProjectGroupResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a projectggroup", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Delete a projectgroup", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projectgroups/{projectgroupref}/projects": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return projectgroup projects", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Return projectgroup projects", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.ProjectResponse" + } + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/projectgroups/{projectgroupref}/secrets": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a list of projectgroup secrets", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Return a list of projectgroup secrets", + "parameters": [ + { + "type": "boolean", + "description": "secret tree", + "name": "tree", + "in": "query" + }, + { + "type": "boolean", + "description": "filter overridden", + "name": "removeoverridden", + "in": "query" + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.SecretResponse" + } + } + }, + "404": { + "description": "not found" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a projectgroup secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Create a projectgroup secret", + "parameters": [ + { + "description": "Secret request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateSecretRequest" + } + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.SecretResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projectgroups/{projectgroupref}/secrets/{secretname}": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a projectgroup secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Update a projectgroup secret", + "parameters": [ + { + "description": "Secret request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateSecretRequest" + } + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "secretname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.SecretResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a projectgroup secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Delete a projectgroup secret", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "secretname", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projectgroups/{projectgroupref}/subgroups": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a projectgroup subgroups", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Return projectgroup subgroups", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.ProjectGroupResponse" + } + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/projectgroups/{projectgroupref}/variables": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a list of projectgroup variables", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Return a list of projectgroup variables", + "parameters": [ + { + "type": "boolean", + "description": "secret tree", + "name": "tree", + "in": "query" + }, + { + "type": "boolean", + "description": "filter overridden", + "name": "removeoverridden", + "in": "query" + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.VariableResponse" + } + } + }, + "404": { + "description": "not found" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a projectgroup variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Create a projectgroup variable", + "parameters": [ + { + "description": "Variable request", + "name": "variable", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateVariableRequest" + } + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.VariableResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projectgroups/{projectgroupref}/variables/{variablename}": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a projectgroup variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Update a projectgroup variable", + "parameters": [ + { + "description": "Variable request", + "name": "variable", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateVariableRequest" + } + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Variable name", + "name": "variablename", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.VariableResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a projectgroup variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Delete a projectgroup variable", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Variable name", + "name": "variablename", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projects": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a project", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Create a project", + "parameters": [ + { + "description": "Project request", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateProjectRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.ProjectResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projects/{projectref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a project", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Return a project", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.ProjectResponse" + } + }, + "404": { + "description": "not found" + } + } + }, + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a project", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Update a project", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "description": "Project request", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateProjectRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.ProjectResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a project", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Delete a project", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projects/{projectref}/createrun": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a run", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Create a run", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "description": "Project run request", + "name": "run", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.ProjectCreateRunRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/types.ProjectGroupResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projects/{projectref}/reconfig": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Reconfig a project", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Reconfig a project", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projects/{projectref}/secrets": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a list of project secrets", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Return a list of project secrets", + "parameters": [ + { + "type": "boolean", + "description": "secret tree", + "name": "tree", + "in": "query" + }, + { + "type": "boolean", + "description": "filter overridden", + "name": "removeoverridden", + "in": "query" + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.SecretResponse" + } + } + }, + "404": { + "description": "not found" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a project secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Create a project secret", + "parameters": [ + { + "description": "Projectgroup request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateSecretRequest" + } + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.SecretResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projects/{projectref}/secrets/{secretname}": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a projectgroup secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Update a projectgroup secret", + "parameters": [ + { + "description": "Secret request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateSecretRequest" + } + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "secretname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.SecretResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a project secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Delete a project secret", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "secretname", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projects/{projectref}/updaterepolinkedaccount": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a project repository linked account", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Update a project repository linked account", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.ProjectResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/projects/{projectref}/variables": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a list of project variables", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Return a list of project variables", + "parameters": [ + { + "type": "boolean", + "description": "secret tree", + "name": "tree", + "in": "query" + }, + { + "type": "boolean", + "description": "filter overridden", + "name": "removeoverridden", + "in": "query" + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.VariableResponse" + } + } + }, + "404": { + "description": "not found" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a project variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Create a project variable", + "parameters": [ + { + "description": "Variable request", + "name": "variable", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateVariableRequest" + } + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.VariableResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projects/{projectref}/variables/{variablename}": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a project variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Update a project variable", + "parameters": [ + { + "description": "Variable request", + "name": "variable", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateVariableRequest" + } + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Variable name", + "name": "variablename", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.VariableResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a project variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Delete a project variable", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Variable name", + "name": "variablename", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/remotesources": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return remotesources list", + "produces": [ + "application/json" + ], + "tags": [ + "Remotesources" + ], + "summary": "Return remotesources list", + "parameters": [ + { + "type": "integer", + "description": "limit response size", + "name": "limit", + "in": "query" + }, + { + "type": "boolean", + "description": "ascending ordering", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "description": "start remotesource ref", + "name": "start", + "in": "query" + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.RemoteSourceResponse" + } + } + }, + "400": { + "description": "bad request" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a remotesource", + "produces": [ + "application/json" + ], + "tags": [ + "Remotesources" + ], + "summary": "Create a remotesource", + "parameters": [ + { + "description": "Remotesource request", + "name": "remotesource", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateRemoteSourceRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.RemoteSourceResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/remotesources/{remotesourceref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a remotesource", + "produces": [ + "application/json" + ], + "tags": [ + "Remotesources" + ], + "summary": "Return a remotesource", + "parameters": [ + { + "type": "string", + "description": "Remotesource ref", + "name": "remotesourceref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.RemoteSourceResponse" + } + }, + "404": { + "description": "not found" + } + } + }, + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a remotesource", + "produces": [ + "application/json" + ], + "tags": [ + "Remotesources" + ], + "summary": "Update a remotesource", + "parameters": [ + { + "type": "string", + "description": "Remotesource ref", + "name": "remotesourceref", + "in": "path", + "required": true + }, + { + "description": "Remotesource request", + "name": "remotesource", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateRemoteSourceRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.RemoteSourceResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a remotesource", + "produces": [ + "application/json" + ], + "tags": [ + "Remotesources" + ], + "summary": "Delete a remotesource", + "parameters": [ + { + "type": "string", + "description": "Remotesource ref", + "name": "remotesourceref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/runs": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return runs list", + "produces": [ + "application/json" + ], + "tags": [ + "Runs" + ], + "summary": "Return runs list", + "parameters": [ + { + "type": "integer", + "description": "limit response size", + "name": "limit", + "in": "query" + }, + { + "type": "boolean", + "description": "ascending ordering", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "description": "start run id", + "name": "start", + "in": "query" + }, + { + "type": "string", + "description": "group", + "name": "group", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "phase", + "name": "phase", + "in": "query" + }, + { + "type": "string", + "description": "result", + "name": "result", + "in": "query" + }, + { + "type": "string", + "description": "changegroup", + "name": "changegroup", + "in": "query" + }, + { + "type": "boolean", + "description": "last run", + "name": "lastrun", + "in": "query" + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.RunsResponse" + } + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/runs/{runid}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a run", + "produces": [ + "application/json" + ], + "tags": [ + "Runs" + ], + "summary": "Return a run", + "parameters": [ + { + "type": "string", + "description": "Run id", + "name": "runid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.RunResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/runs/{runid}/actions": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Execute a run action", + "produces": [ + "application/json" + ], + "tags": [ + "Runs" + ], + "summary": "Execute a run action", + "parameters": [ + { + "type": "string", + "description": "Run id", + "name": "runid", + "in": "path", + "required": true + }, + { + "description": "Run action request", + "name": "action", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.RunActionsRequest" + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.RunResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/runs/{runid}/tasks/{taskid}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a task", + "produces": [ + "application/json" + ], + "tags": [ + "Runs" + ], + "summary": "Return a task", + "parameters": [ + { + "type": "string", + "description": "Run id", + "name": "runid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task id", + "name": "taskid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.RunTaskResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/runs/{runid}/tasks/{taskid}/actions": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Execute a task action", + "produces": [ + "application/json" + ], + "tags": [ + "Runs" + ], + "summary": "Execute a task action", + "parameters": [ + { + "type": "string", + "description": "Run id", + "name": "runid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task id", + "name": "taskid", + "in": "path", + "required": true + }, + { + "description": "Task action request", + "name": "action", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.RunTaskActionsRequest" + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.RunResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/user": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return the current user", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Return the current user", + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.UserResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/user/createrun": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a directrun", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create a directrun", + "parameters": [ + { + "description": "Directrun request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UserCreateRunRequest" + } + } + ], + "responses": { + "201": { + "description": "created" + }, + "400": { + "description": "bad request" + } + } + } + }, + "/user/remoterepos/{remotesourceref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return user remote repo list", + "produces": [ + "application/json" + ], + "tags": [ + "RemoteRepos" + ], + "summary": "Return user remote repo list", + "parameters": [ + { + "type": "string", + "description": "Remotesource ref", + "name": "remotesourceref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.RemoteRepoResponse" + } + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/users": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return users list", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Return users list", + "parameters": [ + { + "type": "integer", + "description": "limit response size", + "name": "limit", + "in": "query" + }, + { + "type": "boolean", + "description": "ascending ordering", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "description": "start user name", + "name": "start", + "in": "query" + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.UserResponse" + } + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a user", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create a user", + "parameters": [ + { + "description": "User request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateUserRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.SecretResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/users/{userref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a user", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Return a user", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.UserResponse" + } + }, + "404": { + "description": "not found" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a user", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Delete a user", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/users/{userref}/linkedaccounts": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a user linked account", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create a user linked account", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + }, + { + "description": "Linked account request", + "name": "linkedAccount", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateUserLARequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.CreateUserLAResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/users/{userref}/linkedaccounts/{laid}": { + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete user linked account", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Delete user linked account", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Linked account id", + "name": "laid", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/users/{userref}/tokens": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a user token", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create a user token", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + }, + { + "description": "User token request", + "name": "userToken", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateUserTokenRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.CreateUserTokenResponse" + } + }, + "400": { + "description": "bad response" + } + } + } + }, + "/users/{userref}/tokens/{tokenname}": { + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a user token", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Delete a user token", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Token name", + "name": "tokenname", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + } + }, + "definitions": { + "types.AddOrgMemberRequest": { + "type": "object", + "properties": { + "role": { + "type": "string" + } + } + }, + "types.AddOrgMemberResponse": { + "type": "object", + "properties": { + "organization": { + "$ref": "#/definitions/types.OrgResponse" + }, + "role": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/types.UserResponse" + } + } + }, + "types.AuthorizeResponse": { + "type": "object", + "properties": { + "oauth2_redirect": { + "type": "string" + }, + "remote_source_name": { + "type": "string" + }, + "remote_user_info": { + "$ref": "#/definitions/types.UserInfo" + } + } + }, + "types.CreateOrgRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.CreateProjectGroupRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parent_ref": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.CreateProjectRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parent_ref": { + "type": "string" + }, + "pass_vars_to_forked_pr": { + "type": "boolean" + }, + "remote_source_name": { + "type": "string" + }, + "repo_path": { + "type": "string" + }, + "skip_ssh_host_key_check": { + "type": "boolean" + }, + "visibility": { + "type": "string" + } + } + }, + "types.CreateRemoteSourceRequest": { + "type": "object", + "properties": { + "apiurl": { + "type": "string" + }, + "auth_type": { + "type": "string" + }, + "login_enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "oauth_2_client_id": { + "type": "string" + }, + "oauth_2_client_secret": { + "type": "string" + }, + "registration_enabled": { + "type": "boolean" + }, + "skip_ssh_host_key_check": { + "type": "boolean" + }, + "skip_verify": { + "type": "boolean" + }, + "ssh_host_key": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "types.CreateSecretRequest": { + "type": "object", + "properties": { + "data": { + "description": "internal secret", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "secret_provider_id": { + "description": "external secret", + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "types.CreateUserLARequest": { + "type": "object", + "properties": { + "remote_source_login_name": { + "type": "string" + }, + "remote_source_login_password": { + "type": "string" + }, + "remote_source_name": { + "type": "string" + } + } + }, + "types.CreateUserLAResponse": { + "type": "object", + "properties": { + "linked_account": { + "$ref": "#/definitions/types.LinkedAccount" + }, + "oauth2_redirect": { + "type": "string" + } + } + }, + "types.CreateUserRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + } + } + }, + "types.CreateUserTokenRequest": { + "type": "object", + "properties": { + "token_name": { + "type": "string" + } + } + }, + "types.CreateUserTokenResponse": { + "type": "object", + "properties": { + "token": { + "type": "string" + } + } + }, + "types.CreateVariableRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/types.VariableValueRequest" + } + } + } + }, + "types.LinkedAccount": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remote_source_id": { + "type": "string" + }, + "remote_user_avatar_url": { + "type": "string" + }, + "remote_user_id": { + "type": "string" + }, + "remote_username": { + "type": "string" + } + } + }, + "types.LinkedAccountResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remote_source_id": { + "type": "string" + }, + "remote_user_avatar_url": { + "type": "string" + }, + "remote_user_name": { + "type": "string" + } + } + }, + "types.LoginUserRequest": { + "type": "object", + "properties": { + "login_name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "remote_source_name": { + "type": "string" + } + } + }, + "types.LoginUserResponse": { + "type": "object", + "properties": { + "oauth2_redirect": { + "type": "string" + }, + "token": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/types.UserResponse" + } + } + }, + "types.OrgMemberResponse": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/types.UserResponse" + } + } + }, + "types.OrgMembersResponse": { + "type": "object", + "properties": { + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/types.OrgMemberResponse" + } + }, + "organization": { + "$ref": "#/definitions/types.OrgResponse" + } + } + }, + "types.OrgResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.ProjectCreateRunRequest": { + "type": "object", + "properties": { + "branch": { + "type": "string" + }, + "commit_sha": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "types.ProjectGroupResponse": { + "type": "object", + "properties": { + "global_visibility": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parent_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.ProjectResponse": { + "type": "object", + "properties": { + "global_visibility": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parent_path": { + "type": "string" + }, + "pass_vars_to_forked_pr": { + "type": "boolean" + }, + "path": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.RegisterUserRequest": { + "type": "object", + "properties": { + "remote_source_login_name": { + "type": "string" + }, + "remote_source_login_password": { + "type": "string" + }, + "remote_source_name": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "types.RegisterUserResponse": { + "type": "object", + "properties": { + "oauth2_redirect": { + "type": "string" + } + } + }, + "types.RemoteRepoResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "types.RemoteSourceResponse": { + "type": "object", + "properties": { + "auth_type": { + "type": "string" + }, + "id": { + "type": "string" + }, + "login_enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "registration_enabled": { + "type": "boolean" + } + } + }, + "types.RunActionsRequest": { + "type": "object", + "properties": { + "action_type": { + "type": "string" + }, + "from_start": { + "description": "Restart", + "type": "boolean" + } + } + }, + "types.RunConfigTaskDepend": { + "type": "object", + "properties": { + "conditions": { + "type": "array", + "items": { + "type": "string" + } + }, + "task_id": { + "type": "string" + } + } + }, + "types.RunResponse": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "can_restart_from_failed_tasks": { + "type": "boolean" + }, + "can_restart_from_scratch": { + "type": "boolean" + }, + "counter": { + "type": "integer" + }, + "end_time": { + "type": "string" + }, + "enqueue_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "result": { + "type": "string" + }, + "setup_errors": { + "type": "array", + "items": { + "type": "string" + } + }, + "start_time": { + "type": "string" + }, + "stopping": { + "type": "boolean" + }, + "tasks": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/types.RunResponseTask" + } + }, + "tasks_waiting_approval": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "types.RunResponseTask": { + "type": "object", + "properties": { + "approval_annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "approved": { + "type": "boolean" + }, + "depends": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/types.RunConfigTaskDepend" + } + }, + "end_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "level": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "status": { + "type": "string" + }, + "waiting_approval": { + "type": "boolean" + } + } + }, + "types.RunTaskActionsRequest": { + "type": "object", + "properties": { + "action_type": { + "type": "string" + } + } + }, + "types.RunTaskResponse": { + "type": "object", + "properties": { + "approval_annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "approved": { + "type": "boolean" + }, + "end_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "setup_step": { + "$ref": "#/definitions/types.RunTaskResponseSetupStep" + }, + "start_time": { + "type": "string" + }, + "status": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/definitions/types.RunTaskResponseStep" + } + }, + "waiting_approval": { + "type": "boolean" + } + } + }, + "types.RunTaskResponseSetupStep": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "start_time": { + "type": "string" + } + } + }, + "types.RunTaskResponseStep": { + "type": "object", + "properties": { + "command": { + "type": "string" + }, + "end_time": { + "type": "string" + }, + "exit_status": { + "type": "integer" + }, + "log_archived": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "shell": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "types.RunsResponse": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "counter": { + "type": "integer" + }, + "end_time": { + "type": "string" + }, + "enqueue_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "result": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "tasks_waiting_approval": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "types.SecretResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parent_path": { + "type": "string" + } + } + }, + "types.UpdateProjectGroupRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parent_ref": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.UpdateProjectRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parent_ref": { + "type": "string" + }, + "pass_vars_to_forked_pr": { + "type": "boolean" + }, + "visibility": { + "type": "string" + } + } + }, + "types.UpdateRemoteSourceRequest": { + "type": "object", + "properties": { + "apiurl": { + "type": "string" + }, + "login_enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "oauth_2_client_id": { + "type": "string" + }, + "oauth_2_client_secret": { + "type": "string" + }, + "registration_enabled": { + "type": "boolean" + }, + "skip_ssh_host_key_check": { + "type": "boolean" + }, + "skip_verify": { + "type": "boolean" + }, + "ssh_host_key": { + "type": "string" + } + } + }, + "types.UpdateSecretRequest": { + "type": "object", + "properties": { + "data": { + "description": "internal secret", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "secret_provider_id": { + "description": "external secret", + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "types.UpdateVariableRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/types.VariableValueRequest" + } + } + } + }, + "types.UserCreateRunRequest": { + "type": "object", + "properties": { + "branch": { + "type": "string" + }, + "commit_sha": { + "type": "string" + }, + "message": { + "type": "string" + }, + "pull_request_ref_regexes": { + "type": "array", + "items": { + "type": "string" + } + }, + "ref": { + "type": "string" + }, + "repo_path": { + "type": "string" + }, + "repo_uuid": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "variables": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "types.UserInfo": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "id": { + "type": "string" + }, + "loginName": { + "type": "string" + } + } + }, + "types.UserResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "linked_accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/types.LinkedAccountResponse" + } + }, + "tokens": { + "type": "array", + "items": { + "type": "string" + } + }, + "username": { + "type": "string" + } + } + }, + "types.VariableResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parent_path": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/types.VariableValue" + } + } + } + }, + "types.VariableValue": { + "type": "object", + "properties": { + "matching_secret_parent_path": { + "type": "string" + }, + "secret_name": { + "type": "string" + }, + "secret_var": { + "type": "string" + }, + "when": { + "$ref": "#/definitions/types.When" + } + } + }, + "types.VariableValueRequest": { + "type": "object", + "properties": { + "secret_name": { + "type": "string" + }, + "secret_var": { + "type": "string" + }, + "when": { + "$ref": "#/definitions/types.When" + } + } + }, + "types.When": { + "type": "object", + "properties": { + "branch": { + "$ref": "#/definitions/types.WhenConditions" + }, + "ref": { + "$ref": "#/definitions/types.WhenConditions" + }, + "tag": { + "$ref": "#/definitions/types.WhenConditions" + } + } + }, + "types.WhenCondition": { + "type": "object", + "properties": { + "match": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "types.WhenConditions": { + "type": "object", + "properties": { + "exclude": { + "type": "array", + "items": { + "$ref": "#/definitions/types.WhenCondition" + } + }, + "include": { + "type": "array", + "items": { + "$ref": "#/definitions/types.WhenCondition" + } + } + } + } + }, + "securityDefinitions": { + "ApiKeyToken": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + } +}` + +type swaggerInfo struct { + Version string + Host string + BasePath string + Schemes []string + Title string + Description string +} + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = swaggerInfo{ + Version: "v0.6.0", + Host: "", + BasePath: "/api/v1alpha", + Schemes: []string{}, + Title: "agola", + Description: "", +} + +type s struct{} + +func (s *s) ReadDoc() string { + sInfo := SwaggerInfo + sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) + + t, err := template.New("swagger_info").Funcs(template.FuncMap{ + "marshal": func(v interface{}) string { + a, _ := json.Marshal(v) + return string(a) + }, + "escape": func(v interface{}) string { + // escape tabs + str := strings.Replace(v.(string), "\t", "\\t", -1) + // replace " with \", and if that results in \\", replace that with \\\" + str = strings.Replace(str, "\"", "\\\"", -1) + return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1) + }, + }).Parse(doc) + if err != nil { + return doc + } + + var tpl bytes.Buffer + if err := t.Execute(&tpl, sInfo); err != nil { + return doc + } + + return tpl.String() +} + +func init() { + swag.Register("swagger", &s{}) +} diff --git a/internal/services/gateway/docs/organization.go b/internal/services/gateway/docs/organization.go new file mode 100644 index 000000000..89334434d --- /dev/null +++ b/internal/services/gateway/docs/organization.go @@ -0,0 +1,94 @@ +package docs + +import ( + _ "agola.io/agola/services/gateway/api/types" +) + +// @Summary Return an organization +// @Description Return an organization +// @Tags Organizations +// @Produce json +// @Param orgref path string true "Organization ref" +// @Success 200 {object} types.OrgResponse "ok" +// @Failure 404 "not found" +// @Router /orgs/{orgref} [get] +// @Security ApiKeyToken +//nolint +func getOrganization() {} + +// @Summary Return organizations list +// @Description Return organizations list +// @Tags Organizations +// @Produce json +// @Param limit query int false "limit response size" +// @Param asc query bool false "ascending ordering" +// @Param start query string false "start organization ref" +// @Success 200 {array} types.OrgResponse "ok" +// @Failure 400 "bad request" +// @Router /orgs [get] +// @Security ApiKeyToken +//nolint +func getOrganizationList() {} + +// @Summary Create an organization +// @Description Create an organization +// @Tags Organizations +// @Produce json +// @Param organization body types.CreateOrgRequest true "Organization request" +// @Success 201 {object} types.OrgResponse "created" +// @Failure 400 "bad request" +// @Router /orgs [post] +// @Security ApiKeyToken +//nolint +func createOrganization() {} + +// @Summary Delete an organization +// @Description Delete an organization +// @Tags Organizations +// @Produce json +// @Param orgref path string true "Organization ref" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /orgs/{orgref} [delete] +// @Security ApiKeyToken +//nolint +func deleteOrganization() {} + +// @Summary Return organization members +// @Description Return organization members +// @Tags Organizations +// @Produce json +// @Param orgref path string true "Organization ref" +// @Success 200 {object} types.OrgMembersResponse "ok" +// @Failure 404 "not found" +// @Router /orgs/{orgref}/members [get] +// @Security ApiKeyToken +//nolint +func getOrganizationMembers() {} + +// @Summary Add an organization member +// @Description Add an organization member +// @Tags Organizations +// @Produce json +// @Param orgref path string true "Organization ref" +// @Param userref path string true "User ref" +// @Param organization_member body types.AddOrgMemberRequest true "Organization member request" +// @Success 200 {object} types.AddOrgMemberResponse "ok" +// @Failure 400 "bad request" +// @Router /orgs/{orgref}/members/{userref} [put] +// @Security ApiKeyToken +//nolint +func addOrganizationMember() {} + +// @Summary Remove an organization member +// @Description Remove an organization member +// @Tags Organizations +// @Produce json +// @Param orgref path string true "Organization ref" +// @Param userref path string true "User ref" +// @Success 204 "no content" +// @Failure 400 "bad request" +// @Router /orgs/{orgref}/members/{userref} [delete] +// @Security ApiKeyToken +//nolint +func remoteOrganizationMember() {} diff --git a/internal/services/gateway/docs/project.go b/internal/services/gateway/docs/project.go new file mode 100644 index 000000000..21b32620c --- /dev/null +++ b/internal/services/gateway/docs/project.go @@ -0,0 +1,91 @@ +package docs + +import ( + _ "agola.io/agola/services/gateway/api/types" +) + +// @Summary Create a project +// @Description Create a project +// @Tags Projects +// @Produce json +// @Param project body types.CreateProjectRequest true "Project request" +// @Success 201 {object} types.ProjectResponse "created" +// @Failure 400 "bad request" +// @Router /projects [post] +// @Security ApiKeyToken +//nolint +func createProject() {} + +// @Summary Update a project +// @Description Update a project +// @Tags Projects +// @Produce json +// @Param projectref path string true "Project ref" +// @Param project body types.UpdateProjectRequest true "Project request" +// @Success 201 {object} types.ProjectResponse "created" +// @Failure 400 "bad request" +// @Router /projects/{projectref} [put] +// @Security ApiKeyToken +//nolint +func updateProject() {} + +// @Summary Reconfig a project +// @Description Reconfig a project +// @Tags Projects +// @Produce json +// @Param projectref path string true "Project ref" +// @Success 200 "ok" +// @Failure 404 "not found" +// @Router /projects/{projectref}/reconfig [put] +// @Security ApiKeyToken +//nolint +func reconfigProject() {} + +// @Summary Update a project repository linked account +// @Description Update a project repository linked account +// @Tags Projects +// @Produce json +// @Param projectref path string true "Project ref" +// @Success 200 {object} types.ProjectResponse "ok" +// @Failure 404 "not found" +// @Router /projects/{projectref}/updaterepolinkedaccount [put] +// @Security ApiKeyToken +//nolint +func updateProjectRepoLinkedAccount() {} + +// @Summary Delete a project +// @Description Delete a project +// @Tags Projects +// @Produce json +// @Param projectref path string true "Project ref" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /projects/{projectref} [delete] +// @Security ApiKeyToken +//nolint +func deleteProject() {} + +// @Summary Return a project +// @Description Return a project +// @Tags Projects +// @Produce json +// @Param projectref path string true "Project ref" +// @Success 200 {object} types.ProjectResponse "ok" +// @Failure 404 "not found" +// @Router /projects/{projectref} [get] +// @Security ApiKeyToken +//nolint +func getProject() {} + +// @Summary Create a run +// @Description Create a run +// @Tags Projects +// @Produce json +// @Param projectref path string true "Project ref" +// @Param run body types.ProjectCreateRunRequest true "Project run request" +// @Success 201 {object} types.ProjectGroupResponse "Created" +// @Failure 400 "bad request" +// @Router /projects/{projectref}/createrun [post] +// @Security ApiKeyToken +//nolint +func createRun() {} diff --git a/internal/services/gateway/docs/projectgroup.go b/internal/services/gateway/docs/projectgroup.go new file mode 100644 index 000000000..a3a9ae021 --- /dev/null +++ b/internal/services/gateway/docs/projectgroup.go @@ -0,0 +1,78 @@ +package docs + +import ( + _ "agola.io/agola/services/gateway/api/types" +) + +// @Summary Create a projectgroup +// @Description Create a projectggroup +// @Tags Projectgroups +// @Produce json +// @Param projectgroup body types.CreateProjectGroupRequest true "Projectgroup request" +// @Success 201 {object} types.ProjectGroupResponse "created" +// @Failure 400 "bad request" +// @Router /projectgroups [post] +// @Security ApiKeyToken +//nolint +func createProjectgroup() {} + +// @Summary Update a projectgroup +// @Description Update a projectggroup +// @Tags Projectgroups +// @Produce json +// @Param projectgroupref path string true "Projectgroup ref" +// @Param projectgroup body types.UpdateProjectGroupRequest true "Projectgroup request" +// @Success 201 {object} types.ProjectGroupResponse "created" +// @Failure 400 "bad request" +// @Router /projectgroups/{projectgroupref} [put] +// @Security ApiKeyToken +//nolint +func updateProjectgroup() {} + +// @Summary Delete a projectgroup +// @Description Delete a projectggroup +// @Tags Projectgroups +// @Produce json +// @Param projectgroupref path string true "Projectgroup ref" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /projectgroups/{projectgroupref} [delete] +// @Security ApiKeyToken +//nolint +func deleteProjectgroup() {} + +// @Summary Return a projectgroup +// @Description Return a projectggroup +// @Tags Projectgroups +// @Produce json +// @Param projectgroupref path string true "Projectgroup ref" +// @Success 200 {object} types.ProjectGroupResponse "ok" +// @Failure 404 "not found" +// @Router /projectgroups/{projectgroupref} [get] +// @Security ApiKeyToken +//nolint +func getProjectgroup() {} + +// @Summary Return projectgroup projects +// @Description Return projectgroup projects +// @Tags Projectgroups +// @Produce json +// @Param projectgroupref path string true "Projectgroup ref" +// @Success 200 {array} types.ProjectResponse "ok" +// @Failure 404 "not found" +// @Router /projectgroups/{projectgroupref}/projects [get] +// @Security ApiKeyToken +//nolint +func getProjectgroupProjects() {} + +// @Summary Return projectgroup subgroups +// @Description Return a projectgroup subgroups +// @Tags Projectgroups +// @Produce json +// @Param projectgroupref path string true "Projectgroup ref" +// @Success 200 {array} types.ProjectGroupResponse "ok" +// @Failure 404 "not found" +// @Router /projectgroups/{projectgroupref}/subgroups [get] +// @Security ApiKeyToken +//nolint +func getProjectgroupSubgroups() {} diff --git a/internal/services/gateway/docs/remoterepo.go b/internal/services/gateway/docs/remoterepo.go new file mode 100644 index 000000000..4acd6be53 --- /dev/null +++ b/internal/services/gateway/docs/remoterepo.go @@ -0,0 +1,17 @@ +package docs + +import ( + _ "agola.io/agola/services/gateway/api/types" +) + +// @Summary Return user remote repo list +// @Description Return user remote repo list +// @Tags RemoteRepos +// @Produce json +// @Param remotesourceref path string true "Remotesource ref" +// @Success 200 {array} types.RemoteRepoResponse "ok" +// @Failure 400 "bad request" +// @Router /user/remoterepos/{remotesourceref} [get] +// @Security ApiKeyToken +//nolint +func getUserRemoteRepos() {} diff --git a/internal/services/gateway/docs/remotesource.go b/internal/services/gateway/docs/remotesource.go new file mode 100644 index 000000000..a15c78ce3 --- /dev/null +++ b/internal/services/gateway/docs/remotesource.go @@ -0,0 +1,68 @@ +package docs + +import ( + _ "agola.io/agola/services/gateway/api/types" +) + +// @Summary Return a remotesource +// @Description Return a remotesource +// @Tags Remotesources +// @Produce json +// @Param remotesourceref path string true "Remotesource ref" +// @Success 200 {object} types.RemoteSourceResponse "ok" +// @Failure 404 "not found" +// @Router /remotesources/{remotesourceref} [get] +// @Security ApiKeyToken +//nolint +func getRemotesource() {} + +// @Summary Create a remotesource +// @Description Create a remotesource +// @Tags Remotesources +// @Produce json +// @Param remotesource body types.CreateRemoteSourceRequest true "Remotesource request" +// @Success 201 {object} types.RemoteSourceResponse "created" +// @Failure 400 "bad request" +// @Router /remotesources [post] +// @Security ApiKeyToken +//nolint +func createRemotesource() {} + +// @Summary Update a remotesource +// @Description Update a remotesource +// @Tags Remotesources +// @Produce json +// @Param remotesourceref path string true "Remotesource ref" +// @Param remotesource body types.UpdateRemoteSourceRequest true "Remotesource request" +// @Success 201 {object} types.RemoteSourceResponse "created" +// @Failure 400 "bad request" +// @Router /remotesources/{remotesourceref} [put] +// @Security ApiKeyToken +//nolint +func updateRemotesource() {} + +// @Summary Return remotesources list +// @Description Return remotesources list +// @Tags Remotesources +// @Produce json +// @Param limit query int false "limit response size" +// @Param asc query bool false "ascending ordering" +// @Param start query string false "start remotesource ref" +// @Success 200 {array} types.RemoteSourceResponse "ok" +// @Failure 400 "bad request" +// @Router /remotesources [get] +// @Security ApiKeyToken +//nolint +func getRemotesourceList() {} + +// @Summary Delete a remotesource +// @Description Delete a remotesource +// @Tags Remotesources +// @Produce json +// @Param remotesourceref path string true "Remotesource ref" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /remotesources/{remotesourceref} [delete] +// @Security ApiKeyToken +//nolint +func deleteRemotesource() {} diff --git a/internal/services/gateway/docs/run.go b/internal/services/gateway/docs/run.go new file mode 100644 index 000000000..17a9f5aa1 --- /dev/null +++ b/internal/services/gateway/docs/run.go @@ -0,0 +1,76 @@ +package docs + +import ( + _ "agola.io/agola/services/gateway/api/types" +) + +// @Summary Return a run +// @Description Return a run +// @Tags Runs +// @Produce json +// @Param runid path string true "Run id" +// @Success 200 {object} types.RunResponse "ok" +// @Failure 404 "not found" +// @Router /runs/{runid} [get] +// @Security ApiKeyToken +//nolint +func getRun() {} + +// @Summary Execute a run action +// @Description Execute a run action +// @Tags Runs +// @Produce json +// @Param runid path string true "Run id" +// @Param action body types.RunActionsRequest true "Run action request" +// @Success 200 {object} types.RunResponse "ok" +// @Failure 404 "not found" +// @Router /runs/{runid}/actions [put] +// @Security ApiKeyToken +//nolint +func executeRunAction() {} + +// @Summary Return a task +// @Description Return a task +// @Tags Runs +// @Produce json +// @Param runid path string true "Run id" +// @Param taskid path string true "Task id" +// @Success 200 {object} types.RunTaskResponse "ok" +// @Failure 404 "not found" +// @Router /runs/{runid}/tasks/{taskid} [get] +// @Security ApiKeyToken +//nolint +func getTask() {} + +// @Summary Execute a task action +// @Description Execute a task action +// @Tags Runs +// @Produce json +// @Param runid path string true "Run id" +// @Param taskid path string true "Task id" +// @Param action body types.RunTaskActionsRequest true "Task action request" +// @Success 200 {object} types.RunResponse "ok" +// @Failure 404 "not found" +// @Router /runs/{runid}/tasks/{taskid}/actions [put] +// @Security ApiKeyToken +//nolint +func executeTaskAction() {} + +// @Summary Return runs list +// @Description Return runs list +// @Tags Runs +// @Produce json +// @Param limit query int false "limit response size" +// @Param asc query bool false "ascending ordering" +// @Param start query string false "start run id" +// @Param group query string true "group" +// @Param phase query string false "phase" +// @Param result query string false "result" +// @Param changegroup query string false "changegroup" +// @Param lastrun query bool false "last run" +// @Success 200 {array} types.RunsResponse "ok" +// @Failure 400 "bad request" +// @Router /runs [get] +// @Security ApiKeyToken +//nolint +func getRunList() {} diff --git a/internal/services/gateway/docs/secret.go b/internal/services/gateway/docs/secret.go new file mode 100644 index 000000000..2faec4ef7 --- /dev/null +++ b/internal/services/gateway/docs/secret.go @@ -0,0 +1,113 @@ +package docs + +import ( + _ "agola.io/agola/services/gateway/api/types" +) + +// @Summary Return a list of project secrets +// @Description Return a list of project secrets +// @Tags Secrets +// @Produce json +// @Param tree query bool false "secret tree" +// @Param removeoverridden query bool false "filter overridden" +// @Param projectref path string true "Project ref" +// @Success 200 {array} types.SecretResponse "ok" +// @Failure 404 "not found" +// @Router /projects/{projectref}/secrets [get] +// @Security ApiKeyToken +//nolint +func getProjectSecretList() {} + +// @Summary Return a list of projectgroup secrets +// @Description Return a list of projectgroup secrets +// @Tags Secrets +// @Produce json +// @Param tree query bool false "secret tree" +// @Param removeoverridden query bool false "filter overridden" +// @Param projectgroupref path string true "Projectgroup ref" +// @Success 200 {array} types.SecretResponse "ok" +// @Failure 404 "not found" +// @Router /projectgroups/{projectgroupref}/secrets [get] +// @Security ApiKeyToken +//nolint +func getProjectgroupSecretList() {} + +// @Summary Create a projectgroup secret +// @Description Create a projectgroup secret +// @Tags Secrets +// @Produce json +// @Param secret body types.CreateSecretRequest true "Secret request" +// @Param projectgroupref path string true "Projectgroup ref" +// @Success 201 {object} types.SecretResponse "created" +// @Failure 400 "bad request" +// @Router /projectgroups/{projectgroupref}/secrets [post] +// @Security ApiKeyToken +//nolint +func createProjectgroupSecret() {} + +// @Summary Create a project secret +// @Description Create a project secret +// @Tags Secrets +// @Produce json +// @Param secret body types.CreateSecretRequest true "Projectgroup request" +// @Param projectref path string true "Project ref" +// @Success 201 {object} types.SecretResponse "created" +// @Failure 400 "bad request" +// @Router /projects/{projectref}/secrets [post] +// @Security ApiKeyToken +//nolint +func createProjectSecret() {} + +// @Summary Update a projectgroup secret +// @Description Update a projectgroup secret +// @Tags Secrets +// @Produce json +// @Param secret body types.UpdateSecretRequest true "Secret request" +// @Param projectgroupref path string true "Projectgroup ref" +// @Param secretname path string true "Secret name" +// @Success 200 {object} types.SecretResponse "ok" +// @Failure 400 "bad request" +// @Router /projectgroups/{projectgroupref}/secrets/{secretname} [put] +// @Security ApiKeyToken +//nolint +func updateProjectgroupSecret() {} + +// @Summary Update a projectgroup secret +// @Description Update a projectgroup secret +// @Tags Secrets +// @Produce json +// @Param secret body types.UpdateSecretRequest true "Secret request" +// @Param projectref path string true "Project ref" +// @Param secretname path string true "Secret name" +// @Success 200 {object} types.SecretResponse "ok" +// @Failure 400 "bad request" +// @Router /projects/{projectref}/secrets/{secretname} [put] +// @Security ApiKeyToken +//nolint +func updateProjectSecret() {} + +// @Summary Delete a projectgroup secret +// @Description Delete a projectgroup secret +// @Tags Secrets +// @Produce json +// @Param projectgroupref path string true "Projectgroup ref" +// @Param secretname path string true "Secret name" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /projectgroups/{projectgroupref}/secrets/{secretname} [delete] +// @Security ApiKeyToken +//nolint +func deleteProjectgroupSecret() {} + +// @Summary Delete a project secret +// @Description Delete a project secret +// @Tags Secrets +// @Produce json +// @Param projectref path string true "Project ref" +// @Param secretname path string true "Secret name" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /projects/{projectref}/secrets/{secretname} [delete] +// @Security ApiKeyToken +//nolint +func deleteProjectSecret() {} diff --git a/internal/services/gateway/docs/swagger.json b/internal/services/gateway/docs/swagger.json new file mode 100644 index 000000000..df3eb2e45 --- /dev/null +++ b/internal/services/gateway/docs/swagger.json @@ -0,0 +1,3562 @@ +{ + "swagger": "2.0", + "info": { + "title": "agola", + "contact": {}, + "version": "v0.6.0" + }, + "basePath": "/api/v1alpha", + "paths": { + "/auth/authorize": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Authorize", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Authorize", + "parameters": [ + { + "description": "Authorize request", + "name": "authorize", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.LoginUserRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.AuthorizeResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/auth/login": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Login", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Login", + "parameters": [ + { + "description": "Login request", + "name": "login", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.LoginUserRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.LoginUserResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/auth/register": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Register", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Register", + "parameters": [ + { + "description": "Register request", + "name": "register", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.RegisterUserRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.RegisterUserResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/orgs": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return organizations list", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Return organizations list", + "parameters": [ + { + "type": "integer", + "description": "limit response size", + "name": "limit", + "in": "query" + }, + { + "type": "boolean", + "description": "ascending ordering", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "description": "start organization ref", + "name": "start", + "in": "query" + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.OrgResponse" + } + } + }, + "400": { + "description": "bad request" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create an organization", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Create an organization", + "parameters": [ + { + "description": "Organization request", + "name": "organization", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateOrgRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.OrgResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/orgs/{orgref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return an organization", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Return an organization", + "parameters": [ + { + "type": "string", + "description": "Organization ref", + "name": "orgref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.OrgResponse" + } + }, + "404": { + "description": "not found" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete an organization", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Delete an organization", + "parameters": [ + { + "type": "string", + "description": "Organization ref", + "name": "orgref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/orgs/{orgref}/members": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return organization members", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Return organization members", + "parameters": [ + { + "type": "string", + "description": "Organization ref", + "name": "orgref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.OrgMembersResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/orgs/{orgref}/members/{userref}": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Add an organization member", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Add an organization member", + "parameters": [ + { + "type": "string", + "description": "Organization ref", + "name": "orgref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + }, + { + "description": "Organization member request", + "name": "organization_member", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.AddOrgMemberRequest" + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.AddOrgMemberResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Remove an organization member", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "Remove an organization member", + "parameters": [ + { + "type": "string", + "description": "Organization ref", + "name": "orgref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projectgroups": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a projectggroup", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Create a projectgroup", + "parameters": [ + { + "description": "Projectgroup request", + "name": "projectgroup", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateProjectGroupRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.ProjectGroupResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projectgroups/{projectgroupref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a projectggroup", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Return a projectgroup", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.ProjectGroupResponse" + } + }, + "404": { + "description": "not found" + } + } + }, + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a projectggroup", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Update a projectgroup", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + }, + { + "description": "Projectgroup request", + "name": "projectgroup", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateProjectGroupRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.ProjectGroupResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a projectggroup", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Delete a projectgroup", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projectgroups/{projectgroupref}/projects": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return projectgroup projects", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Return projectgroup projects", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.ProjectResponse" + } + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/projectgroups/{projectgroupref}/secrets": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a list of projectgroup secrets", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Return a list of projectgroup secrets", + "parameters": [ + { + "type": "boolean", + "description": "secret tree", + "name": "tree", + "in": "query" + }, + { + "type": "boolean", + "description": "filter overridden", + "name": "removeoverridden", + "in": "query" + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.SecretResponse" + } + } + }, + "404": { + "description": "not found" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a projectgroup secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Create a projectgroup secret", + "parameters": [ + { + "description": "Secret request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateSecretRequest" + } + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.SecretResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projectgroups/{projectgroupref}/secrets/{secretname}": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a projectgroup secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Update a projectgroup secret", + "parameters": [ + { + "description": "Secret request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateSecretRequest" + } + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "secretname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.SecretResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a projectgroup secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Delete a projectgroup secret", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "secretname", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projectgroups/{projectgroupref}/subgroups": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a projectgroup subgroups", + "produces": [ + "application/json" + ], + "tags": [ + "Projectgroups" + ], + "summary": "Return projectgroup subgroups", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.ProjectGroupResponse" + } + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/projectgroups/{projectgroupref}/variables": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a list of projectgroup variables", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Return a list of projectgroup variables", + "parameters": [ + { + "type": "boolean", + "description": "secret tree", + "name": "tree", + "in": "query" + }, + { + "type": "boolean", + "description": "filter overridden", + "name": "removeoverridden", + "in": "query" + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.VariableResponse" + } + } + }, + "404": { + "description": "not found" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a projectgroup variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Create a projectgroup variable", + "parameters": [ + { + "description": "Variable request", + "name": "variable", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateVariableRequest" + } + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.VariableResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projectgroups/{projectgroupref}/variables/{variablename}": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a projectgroup variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Update a projectgroup variable", + "parameters": [ + { + "description": "Variable request", + "name": "variable", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateVariableRequest" + } + }, + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Variable name", + "name": "variablename", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.VariableResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a projectgroup variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Delete a projectgroup variable", + "parameters": [ + { + "type": "string", + "description": "Projectgroup ref", + "name": "projectgroupref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Variable name", + "name": "variablename", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projects": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a project", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Create a project", + "parameters": [ + { + "description": "Project request", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateProjectRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.ProjectResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projects/{projectref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a project", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Return a project", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.ProjectResponse" + } + }, + "404": { + "description": "not found" + } + } + }, + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a project", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Update a project", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "description": "Project request", + "name": "project", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateProjectRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.ProjectResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a project", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Delete a project", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projects/{projectref}/createrun": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a run", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Create a run", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "description": "Project run request", + "name": "run", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.ProjectCreateRunRequest" + } + } + ], + "responses": { + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/types.ProjectGroupResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projects/{projectref}/reconfig": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Reconfig a project", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Reconfig a project", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projects/{projectref}/secrets": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a list of project secrets", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Return a list of project secrets", + "parameters": [ + { + "type": "boolean", + "description": "secret tree", + "name": "tree", + "in": "query" + }, + { + "type": "boolean", + "description": "filter overridden", + "name": "removeoverridden", + "in": "query" + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.SecretResponse" + } + } + }, + "404": { + "description": "not found" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a project secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Create a project secret", + "parameters": [ + { + "description": "Projectgroup request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateSecretRequest" + } + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.SecretResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projects/{projectref}/secrets/{secretname}": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a projectgroup secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Update a projectgroup secret", + "parameters": [ + { + "description": "Secret request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateSecretRequest" + } + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "secretname", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.SecretResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a project secret", + "produces": [ + "application/json" + ], + "tags": [ + "Secrets" + ], + "summary": "Delete a project secret", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Secret name", + "name": "secretname", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/projects/{projectref}/updaterepolinkedaccount": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a project repository linked account", + "produces": [ + "application/json" + ], + "tags": [ + "Projects" + ], + "summary": "Update a project repository linked account", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.ProjectResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/projects/{projectref}/variables": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a list of project variables", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Return a list of project variables", + "parameters": [ + { + "type": "boolean", + "description": "secret tree", + "name": "tree", + "in": "query" + }, + { + "type": "boolean", + "description": "filter overridden", + "name": "removeoverridden", + "in": "query" + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.VariableResponse" + } + } + }, + "404": { + "description": "not found" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a project variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Create a project variable", + "parameters": [ + { + "description": "Variable request", + "name": "variable", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateVariableRequest" + } + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.VariableResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/projects/{projectref}/variables/{variablename}": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a project variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Update a project variable", + "parameters": [ + { + "description": "Variable request", + "name": "variable", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateVariableRequest" + } + }, + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Variable name", + "name": "variablename", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.VariableResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a project variable", + "produces": [ + "application/json" + ], + "tags": [ + "Variables" + ], + "summary": "Delete a project variable", + "parameters": [ + { + "type": "string", + "description": "Project ref", + "name": "projectref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Variable name", + "name": "variablename", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/remotesources": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return remotesources list", + "produces": [ + "application/json" + ], + "tags": [ + "Remotesources" + ], + "summary": "Return remotesources list", + "parameters": [ + { + "type": "integer", + "description": "limit response size", + "name": "limit", + "in": "query" + }, + { + "type": "boolean", + "description": "ascending ordering", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "description": "start remotesource ref", + "name": "start", + "in": "query" + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.RemoteSourceResponse" + } + } + }, + "400": { + "description": "bad request" + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a remotesource", + "produces": [ + "application/json" + ], + "tags": [ + "Remotesources" + ], + "summary": "Create a remotesource", + "parameters": [ + { + "description": "Remotesource request", + "name": "remotesource", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateRemoteSourceRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.RemoteSourceResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/remotesources/{remotesourceref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a remotesource", + "produces": [ + "application/json" + ], + "tags": [ + "Remotesources" + ], + "summary": "Return a remotesource", + "parameters": [ + { + "type": "string", + "description": "Remotesource ref", + "name": "remotesourceref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.RemoteSourceResponse" + } + }, + "404": { + "description": "not found" + } + } + }, + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Update a remotesource", + "produces": [ + "application/json" + ], + "tags": [ + "Remotesources" + ], + "summary": "Update a remotesource", + "parameters": [ + { + "type": "string", + "description": "Remotesource ref", + "name": "remotesourceref", + "in": "path", + "required": true + }, + { + "description": "Remotesource request", + "name": "remotesource", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UpdateRemoteSourceRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.RemoteSourceResponse" + } + }, + "400": { + "description": "bad request" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a remotesource", + "produces": [ + "application/json" + ], + "tags": [ + "Remotesources" + ], + "summary": "Delete a remotesource", + "parameters": [ + { + "type": "string", + "description": "Remotesource ref", + "name": "remotesourceref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/runs": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return runs list", + "produces": [ + "application/json" + ], + "tags": [ + "Runs" + ], + "summary": "Return runs list", + "parameters": [ + { + "type": "integer", + "description": "limit response size", + "name": "limit", + "in": "query" + }, + { + "type": "boolean", + "description": "ascending ordering", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "description": "start run id", + "name": "start", + "in": "query" + }, + { + "type": "string", + "description": "group", + "name": "group", + "in": "query", + "required": true + }, + { + "type": "string", + "description": "phase", + "name": "phase", + "in": "query" + }, + { + "type": "string", + "description": "result", + "name": "result", + "in": "query" + }, + { + "type": "string", + "description": "changegroup", + "name": "changegroup", + "in": "query" + }, + { + "type": "boolean", + "description": "last run", + "name": "lastrun", + "in": "query" + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.RunsResponse" + } + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/runs/{runid}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a run", + "produces": [ + "application/json" + ], + "tags": [ + "Runs" + ], + "summary": "Return a run", + "parameters": [ + { + "type": "string", + "description": "Run id", + "name": "runid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.RunResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/runs/{runid}/actions": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Execute a run action", + "produces": [ + "application/json" + ], + "tags": [ + "Runs" + ], + "summary": "Execute a run action", + "parameters": [ + { + "type": "string", + "description": "Run id", + "name": "runid", + "in": "path", + "required": true + }, + { + "description": "Run action request", + "name": "action", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.RunActionsRequest" + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.RunResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/runs/{runid}/tasks/{taskid}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a task", + "produces": [ + "application/json" + ], + "tags": [ + "Runs" + ], + "summary": "Return a task", + "parameters": [ + { + "type": "string", + "description": "Run id", + "name": "runid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task id", + "name": "taskid", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.RunTaskResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/runs/{runid}/tasks/{taskid}/actions": { + "put": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Execute a task action", + "produces": [ + "application/json" + ], + "tags": [ + "Runs" + ], + "summary": "Execute a task action", + "parameters": [ + { + "type": "string", + "description": "Run id", + "name": "runid", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Task id", + "name": "taskid", + "in": "path", + "required": true + }, + { + "description": "Task action request", + "name": "action", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.RunTaskActionsRequest" + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.RunResponse" + } + }, + "404": { + "description": "not found" + } + } + } + }, + "/user": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return the current user", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Return the current user", + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.UserResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/user/createrun": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a directrun", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create a directrun", + "parameters": [ + { + "description": "Directrun request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.UserCreateRunRequest" + } + } + ], + "responses": { + "201": { + "description": "created" + }, + "400": { + "description": "bad request" + } + } + } + }, + "/user/remoterepos/{remotesourceref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return user remote repo list", + "produces": [ + "application/json" + ], + "tags": [ + "RemoteRepos" + ], + "summary": "Return user remote repo list", + "parameters": [ + { + "type": "string", + "description": "Remotesource ref", + "name": "remotesourceref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.RemoteRepoResponse" + } + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/users": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return users list", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Return users list", + "parameters": [ + { + "type": "integer", + "description": "limit response size", + "name": "limit", + "in": "query" + }, + { + "type": "boolean", + "description": "ascending ordering", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "description": "start user name", + "name": "start", + "in": "query" + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/types.UserResponse" + } + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a user", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create a user", + "parameters": [ + { + "description": "User request", + "name": "secret", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateUserRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.SecretResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/users/{userref}": { + "get": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Return a user", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Return a user", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "$ref": "#/definitions/types.UserResponse" + } + }, + "404": { + "description": "not found" + } + } + }, + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a user", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Delete a user", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/users/{userref}/linkedaccounts": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a user linked account", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create a user linked account", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + }, + { + "description": "Linked account request", + "name": "linkedAccount", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateUserLARequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.CreateUserLAResponse" + } + }, + "400": { + "description": "bad request" + } + } + } + }, + "/users/{userref}/linkedaccounts/{laid}": { + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete user linked account", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Delete user linked account", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Linked account id", + "name": "laid", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + }, + "/users/{userref}/tokens": { + "post": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Create a user token", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Create a user token", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + }, + { + "description": "User token request", + "name": "userToken", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/types.CreateUserTokenRequest" + } + } + ], + "responses": { + "201": { + "description": "created", + "schema": { + "$ref": "#/definitions/types.CreateUserTokenResponse" + } + }, + "400": { + "description": "bad response" + } + } + } + }, + "/users/{userref}/tokens/{tokenname}": { + "delete": { + "security": [ + { + "ApiKeyToken": [] + } + ], + "description": "Delete a user token", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Delete a user token", + "parameters": [ + { + "type": "string", + "description": "User ref", + "name": "userref", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Token name", + "name": "tokenname", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "no content" + }, + "404": { + "description": "not found" + } + } + } + } + }, + "definitions": { + "types.AddOrgMemberRequest": { + "type": "object", + "properties": { + "role": { + "type": "string" + } + } + }, + "types.AddOrgMemberResponse": { + "type": "object", + "properties": { + "organization": { + "$ref": "#/definitions/types.OrgResponse" + }, + "role": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/types.UserResponse" + } + } + }, + "types.AuthorizeResponse": { + "type": "object", + "properties": { + "oauth2_redirect": { + "type": "string" + }, + "remote_source_name": { + "type": "string" + }, + "remote_user_info": { + "$ref": "#/definitions/types.UserInfo" + } + } + }, + "types.CreateOrgRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.CreateProjectGroupRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parent_ref": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.CreateProjectRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parent_ref": { + "type": "string" + }, + "pass_vars_to_forked_pr": { + "type": "boolean" + }, + "remote_source_name": { + "type": "string" + }, + "repo_path": { + "type": "string" + }, + "skip_ssh_host_key_check": { + "type": "boolean" + }, + "visibility": { + "type": "string" + } + } + }, + "types.CreateRemoteSourceRequest": { + "type": "object", + "properties": { + "apiurl": { + "type": "string" + }, + "auth_type": { + "type": "string" + }, + "login_enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "oauth_2_client_id": { + "type": "string" + }, + "oauth_2_client_secret": { + "type": "string" + }, + "registration_enabled": { + "type": "boolean" + }, + "skip_ssh_host_key_check": { + "type": "boolean" + }, + "skip_verify": { + "type": "boolean" + }, + "ssh_host_key": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "types.CreateSecretRequest": { + "type": "object", + "properties": { + "data": { + "description": "internal secret", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "secret_provider_id": { + "description": "external secret", + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "types.CreateUserLARequest": { + "type": "object", + "properties": { + "remote_source_login_name": { + "type": "string" + }, + "remote_source_login_password": { + "type": "string" + }, + "remote_source_name": { + "type": "string" + } + } + }, + "types.CreateUserLAResponse": { + "type": "object", + "properties": { + "linked_account": { + "$ref": "#/definitions/types.LinkedAccount" + }, + "oauth2_redirect": { + "type": "string" + } + } + }, + "types.CreateUserRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + } + } + }, + "types.CreateUserTokenRequest": { + "type": "object", + "properties": { + "token_name": { + "type": "string" + } + } + }, + "types.CreateUserTokenResponse": { + "type": "object", + "properties": { + "token": { + "type": "string" + } + } + }, + "types.CreateVariableRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/types.VariableValueRequest" + } + } + } + }, + "types.LinkedAccount": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remote_source_id": { + "type": "string" + }, + "remote_user_avatar_url": { + "type": "string" + }, + "remote_user_id": { + "type": "string" + }, + "remote_username": { + "type": "string" + } + } + }, + "types.LinkedAccountResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remote_source_id": { + "type": "string" + }, + "remote_user_avatar_url": { + "type": "string" + }, + "remote_user_name": { + "type": "string" + } + } + }, + "types.LoginUserRequest": { + "type": "object", + "properties": { + "login_name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "remote_source_name": { + "type": "string" + } + } + }, + "types.LoginUserResponse": { + "type": "object", + "properties": { + "oauth2_redirect": { + "type": "string" + }, + "token": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/types.UserResponse" + } + } + }, + "types.OrgMemberResponse": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/types.UserResponse" + } + } + }, + "types.OrgMembersResponse": { + "type": "object", + "properties": { + "members": { + "type": "array", + "items": { + "$ref": "#/definitions/types.OrgMemberResponse" + } + }, + "organization": { + "$ref": "#/definitions/types.OrgResponse" + } + } + }, + "types.OrgResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.ProjectCreateRunRequest": { + "type": "object", + "properties": { + "branch": { + "type": "string" + }, + "commit_sha": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "tag": { + "type": "string" + } + } + }, + "types.ProjectGroupResponse": { + "type": "object", + "properties": { + "global_visibility": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parent_path": { + "type": "string" + }, + "path": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.ProjectResponse": { + "type": "object", + "properties": { + "global_visibility": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parent_path": { + "type": "string" + }, + "pass_vars_to_forked_pr": { + "type": "boolean" + }, + "path": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.RegisterUserRequest": { + "type": "object", + "properties": { + "remote_source_login_name": { + "type": "string" + }, + "remote_source_login_password": { + "type": "string" + }, + "remote_source_name": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "types.RegisterUserResponse": { + "type": "object", + "properties": { + "oauth2_redirect": { + "type": "string" + } + } + }, + "types.RemoteRepoResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "types.RemoteSourceResponse": { + "type": "object", + "properties": { + "auth_type": { + "type": "string" + }, + "id": { + "type": "string" + }, + "login_enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "registration_enabled": { + "type": "boolean" + } + } + }, + "types.RunActionsRequest": { + "type": "object", + "properties": { + "action_type": { + "type": "string" + }, + "from_start": { + "description": "Restart", + "type": "boolean" + } + } + }, + "types.RunConfigTaskDepend": { + "type": "object", + "properties": { + "conditions": { + "type": "array", + "items": { + "type": "string" + } + }, + "task_id": { + "type": "string" + } + } + }, + "types.RunResponse": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "can_restart_from_failed_tasks": { + "type": "boolean" + }, + "can_restart_from_scratch": { + "type": "boolean" + }, + "counter": { + "type": "integer" + }, + "end_time": { + "type": "string" + }, + "enqueue_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "result": { + "type": "string" + }, + "setup_errors": { + "type": "array", + "items": { + "type": "string" + } + }, + "start_time": { + "type": "string" + }, + "stopping": { + "type": "boolean" + }, + "tasks": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/types.RunResponseTask" + } + }, + "tasks_waiting_approval": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "types.RunResponseTask": { + "type": "object", + "properties": { + "approval_annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "approved": { + "type": "boolean" + }, + "depends": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/types.RunConfigTaskDepend" + } + }, + "end_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "level": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "status": { + "type": "string" + }, + "waiting_approval": { + "type": "boolean" + } + } + }, + "types.RunTaskActionsRequest": { + "type": "object", + "properties": { + "action_type": { + "type": "string" + } + } + }, + "types.RunTaskResponse": { + "type": "object", + "properties": { + "approval_annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "approved": { + "type": "boolean" + }, + "end_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "setup_step": { + "$ref": "#/definitions/types.RunTaskResponseSetupStep" + }, + "start_time": { + "type": "string" + }, + "status": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/definitions/types.RunTaskResponseStep" + } + }, + "waiting_approval": { + "type": "boolean" + } + } + }, + "types.RunTaskResponseSetupStep": { + "type": "object", + "properties": { + "end_time": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "start_time": { + "type": "string" + } + } + }, + "types.RunTaskResponseStep": { + "type": "object", + "properties": { + "command": { + "type": "string" + }, + "end_time": { + "type": "string" + }, + "exit_status": { + "type": "integer" + }, + "log_archived": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "shell": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "types.RunsResponse": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "counter": { + "type": "integer" + }, + "end_time": { + "type": "string" + }, + "enqueue_time": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "result": { + "type": "string" + }, + "start_time": { + "type": "string" + }, + "tasks_waiting_approval": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "types.SecretResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parent_path": { + "type": "string" + } + } + }, + "types.UpdateProjectGroupRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parent_ref": { + "type": "string" + }, + "visibility": { + "type": "string" + } + } + }, + "types.UpdateProjectRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "parent_ref": { + "type": "string" + }, + "pass_vars_to_forked_pr": { + "type": "boolean" + }, + "visibility": { + "type": "string" + } + } + }, + "types.UpdateRemoteSourceRequest": { + "type": "object", + "properties": { + "apiurl": { + "type": "string" + }, + "login_enabled": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "oauth_2_client_id": { + "type": "string" + }, + "oauth_2_client_secret": { + "type": "string" + }, + "registration_enabled": { + "type": "boolean" + }, + "skip_ssh_host_key_check": { + "type": "boolean" + }, + "skip_verify": { + "type": "boolean" + }, + "ssh_host_key": { + "type": "string" + } + } + }, + "types.UpdateSecretRequest": { + "type": "object", + "properties": { + "data": { + "description": "internal secret", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "secret_provider_id": { + "description": "external secret", + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "types.UpdateVariableRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/types.VariableValueRequest" + } + } + } + }, + "types.UserCreateRunRequest": { + "type": "object", + "properties": { + "branch": { + "type": "string" + }, + "commit_sha": { + "type": "string" + }, + "message": { + "type": "string" + }, + "pull_request_ref_regexes": { + "type": "array", + "items": { + "type": "string" + } + }, + "ref": { + "type": "string" + }, + "repo_path": { + "type": "string" + }, + "repo_uuid": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "variables": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "types.UserInfo": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "id": { + "type": "string" + }, + "loginName": { + "type": "string" + } + } + }, + "types.UserResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "linked_accounts": { + "type": "array", + "items": { + "$ref": "#/definitions/types.LinkedAccountResponse" + } + }, + "tokens": { + "type": "array", + "items": { + "type": "string" + } + }, + "username": { + "type": "string" + } + } + }, + "types.VariableResponse": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parent_path": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/types.VariableValue" + } + } + } + }, + "types.VariableValue": { + "type": "object", + "properties": { + "matching_secret_parent_path": { + "type": "string" + }, + "secret_name": { + "type": "string" + }, + "secret_var": { + "type": "string" + }, + "when": { + "$ref": "#/definitions/types.When" + } + } + }, + "types.VariableValueRequest": { + "type": "object", + "properties": { + "secret_name": { + "type": "string" + }, + "secret_var": { + "type": "string" + }, + "when": { + "$ref": "#/definitions/types.When" + } + } + }, + "types.When": { + "type": "object", + "properties": { + "branch": { + "$ref": "#/definitions/types.WhenConditions" + }, + "ref": { + "$ref": "#/definitions/types.WhenConditions" + }, + "tag": { + "$ref": "#/definitions/types.WhenConditions" + } + } + }, + "types.WhenCondition": { + "type": "object", + "properties": { + "match": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "types.WhenConditions": { + "type": "object", + "properties": { + "exclude": { + "type": "array", + "items": { + "$ref": "#/definitions/types.WhenCondition" + } + }, + "include": { + "type": "array", + "items": { + "$ref": "#/definitions/types.WhenCondition" + } + } + } + } + }, + "securityDefinitions": { + "ApiKeyToken": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + } +} \ No newline at end of file diff --git a/internal/services/gateway/docs/swagger.yaml b/internal/services/gateway/docs/swagger.yaml new file mode 100644 index 000000000..28fe6204d --- /dev/null +++ b/internal/services/gateway/docs/swagger.yaml @@ -0,0 +1,2266 @@ +basePath: /api/v1alpha +definitions: + types.AddOrgMemberRequest: + properties: + role: + type: string + type: object + types.AddOrgMemberResponse: + properties: + organization: + $ref: '#/definitions/types.OrgResponse' + role: + type: string + user: + $ref: '#/definitions/types.UserResponse' + type: object + types.AuthorizeResponse: + properties: + oauth2_redirect: + type: string + remote_source_name: + type: string + remote_user_info: + $ref: '#/definitions/types.UserInfo' + type: object + types.CreateOrgRequest: + properties: + name: + type: string + visibility: + type: string + type: object + types.CreateProjectGroupRequest: + properties: + name: + type: string + parent_ref: + type: string + visibility: + type: string + type: object + types.CreateProjectRequest: + properties: + name: + type: string + parent_ref: + type: string + pass_vars_to_forked_pr: + type: boolean + remote_source_name: + type: string + repo_path: + type: string + skip_ssh_host_key_check: + type: boolean + visibility: + type: string + type: object + types.CreateRemoteSourceRequest: + properties: + apiurl: + type: string + auth_type: + type: string + login_enabled: + type: boolean + name: + type: string + oauth_2_client_id: + type: string + oauth_2_client_secret: + type: string + registration_enabled: + type: boolean + skip_ssh_host_key_check: + type: boolean + skip_verify: + type: boolean + ssh_host_key: + type: string + type: + type: string + type: object + types.CreateSecretRequest: + properties: + data: + additionalProperties: + type: string + description: internal secret + type: object + name: + type: string + path: + type: string + secret_provider_id: + description: external secret + type: string + type: + type: string + type: object + types.CreateUserLARequest: + properties: + remote_source_login_name: + type: string + remote_source_login_password: + type: string + remote_source_name: + type: string + type: object + types.CreateUserLAResponse: + properties: + linked_account: + $ref: '#/definitions/types.LinkedAccount' + oauth2_redirect: + type: string + type: object + types.CreateUserRequest: + properties: + username: + type: string + type: object + types.CreateUserTokenRequest: + properties: + token_name: + type: string + type: object + types.CreateUserTokenResponse: + properties: + token: + type: string + type: object + types.CreateVariableRequest: + properties: + name: + type: string + values: + items: + $ref: '#/definitions/types.VariableValueRequest' + type: array + type: object + types.LinkedAccount: + properties: + id: + type: string + remote_source_id: + type: string + remote_user_avatar_url: + type: string + remote_user_id: + type: string + remote_username: + type: string + type: object + types.LinkedAccountResponse: + properties: + id: + type: string + remote_source_id: + type: string + remote_user_avatar_url: + type: string + remote_user_name: + type: string + type: object + types.LoginUserRequest: + properties: + login_name: + type: string + password: + type: string + remote_source_name: + type: string + type: object + types.LoginUserResponse: + properties: + oauth2_redirect: + type: string + token: + type: string + user: + $ref: '#/definitions/types.UserResponse' + type: object + types.OrgMemberResponse: + properties: + role: + type: string + user: + $ref: '#/definitions/types.UserResponse' + type: object + types.OrgMembersResponse: + properties: + members: + items: + $ref: '#/definitions/types.OrgMemberResponse' + type: array + organization: + $ref: '#/definitions/types.OrgResponse' + type: object + types.OrgResponse: + properties: + id: + type: string + name: + type: string + visibility: + type: string + type: object + types.ProjectCreateRunRequest: + properties: + branch: + type: string + commit_sha: + type: string + ref: + type: string + tag: + type: string + type: object + types.ProjectGroupResponse: + properties: + global_visibility: + type: string + id: + type: string + name: + type: string + parent_path: + type: string + path: + type: string + visibility: + type: string + type: object + types.ProjectResponse: + properties: + global_visibility: + type: string + id: + type: string + name: + type: string + parent_path: + type: string + pass_vars_to_forked_pr: + type: boolean + path: + type: string + visibility: + type: string + type: object + types.RegisterUserRequest: + properties: + remote_source_login_name: + type: string + remote_source_login_password: + type: string + remote_source_name: + type: string + username: + type: string + type: object + types.RegisterUserResponse: + properties: + oauth2_redirect: + type: string + type: object + types.RemoteRepoResponse: + properties: + id: + type: string + path: + type: string + type: object + types.RemoteSourceResponse: + properties: + auth_type: + type: string + id: + type: string + login_enabled: + type: boolean + name: + type: string + registration_enabled: + type: boolean + type: object + types.RunActionsRequest: + properties: + action_type: + type: string + from_start: + description: Restart + type: boolean + type: object + types.RunConfigTaskDepend: + properties: + conditions: + items: + type: string + type: array + task_id: + type: string + type: object + types.RunResponse: + properties: + annotations: + additionalProperties: + type: string + type: object + can_restart_from_failed_tasks: + type: boolean + can_restart_from_scratch: + type: boolean + counter: + type: integer + end_time: + type: string + enqueue_time: + type: string + id: + type: string + name: + type: string + phase: + type: string + result: + type: string + setup_errors: + items: + type: string + type: array + start_time: + type: string + stopping: + type: boolean + tasks: + additionalProperties: + $ref: '#/definitions/types.RunResponseTask' + type: object + tasks_waiting_approval: + items: + type: string + type: array + type: object + types.RunResponseTask: + properties: + approval_annotations: + additionalProperties: + type: string + type: object + approved: + type: boolean + depends: + additionalProperties: + $ref: '#/definitions/types.RunConfigTaskDepend' + type: object + end_time: + type: string + id: + type: string + level: + type: integer + name: + type: string + start_time: + type: string + status: + type: string + waiting_approval: + type: boolean + type: object + types.RunTaskActionsRequest: + properties: + action_type: + type: string + type: object + types.RunTaskResponse: + properties: + approval_annotations: + additionalProperties: + type: string + type: object + approved: + type: boolean + end_time: + type: string + id: + type: string + name: + type: string + setup_step: + $ref: '#/definitions/types.RunTaskResponseSetupStep' + start_time: + type: string + status: + type: string + steps: + items: + $ref: '#/definitions/types.RunTaskResponseStep' + type: array + waiting_approval: + type: boolean + type: object + types.RunTaskResponseSetupStep: + properties: + end_time: + type: string + name: + type: string + phase: + type: string + start_time: + type: string + type: object + types.RunTaskResponseStep: + properties: + command: + type: string + end_time: + type: string + exit_status: + type: integer + log_archived: + type: boolean + name: + type: string + phase: + type: string + shell: + type: string + start_time: + type: string + type: + type: string + type: object + types.RunsResponse: + properties: + annotations: + additionalProperties: + type: string + type: object + counter: + type: integer + end_time: + type: string + enqueue_time: + type: string + id: + type: string + name: + type: string + phase: + type: string + result: + type: string + start_time: + type: string + tasks_waiting_approval: + items: + type: string + type: array + type: object + types.SecretResponse: + properties: + id: + type: string + name: + type: string + parent_path: + type: string + type: object + types.UpdateProjectGroupRequest: + properties: + name: + type: string + parent_ref: + type: string + visibility: + type: string + type: object + types.UpdateProjectRequest: + properties: + name: + type: string + parent_ref: + type: string + pass_vars_to_forked_pr: + type: boolean + visibility: + type: string + type: object + types.UpdateRemoteSourceRequest: + properties: + apiurl: + type: string + login_enabled: + type: boolean + name: + type: string + oauth_2_client_id: + type: string + oauth_2_client_secret: + type: string + registration_enabled: + type: boolean + skip_ssh_host_key_check: + type: boolean + skip_verify: + type: boolean + ssh_host_key: + type: string + type: object + types.UpdateSecretRequest: + properties: + data: + additionalProperties: + type: string + description: internal secret + type: object + name: + type: string + path: + type: string + secret_provider_id: + description: external secret + type: string + type: + type: string + type: object + types.UpdateVariableRequest: + properties: + name: + type: string + values: + items: + $ref: '#/definitions/types.VariableValueRequest' + type: array + type: object + types.UserCreateRunRequest: + properties: + branch: + type: string + commit_sha: + type: string + message: + type: string + pull_request_ref_regexes: + items: + type: string + type: array + ref: + type: string + repo_path: + type: string + repo_uuid: + type: string + tag: + type: string + variables: + additionalProperties: + type: string + type: object + type: object + types.UserInfo: + properties: + email: + type: string + id: + type: string + loginName: + type: string + type: object + types.UserResponse: + properties: + id: + type: string + linked_accounts: + items: + $ref: '#/definitions/types.LinkedAccountResponse' + type: array + tokens: + items: + type: string + type: array + username: + type: string + type: object + types.VariableResponse: + properties: + id: + type: string + name: + type: string + parent_path: + type: string + values: + items: + $ref: '#/definitions/types.VariableValue' + type: array + type: object + types.VariableValue: + properties: + matching_secret_parent_path: + type: string + secret_name: + type: string + secret_var: + type: string + when: + $ref: '#/definitions/types.When' + type: object + types.VariableValueRequest: + properties: + secret_name: + type: string + secret_var: + type: string + when: + $ref: '#/definitions/types.When' + type: object + types.When: + properties: + branch: + $ref: '#/definitions/types.WhenConditions' + ref: + $ref: '#/definitions/types.WhenConditions' + tag: + $ref: '#/definitions/types.WhenConditions' + type: object + types.WhenCondition: + properties: + match: + type: string + type: + type: string + type: object + types.WhenConditions: + properties: + exclude: + items: + $ref: '#/definitions/types.WhenCondition' + type: array + include: + items: + $ref: '#/definitions/types.WhenCondition' + type: array + type: object +info: + contact: {} + title: agola + version: v0.6.0 +paths: + /auth/authorize: + post: + description: Authorize + parameters: + - description: Authorize request + in: body + name: authorize + required: true + schema: + $ref: '#/definitions/types.LoginUserRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.AuthorizeResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Authorize + tags: + - Users + /auth/login: + post: + description: Login + parameters: + - description: Login request + in: body + name: login + required: true + schema: + $ref: '#/definitions/types.LoginUserRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.LoginUserResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Login + tags: + - Users + /auth/register: + post: + description: Register + parameters: + - description: Register request + in: body + name: register + required: true + schema: + $ref: '#/definitions/types.RegisterUserRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.RegisterUserResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Register + tags: + - Users + /orgs: + get: + description: Return organizations list + parameters: + - description: limit response size + in: query + name: limit + type: integer + - description: ascending ordering + in: query + name: asc + type: boolean + - description: start organization ref + in: query + name: start + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.OrgResponse' + type: array + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Return organizations list + tags: + - Organizations + post: + description: Create an organization + parameters: + - description: Organization request + in: body + name: organization + required: true + schema: + $ref: '#/definitions/types.CreateOrgRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.OrgResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create an organization + tags: + - Organizations + /orgs/{orgref}: + delete: + description: Delete an organization + parameters: + - description: Organization ref + in: path + name: orgref + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete an organization + tags: + - Organizations + get: + description: Return an organization + parameters: + - description: Organization ref + in: path + name: orgref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.OrgResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return an organization + tags: + - Organizations + /orgs/{orgref}/members: + get: + description: Return organization members + parameters: + - description: Organization ref + in: path + name: orgref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.OrgMembersResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return organization members + tags: + - Organizations + /orgs/{orgref}/members/{userref}: + delete: + description: Remove an organization member + parameters: + - description: Organization ref + in: path + name: orgref + required: true + type: string + - description: User ref + in: path + name: userref + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Remove an organization member + tags: + - Organizations + put: + description: Add an organization member + parameters: + - description: Organization ref + in: path + name: orgref + required: true + type: string + - description: User ref + in: path + name: userref + required: true + type: string + - description: Organization member request + in: body + name: organization_member + required: true + schema: + $ref: '#/definitions/types.AddOrgMemberRequest' + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.AddOrgMemberResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Add an organization member + tags: + - Organizations + /projectgroups: + post: + description: Create a projectggroup + parameters: + - description: Projectgroup request + in: body + name: projectgroup + required: true + schema: + $ref: '#/definitions/types.CreateProjectGroupRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.ProjectGroupResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a projectgroup + tags: + - Projectgroups + /projectgroups/{projectgroupref}: + delete: + description: Delete a projectggroup + parameters: + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete a projectgroup + tags: + - Projectgroups + get: + description: Return a projectggroup + parameters: + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.ProjectGroupResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return a projectgroup + tags: + - Projectgroups + put: + description: Update a projectggroup + parameters: + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + - description: Projectgroup request + in: body + name: projectgroup + required: true + schema: + $ref: '#/definitions/types.UpdateProjectGroupRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.ProjectGroupResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Update a projectgroup + tags: + - Projectgroups + /projectgroups/{projectgroupref}/projects: + get: + description: Return projectgroup projects + parameters: + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.ProjectResponse' + type: array + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return projectgroup projects + tags: + - Projectgroups + /projectgroups/{projectgroupref}/secrets: + get: + description: Return a list of projectgroup secrets + parameters: + - description: secret tree + in: query + name: tree + type: boolean + - description: filter overridden + in: query + name: removeoverridden + type: boolean + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.SecretResponse' + type: array + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return a list of projectgroup secrets + tags: + - Secrets + post: + description: Create a projectgroup secret + parameters: + - description: Secret request + in: body + name: secret + required: true + schema: + $ref: '#/definitions/types.CreateSecretRequest' + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.SecretResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a projectgroup secret + tags: + - Secrets + /projectgroups/{projectgroupref}/secrets/{secretname}: + delete: + description: Delete a projectgroup secret + parameters: + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + - description: Secret name + in: path + name: secretname + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete a projectgroup secret + tags: + - Secrets + put: + description: Update a projectgroup secret + parameters: + - description: Secret request + in: body + name: secret + required: true + schema: + $ref: '#/definitions/types.UpdateSecretRequest' + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + - description: Secret name + in: path + name: secretname + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.SecretResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Update a projectgroup secret + tags: + - Secrets + /projectgroups/{projectgroupref}/subgroups: + get: + description: Return a projectgroup subgroups + parameters: + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.ProjectGroupResponse' + type: array + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return projectgroup subgroups + tags: + - Projectgroups + /projectgroups/{projectgroupref}/variables: + get: + description: Return a list of projectgroup variables + parameters: + - description: secret tree + in: query + name: tree + type: boolean + - description: filter overridden + in: query + name: removeoverridden + type: boolean + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.VariableResponse' + type: array + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return a list of projectgroup variables + tags: + - Variables + post: + description: Create a projectgroup variable + parameters: + - description: Variable request + in: body + name: variable + required: true + schema: + $ref: '#/definitions/types.CreateVariableRequest' + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.VariableResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a projectgroup variable + tags: + - Variables + /projectgroups/{projectgroupref}/variables/{variablename}: + delete: + description: Delete a projectgroup variable + parameters: + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + - description: Variable name + in: path + name: variablename + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete a projectgroup variable + tags: + - Variables + put: + description: Update a projectgroup variable + parameters: + - description: Variable request + in: body + name: variable + required: true + schema: + $ref: '#/definitions/types.UpdateVariableRequest' + - description: Projectgroup ref + in: path + name: projectgroupref + required: true + type: string + - description: Variable name + in: path + name: variablename + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.VariableResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Update a projectgroup variable + tags: + - Variables + /projects: + post: + description: Create a project + parameters: + - description: Project request + in: body + name: project + required: true + schema: + $ref: '#/definitions/types.CreateProjectRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.ProjectResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a project + tags: + - Projects + /projects/{projectref}: + delete: + description: Delete a project + parameters: + - description: Project ref + in: path + name: projectref + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete a project + tags: + - Projects + get: + description: Return a project + parameters: + - description: Project ref + in: path + name: projectref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.ProjectResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return a project + tags: + - Projects + put: + description: Update a project + parameters: + - description: Project ref + in: path + name: projectref + required: true + type: string + - description: Project request + in: body + name: project + required: true + schema: + $ref: '#/definitions/types.UpdateProjectRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.ProjectResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Update a project + tags: + - Projects + /projects/{projectref}/createrun: + post: + description: Create a run + parameters: + - description: Project ref + in: path + name: projectref + required: true + type: string + - description: Project run request + in: body + name: run + required: true + schema: + $ref: '#/definitions/types.ProjectCreateRunRequest' + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/types.ProjectGroupResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a run + tags: + - Projects + /projects/{projectref}/reconfig: + put: + description: Reconfig a project + parameters: + - description: Project ref + in: path + name: projectref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Reconfig a project + tags: + - Projects + /projects/{projectref}/secrets: + get: + description: Return a list of project secrets + parameters: + - description: secret tree + in: query + name: tree + type: boolean + - description: filter overridden + in: query + name: removeoverridden + type: boolean + - description: Project ref + in: path + name: projectref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.SecretResponse' + type: array + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return a list of project secrets + tags: + - Secrets + post: + description: Create a project secret + parameters: + - description: Projectgroup request + in: body + name: secret + required: true + schema: + $ref: '#/definitions/types.CreateSecretRequest' + - description: Project ref + in: path + name: projectref + required: true + type: string + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.SecretResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a project secret + tags: + - Secrets + /projects/{projectref}/secrets/{secretname}: + delete: + description: Delete a project secret + parameters: + - description: Project ref + in: path + name: projectref + required: true + type: string + - description: Secret name + in: path + name: secretname + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete a project secret + tags: + - Secrets + put: + description: Update a projectgroup secret + parameters: + - description: Secret request + in: body + name: secret + required: true + schema: + $ref: '#/definitions/types.UpdateSecretRequest' + - description: Project ref + in: path + name: projectref + required: true + type: string + - description: Secret name + in: path + name: secretname + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.SecretResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Update a projectgroup secret + tags: + - Secrets + /projects/{projectref}/updaterepolinkedaccount: + put: + description: Update a project repository linked account + parameters: + - description: Project ref + in: path + name: projectref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.ProjectResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Update a project repository linked account + tags: + - Projects + /projects/{projectref}/variables: + get: + description: Return a list of project variables + parameters: + - description: secret tree + in: query + name: tree + type: boolean + - description: filter overridden + in: query + name: removeoverridden + type: boolean + - description: Project ref + in: path + name: projectref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.VariableResponse' + type: array + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return a list of project variables + tags: + - Variables + post: + description: Create a project variable + parameters: + - description: Variable request + in: body + name: variable + required: true + schema: + $ref: '#/definitions/types.CreateVariableRequest' + - description: Project ref + in: path + name: projectref + required: true + type: string + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.VariableResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a project variable + tags: + - Variables + /projects/{projectref}/variables/{variablename}: + delete: + description: Delete a project variable + parameters: + - description: Project ref + in: path + name: projectref + required: true + type: string + - description: Variable name + in: path + name: variablename + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete a project variable + tags: + - Variables + put: + description: Update a project variable + parameters: + - description: Variable request + in: body + name: variable + required: true + schema: + $ref: '#/definitions/types.UpdateVariableRequest' + - description: Project ref + in: path + name: projectref + required: true + type: string + - description: Variable name + in: path + name: variablename + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.VariableResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Update a project variable + tags: + - Variables + /remotesources: + get: + description: Return remotesources list + parameters: + - description: limit response size + in: query + name: limit + type: integer + - description: ascending ordering + in: query + name: asc + type: boolean + - description: start remotesource ref + in: query + name: start + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.RemoteSourceResponse' + type: array + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Return remotesources list + tags: + - Remotesources + post: + description: Create a remotesource + parameters: + - description: Remotesource request + in: body + name: remotesource + required: true + schema: + $ref: '#/definitions/types.CreateRemoteSourceRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.RemoteSourceResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a remotesource + tags: + - Remotesources + /remotesources/{remotesourceref}: + delete: + description: Delete a remotesource + parameters: + - description: Remotesource ref + in: path + name: remotesourceref + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete a remotesource + tags: + - Remotesources + get: + description: Return a remotesource + parameters: + - description: Remotesource ref + in: path + name: remotesourceref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.RemoteSourceResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return a remotesource + tags: + - Remotesources + put: + description: Update a remotesource + parameters: + - description: Remotesource ref + in: path + name: remotesourceref + required: true + type: string + - description: Remotesource request + in: body + name: remotesource + required: true + schema: + $ref: '#/definitions/types.UpdateRemoteSourceRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.RemoteSourceResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Update a remotesource + tags: + - Remotesources + /runs: + get: + description: Return runs list + parameters: + - description: limit response size + in: query + name: limit + type: integer + - description: ascending ordering + in: query + name: asc + type: boolean + - description: start run id + in: query + name: start + type: string + - description: group + in: query + name: group + required: true + type: string + - description: phase + in: query + name: phase + type: string + - description: result + in: query + name: result + type: string + - description: changegroup + in: query + name: changegroup + type: string + - description: last run + in: query + name: lastrun + type: boolean + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.RunsResponse' + type: array + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Return runs list + tags: + - Runs + /runs/{runid}: + get: + description: Return a run + parameters: + - description: Run id + in: path + name: runid + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.RunResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return a run + tags: + - Runs + /runs/{runid}/actions: + put: + description: Execute a run action + parameters: + - description: Run id + in: path + name: runid + required: true + type: string + - description: Run action request + in: body + name: action + required: true + schema: + $ref: '#/definitions/types.RunActionsRequest' + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.RunResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Execute a run action + tags: + - Runs + /runs/{runid}/tasks/{taskid}: + get: + description: Return a task + parameters: + - description: Run id + in: path + name: runid + required: true + type: string + - description: Task id + in: path + name: taskid + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.RunTaskResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return a task + tags: + - Runs + /runs/{runid}/tasks/{taskid}/actions: + put: + description: Execute a task action + parameters: + - description: Run id + in: path + name: runid + required: true + type: string + - description: Task id + in: path + name: taskid + required: true + type: string + - description: Task action request + in: body + name: action + required: true + schema: + $ref: '#/definitions/types.RunTaskActionsRequest' + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.RunResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Execute a task action + tags: + - Runs + /user: + get: + description: Return the current user + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.UserResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Return the current user + tags: + - Users + /user/createrun: + post: + description: Create a directrun + parameters: + - description: Directrun request + in: body + name: secret + required: true + schema: + $ref: '#/definitions/types.UserCreateRunRequest' + produces: + - application/json + responses: + "201": + description: created + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a directrun + tags: + - Users + /user/remoterepos/{remotesourceref}: + get: + description: Return user remote repo list + parameters: + - description: Remotesource ref + in: path + name: remotesourceref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.RemoteRepoResponse' + type: array + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Return user remote repo list + tags: + - RemoteRepos + /users: + get: + description: Return users list + parameters: + - description: limit response size + in: query + name: limit + type: integer + - description: ascending ordering + in: query + name: asc + type: boolean + - description: start user name + in: query + name: start + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + items: + $ref: '#/definitions/types.UserResponse' + type: array + security: + - ApiKeyToken: [] + summary: Return users list + tags: + - Users + post: + description: Create a user + parameters: + - description: User request + in: body + name: secret + required: true + schema: + $ref: '#/definitions/types.CreateUserRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.SecretResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a user + tags: + - Users + /users/{userref}: + delete: + description: Delete a user + parameters: + - description: User ref + in: path + name: userref + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete a user + tags: + - Users + get: + description: Return a user + parameters: + - description: User ref + in: path + name: userref + required: true + type: string + produces: + - application/json + responses: + "200": + description: ok + schema: + $ref: '#/definitions/types.UserResponse' + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Return a user + tags: + - Users + /users/{userref}/linkedaccounts: + post: + description: Create a user linked account + parameters: + - description: User ref + in: path + name: userref + required: true + type: string + - description: Linked account request + in: body + name: linkedAccount + required: true + schema: + $ref: '#/definitions/types.CreateUserLARequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.CreateUserLAResponse' + "400": + description: bad request + security: + - ApiKeyToken: [] + summary: Create a user linked account + tags: + - Users + /users/{userref}/linkedaccounts/{laid}: + delete: + description: Delete user linked account + parameters: + - description: User ref + in: path + name: userref + required: true + type: string + - description: Linked account id + in: path + name: laid + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete user linked account + tags: + - Users + /users/{userref}/tokens: + post: + description: Create a user token + parameters: + - description: User ref + in: path + name: userref + required: true + type: string + - description: User token request + in: body + name: userToken + required: true + schema: + $ref: '#/definitions/types.CreateUserTokenRequest' + produces: + - application/json + responses: + "201": + description: created + schema: + $ref: '#/definitions/types.CreateUserTokenResponse' + "400": + description: bad response + security: + - ApiKeyToken: [] + summary: Create a user token + tags: + - Users + /users/{userref}/tokens/{tokenname}: + delete: + description: Delete a user token + parameters: + - description: User ref + in: path + name: userref + required: true + type: string + - description: Token name + in: path + name: tokenname + required: true + type: string + produces: + - application/json + responses: + "204": + description: no content + "404": + description: not found + security: + - ApiKeyToken: [] + summary: Delete a user token + tags: + - Users +securityDefinitions: + ApiKeyToken: + in: header + name: Authorization + type: apiKey +swagger: "2.0" diff --git a/internal/services/gateway/docs/user.go b/internal/services/gateway/docs/user.go new file mode 100644 index 000000000..92d3c7d6b --- /dev/null +++ b/internal/services/gateway/docs/user.go @@ -0,0 +1,165 @@ +package docs + +import ( + _ "agola.io/agola/services/gateway/api/types" +) + +// @Summary Return the current user +// @Description Return the current user +// @Tags Users +// @Produce json +// @Success 200 {object} types.UserResponse "ok" +// @Failure 400 "bad request" +// @Router /user [get] +// @Security ApiKeyToken +//nolint +func getCurrentUser() {} + +// @Summary Return a user +// @Description Return a user +// @Tags Users +// @Produce json +// @Param userref path string true "User ref" +// @Success 200 {object} types.UserResponse "ok" +// @Failure 404 "not found" +// @Router /users/{userref} [get] +// @Security ApiKeyToken +//nolint +func getUser() {} + +// @Summary Return users list +// @Description Return users list +// @Tags Users +// @Produce json +// @Param limit query int false "limit response size" +// @Param asc query bool false "ascending ordering" +// @Param start query string false "start user name" +// @Success 200 {array} types.UserResponse "ok" +// @Router /users [get] +// @Security ApiKeyToken +//nolint +func getUserList() {} + +// @Summary Create a user +// @Description Create a user +// @Tags Users +// @Produce json +// @Param secret body types.CreateUserRequest true "User request" +// @Success 201 {object} types.SecretResponse "created" +// @Failure 400 "bad request" +// @Router /users [post] +// @Security ApiKeyToken +//nolint +func createUser() {} + +// @Summary Delete a user +// @Description Delete a user +// @Tags Users +// @Produce json +// @Param userref path string true "User ref" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /users/{userref} [delete] +// @Security ApiKeyToken +//nolint +func deleteUser() {} + +// @Summary Create a directrun +// @Description Create a directrun +// @Tags Users +// @Produce json +// @Param secret body types.UserCreateRunRequest true "Directrun request" +// @Success 201 "created" +// @Failure 400 "bad request" +// @Router /user/createrun [post] +// @Security ApiKeyToken +//nolint +func createUserRun() {} + +// @Summary Create a user linked account +// @Description Create a user linked account +// @Tags Users +// @Produce json +// @Param userref path string true "User ref" +// @Param linkedAccount body types.CreateUserLARequest true "Linked account request" +// @Success 201 {object} types.CreateUserLAResponse "created" +// @Failure 400 "bad request" +// @Router /users/{userref}/linkedaccounts [post] +// @Security ApiKeyToken +//nolint +func createUserLinkedAccount() {} + +// @Summary Delete user linked account +// @Description Delete user linked account +// @Tags Users +// @Produce json +// @Param userref path string true "User ref" +// @Param laid path string true "Linked account id" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /users/{userref}/linkedaccounts/{laid} [delete] +// @Security ApiKeyToken +//nolint +func deleteUserLinkedAccount() {} + +// @Summary Create a user token +// @Description Create a user token +// @Tags Users +// @Produce json +// @Param userref path string true "User ref" +// @Param userToken body types.CreateUserTokenRequest true "User token request" +// @Success 201 {object} types.CreateUserTokenResponse "created" +// @Failure 400 "bad response" +// @Router /users/{userref}/tokens [post] +// @Security ApiKeyToken +//nolint +func createUserToken() {} + +// @Summary Delete a user token +// @Description Delete a user token +// @Tags Users +// @Produce json +// @Param userref path string true "User ref" +// @Param tokenname path string true "Token name" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /users/{userref}/tokens/{tokenname} [delete] +// @Security ApiKeyToken +//nolint +func deleteUserToken() {} + +// @Summary Login +// @Description Login +// @Tags Users +// @Produce json +// @Param login body types.LoginUserRequest true "Login request" +// @Success 201 {object} types.LoginUserResponse"created" +// @Failure 400 "bad request" +// @Router /auth/login [post] +// @Security ApiKeyToken +//nolint +func login() {} + +// @Summary Authorize +// @Description Authorize +// @Tags Users +// @Produce json +// @Param authorize body types.LoginUserRequest true "Authorize request" +// @Success 201 {object} types.AuthorizeResponse"created" +// @Failure 400 "bad request" +// @Router /auth/authorize [post] +// @Security ApiKeyToken +//nolint +func authorize() {} + +// @Summary Register +// @Description Register +// @Tags Users +// @Produce json +// @Param register body types.RegisterUserRequest true "Register request" +// @Success 201 {object} types.RegisterUserResponse"created" +// @Failure 400 "bad request" +// @Router /auth/register [post] +// @Security ApiKeyToken +//nolint +func register() {} diff --git a/internal/services/gateway/docs/variable.go b/internal/services/gateway/docs/variable.go new file mode 100644 index 000000000..e13e770e9 --- /dev/null +++ b/internal/services/gateway/docs/variable.go @@ -0,0 +1,113 @@ +package docs + +import ( + _ "agola.io/agola/services/gateway/api/types" +) + +// @Summary Return a list of projectgroup variables +// @Description Return a list of projectgroup variables +// @Tags Variables +// @Produce json +// @Param tree query bool false "secret tree" +// @Param removeoverridden query bool false "filter overridden" +// @Param projectgroupref path string true "Projectgroup ref" +// @Success 200 {array} types.VariableResponse "ok" +// @Failure 404 "not found" +// @Router /projectgroups/{projectgroupref}/variables [get] +// @Security ApiKeyToken +//nolint +func getProjectgroupVariableList() {} + +// @Summary Return a list of project variables +// @Description Return a list of project variables +// @Tags Variables +// @Produce json +// @Param tree query bool false "secret tree" +// @Param removeoverridden query bool false "filter overridden" +// @Param projectref path string true "Project ref" +// @Success 200 {array} types.VariableResponse "ok" +// @Failure 404 "not found" +// @Router /projects/{projectref}/variables [get] +// @Security ApiKeyToken +//nolint +func getProjectVariableList() {} + +// @Summary Create a projectgroup variable +// @Description Create a projectgroup variable +// @Tags Variables +// @Produce json +// @Param variable body types.CreateVariableRequest true "Variable request" +// @Param projectgroupref path string true "Projectgroup ref" +// @Success 201 {object} types.VariableResponse "created" +// @Failure 400 "bad request" +// @Router /projectgroups/{projectgroupref}/variables [post] +// @Security ApiKeyToken +//nolint +func createProjectgroupVariable() {} + +// @Summary Create a project variable +// @Description Create a project variable +// @Tags Variables +// @Produce json +// @Param variable body types.CreateVariableRequest true "Variable request" +// @Param projectref path string true "Project ref" +// @Success 201 {object} types.VariableResponse "created" +// @Failure 400 "bad request" +// @Router /projects/{projectref}/variables [post] +// @Security ApiKeyToken +//nolint +func createProjectVariable() {} + +// @Summary Update a projectgroup variable +// @Description Update a projectgroup variable +// @Tags Variables +// @Produce json +// @Param variable body types.UpdateVariableRequest true "Variable request" +// @Param projectgroupref path string true "Projectgroup ref" +// @Param variablename path string true "Variable name" +// @Success 200 {object} types.VariableResponse "ok" +// @Failure 400 "bad request" +// @Router /projectgroups/{projectgroupref}/variables/{variablename} [put] +// @Security ApiKeyToken +//nolint +func updateProjectgroupVariable() {} + +// @Summary Update a project variable +// @Description Update a project variable +// @Tags Variables +// @Produce json +// @Param variable body types.UpdateVariableRequest true "Variable request" +// @Param projectref path string true "Project ref" +// @Param variablename path string true "Variable name" +// @Success 200 {object} types.VariableResponse "ok" +// @Failure 400 "bad request" +// @Router /projects/{projectref}/variables/{variablename} [put] +// @Security ApiKeyToken +//nolint +func updateProjectVariable() {} + +// @Summary Delete a projectgroup variable +// @Description Delete a projectgroup variable +// @Tags Variables +// @Produce json +// @Param projectgroupref path string true "Projectgroup ref" +// @Param variablename path string true "Variable name" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /projectgroups/{projectgroupref}/variables/{variablename} [delete] +// @Security ApiKeyToken +//nolint +func deleteProjectgroupVariable() {} + +// @Summary Delete a project variable +// @Description Delete a project variable +// @Tags Variables +// @Produce json +// @Param projectref path string true "Project ref" +// @Param variablename path string true "Variable name" +// @Success 204 "no content" +// @Failure 404 "not found" +// @Router /projects/{projectref}/variables/{variablename} [delete] +// @Security ApiKeyToken +//nolint +func deleteProjectVariable() {} diff --git a/internal/services/gateway/gateway.go b/internal/services/gateway/gateway.go index b9f093b1a..1a3fd72ab 100644 --- a/internal/services/gateway/gateway.go +++ b/internal/services/gateway/gateway.go @@ -19,6 +19,7 @@ import ( "crypto/tls" "io/ioutil" "net/http" + "net/url" scommon "agola.io/agola/internal/common" slog "agola.io/agola/internal/log" @@ -27,6 +28,7 @@ import ( "agola.io/agola/internal/services/config" "agola.io/agola/internal/services/gateway/action" "agola.io/agola/internal/services/gateway/api" + "agola.io/agola/internal/services/gateway/docs" "agola.io/agola/internal/services/gateway/handlers" "agola.io/agola/internal/util" csclient "agola.io/agola/services/configstore/client" @@ -38,6 +40,10 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" errors "golang.org/x/xerrors" + + _ "agola.io/agola/internal/services/gateway/docs" + _ "github.com/swaggo/files" // swagger embed files + httpSwagger "github.com/swaggo/http-swagger" // http-swagger middleware ) var level = zap.NewAtomicLevelAt(zapcore.InfoLevel) @@ -58,6 +64,13 @@ type Gateway struct { sd *common.TokenSigningData } +// @BasePath /api/v1alpha +// @title agola +// @version v0.6.0 + +// @securityDefinitions.apiKey ApiKeyToken +// @in header +// @name Authorization func NewGateway(ctx context.Context, l *zap.Logger, gc *config.Config) (*Gateway, error) { c := &gc.Gateway @@ -234,6 +247,14 @@ func (g *Gateway) Run(ctx context.Context) error { router := mux.NewRouter() reposRouter := mux.NewRouter() + url, err := url.Parse(g.c.APIExposedURL) + if err == nil { + docs.SwaggerInfo.Host = url.Host + router.PathPrefix("/swagger").Handler(httpSwagger.WrapHandler) + } else { + log.Error("swagger not started") + } + apirouter := mux.NewRouter().PathPrefix("/api/v1alpha").Subrouter().UseEncodedPath() authForcedHandler := handlers.NewAuthHandler(logger, g.configstoreClient, g.c.AdminToken, g.sd, true)