From ff13da5321157ffe2f74dbc04e8dab107145f204 Mon Sep 17 00:00:00 2001 From: Harry Maclean Date: Wed, 22 Aug 2018 11:54:23 +0100 Subject: [PATCH 1/3] Don't require authentication for creating access tokens When creating an access token you're necessarily not authenticated yet. --- main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 1acfe882..c3f65f92 100644 --- a/main.go +++ b/main.go @@ -201,8 +201,15 @@ func main() { Add(routes.Authenticate(authenticator)) // Access Tokens + // This route is hit before the user is authenticated, so we don't use the + // Authenticate middleware router.Methods("POST").Path("/access_tokens").HandlerFunc( - defaultChain.Resolve(accessTokenRouteSet.Create), + rootHandler. + Add(routes.DefaultErrorRenderer). + Add(routes.WithVersion). + Add(routes.AsJSON). + Add(routes.CheckAPIVersion(version.Version)). + Resolve(accessTokenRouteSet.Create), ) // Images From 4fc93d63d6bae5d261e3fe3eaef4012d52a83209 Mon Sep 17 00:00:00 2001 From: Harry Maclean Date: Wed, 22 Aug 2018 12:01:19 +0100 Subject: [PATCH 2/3] Bump version --- CHANGELOG.md | 6 ++++++ DRAUPNIR_VERSION | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29b44580..f747302c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ Unreleased Nothing +2.0.1 +----- + +- Fix bug where the `POST /access_tokens` route was behind authentication, + preventing users from authenticating for the first time. + 2.0.0 ----- diff --git a/DRAUPNIR_VERSION b/DRAUPNIR_VERSION index 227cea21..38f77a65 100644 --- a/DRAUPNIR_VERSION +++ b/DRAUPNIR_VERSION @@ -1 +1 @@ -2.0.0 +2.0.1 From d67e5951b30f1417543a087e3cc56cf96da309ac Mon Sep 17 00:00:00 2001 From: Harry Maclean Date: Wed, 22 Aug 2018 12:12:28 +0100 Subject: [PATCH 3/3] Update vendored dependencies --- Gopkg.lock | 80 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index b07a37be..06b757ce 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,164 +3,211 @@ [[projects]] branch = "master" + digest = "1:a74730e052a45a3fab1d310fdef2ec17ae3d6af16228421e238320846f2aaec8" name = "github.com/alecthomas/template" packages = [ ".", - "parse" + "parse", ] + pruneopts = "" revision = "a0175ee3bccc567396460bf5acd36800cb10c49c" [[projects]] branch = "master" + digest = "1:8483994d21404c8a1d489f6be756e25bfccd3b45d65821f25695577791a08e68" name = "github.com/alecthomas/units" packages = ["."] + pruneopts = "" revision = "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a" [[projects]] + digest = "1:289dd4d7abfb3ad2b5f728fbe9b1d5c1bf7d265a3eb9ef92869af1f7baba4c7a" name = "github.com/burntsushi/toml" packages = ["."] + pruneopts = "" revision = "b26d9c308763d68093482582cea63d69be07a0f0" version = "v0.3.0" [[projects]] + digest = "1:c9d2fb74cb40a4974ac4b645effdf53e04ad3b9b2bb31544f1de1e4631cac3e2" name = "github.com/certifi/gocertifi" packages = ["."] + pruneopts = "" revision = "a4ab0227d360091084658029ec8ae45f989fba3e" version = "2017.11.05" [[projects]] + digest = "1:56c130d885a4aacae1dd9c7b71cfe39912c7ebc1ff7d2b46083c8812996dc43b" name = "github.com/davecgh/go-spew" packages = ["spew"] + pruneopts = "" revision = "346938d642f2ec3594ed81d874461961cd0faa76" version = "v1.1.0" [[projects]] branch = "master" + digest = "1:ca869de3378f9b10c0911b4559060575a538fae778db5ca015b8be14133a0017" name = "github.com/getsentry/raven-go" packages = ["."] + pruneopts = "" revision = "32a13797442ccb601b11761d74232773c1402d14" [[projects]] branch = "master" + digest = "1:54859951ba785c9f5c7a0e665a9fe9fb6b1afeef112c62eaad77081d3d5916cc" name = "github.com/golang/protobuf" packages = ["proto"] + pruneopts = "" revision = "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" [[projects]] + digest = "1:52c82ed99781a1898703bd32866f9876a8c40a21609913084830566f2af6783a" name = "github.com/google/jsonapi" packages = ["."] + pruneopts = "" revision = "925ebf2136461bb9d121340ec95a719bf9073d1c" [[projects]] + digest = "1:20ed7daa9b3b38b6d1d39b48ab3fd31122be5419461470d0c28de3e121c93ecf" name = "github.com/gorilla/context" packages = ["."] + pruneopts = "" revision = "1ea25387ff6f684839d82767c1733ff4d4d15d0a" version = "v1.1" [[projects]] + digest = "1:74f252b12d195c61ef5e54a4e2ab677af765d9e4b68b42c8c64fd16a4502a0c8" name = "github.com/gorilla/mux" packages = ["."] + pruneopts = "" revision = "24fca303ac6da784b9e8269f724ddeb0b2eea5e7" version = "v1.5.0" [[projects]] branch = "master" + digest = "1:72c3559bd3f56be44f480c7f761ddc734c9e9db105981838165c3f29ebf160f7" name = "github.com/lib/pq" packages = [ ".", - "oid" + "oid", ] + pruneopts = "" revision = "b0d5024adb34b4122c6ee7eeb6ab511f7223222d" [[projects]] + digest = "1:94e9081cc450d2cdf4e6886fc2c06c07272f86477df2d74ee5931951fa3d2577" name = "github.com/oklog/run" packages = ["."] + pruneopts = "" revision = "4dadeb3030eda0273a12382bb2348ffc7c9d1a39" version = "v1.0.0" [[projects]] + digest = "1:7365acd48986e205ccb8652cc746f09c8b7876030d53710ea6ef7d0bd0dcd7ca" name = "github.com/pkg/errors" packages = ["."] + pruneopts = "" revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" [[projects]] + digest = "1:256484dbbcd271f9ecebc6795b2df8cad4c458dd0f5fd82a8c2fa0c29f233411" name = "github.com/pmezard/go-difflib" packages = ["difflib"] + pruneopts = "" revision = "792786c7400a136282c1664665ae0a8db921c6c2" version = "v1.0.0" [[projects]] branch = "master" + digest = "1:acf9415ef3a5f298495b0e1aa4d0e18f571a3c845872944e6c52777496819b21" name = "github.com/prometheus/common" packages = ["log"] + pruneopts = "" revision = "89604d197083d4781071d3c65855d24ecfb0a563" [[projects]] + digest = "1:42a42c4bc67bed17f40fddf0f24d4403e25e7b96488456cf4248e6d16659d370" name = "github.com/sirupsen/logrus" packages = ["."] + pruneopts = "" revision = "d682213848ed68c0a260ca37d6dd5ace8423f5ba" version = "v1.0.4" [[projects]] + digest = "1:3926a4ec9a4ff1a072458451aa2d9b98acd059a45b38f7335d31e06c3d6a0159" name = "github.com/stretchr/testify" packages = ["assert"] + pruneopts = "" revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" version = "v1.1.4" [[projects]] + digest = "1:e85837cb04b78f61688c6eba93ea9d14f60d611e2aaf8319999b1a60d2dafbfa" name = "github.com/urfave/cli" packages = ["."] + pruneopts = "" revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1" version = "v1.20.0" [[projects]] branch = "master" + digest = "1:f8e4d7d2ee6f5f8a2d0c006a57763552dc013d06925f239b8f3c3a7a1f398920" name = "golang.org/x/crypto" packages = ["ssh/terminal"] + pruneopts = "" revision = "3d37316aaa6bd9929127ac9a527abf408178ea7b" [[projects]] branch = "master" + digest = "1:18b2d59fab74b4110c5d1883e49f0effbc62a49556d51337b6761aa5585a17c7" name = "golang.org/x/net" packages = [ "context", - "context/ctxhttp" + "context/ctxhttp", ] + pruneopts = "" revision = "cd69bc3fc700721b709c3a59e16e24c67b58f6ff" [[projects]] branch = "master" + digest = "1:3607c401db83333983b982a42f9871b6836d67fcf42e26385abd2f9781e48e1b" name = "golang.org/x/oauth2" packages = [ ".", - "internal" + "internal", ] + pruneopts = "" revision = "bb50c06baba3d0c76f9d125c0719093e315b5b44" [[projects]] branch = "master" + digest = "1:929b300204c67806524f5b2e0bdf6d4f9ef1f58ac94f4ecaedd0a64d2ebf3cea" name = "golang.org/x/sys" packages = [ "unix", "windows", "windows/registry", - "windows/svc/eventlog" + "windows/svc/eventlog", ] + pruneopts = "" revision = "ef802241c90f84d84d644a2d8d0de8ee96038c9c" [[projects]] branch = "master" + digest = "1:1a863e444bd36de45a79da86a2e1120b4babdec695b1900dc62b7a67b61df400" name = "google.golang.org/api" packages = [ "gensupport", "googleapi", "googleapi/internal/uritemplates", - "oauth2/v1" + "oauth2/v1", ] + pruneopts = "" revision = "7afc123cf726cd2f253faa3e144d2ab65477b18f" [[projects]] + digest = "1:934fb8966f303ede63aa405e2c8d7f0a427a05ea8df335dfdc1833dd4d40756f" name = "google.golang.org/appengine" packages = [ "internal", @@ -169,20 +216,37 @@ "internal/log", "internal/remote_api", "internal/urlfetch", - "urlfetch" + "urlfetch", ] + pruneopts = "" revision = "150dc57a1b433e64154302bdc40b6bb8aefa313a" version = "v1.0.0" [[projects]] + digest = "1:15d017551627c8bb091bde628215b2861bed128855343fdd570c62d08871f6e1" name = "gopkg.in/alecthomas/kingpin.v2" packages = ["."] + pruneopts = "" revision = "947dcec5ba9c011838740e680966fd7087a71d0d" version = "v2.2.6" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "3d71267d24d7d430b97b9a06236e5a3384c94d07d46b2d071bd7f0cbd9f7ad21" + input-imports = [ + "github.com/burntsushi/toml", + "github.com/getsentry/raven-go", + "github.com/google/jsonapi", + "github.com/gorilla/mux", + "github.com/lib/pq", + "github.com/oklog/run", + "github.com/pkg/errors", + "github.com/prometheus/common/log", + "github.com/stretchr/testify/assert", + "github.com/urfave/cli", + "golang.org/x/net/context", + "golang.org/x/oauth2", + "google.golang.org/api/oauth2/v1", + ] solver-name = "gps-cdcl" solver-version = 1