auth: OpenID/OAUth2 middleware

2 configurations for the listeners are now possible:
- enableJWT=false with client ssl auth
- enableJWT=true with https

Actual verification of the tokens is handled by
https://github.com/openshift-online/ocm-sdk-go.

An authentication handler is run as the top level handler, before any
routing is done. Routes which do not require authentication should be
listed as exceptions.

Authentication can be restricted using an ACL file which allows
filtering based on JWT claims. For more information see the inline
comments in ocm-sdk/authentication.

As an added quirk the `-v` flag for the osbuild-composer executable was
changed to `-verbose` to avoid flag collision with glog which declares
the `-v` flag in the package `init()` function. The ocm-sdk depends on
glog and pulls it in.
This commit is contained in:
sanne 2021-08-05 16:56:10 +02:00 committed by Tom Gundersen
parent 58613788bc
commit 4a057bf3d5
192 changed files with 25042 additions and 110 deletions

24
vendor/modules.txt vendored
View file

@ -103,6 +103,8 @@ github.com/aws/aws-sdk-go/service/sts
github.com/aws/aws-sdk-go/service/sts/stsiface
# github.com/beorn7/perks v1.0.1
github.com/beorn7/perks/quantile
# github.com/cenkalti/backoff/v4 v4.0.0
github.com/cenkalti/backoff/v4
# github.com/cespare/xxhash/v2 v2.1.1
github.com/cespare/xxhash/v2
# github.com/coreos/go-semver v0.3.0
@ -141,6 +143,11 @@ github.com/gobwas/glob/syntax/ast
github.com/gobwas/glob/syntax/lexer
github.com/gobwas/glob/util/runes
github.com/gobwas/glob/util/strings
# github.com/golang-jwt/jwt v3.2.0+incompatible
## explicit
github.com/golang-jwt/jwt
# github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/glog
# github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
github.com/golang/groupcache/lru
# github.com/golang/protobuf v1.5.2
@ -178,6 +185,8 @@ github.com/gophercloud/gophercloud/openstack/imageservice/v2/imagedata
github.com/gophercloud/gophercloud/openstack/imageservice/v2/images
github.com/gophercloud/gophercloud/openstack/utils
github.com/gophercloud/gophercloud/pagination
# github.com/grokify/html-strip-tags-go v0.0.0-20200322061010-ea0c1cf2f119
github.com/grokify/html-strip-tags-go
# github.com/jackc/chunkreader/v2 v2.0.1
github.com/jackc/chunkreader/v2
# github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530
@ -204,6 +213,8 @@ github.com/jackc/pgx/v4/pgxpool
github.com/jackc/puddle
# github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af
github.com/jmespath/go-jmespath
# github.com/json-iterator/go v1.1.10
github.com/json-iterator/go
# github.com/jstemmer/go-junit-report v0.9.1
github.com/jstemmer/go-junit-report
github.com/jstemmer/go-junit-report/formatter
@ -234,6 +245,17 @@ github.com/mattn/go-isatty
github.com/matttproud/golang_protobuf_extensions/pbutil
# github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/go-homedir
# github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/concurrent
# github.com/modern-go/reflect2 v1.0.1
github.com/modern-go/reflect2
# github.com/openshift-online/ocm-sdk-go v0.1.198
## explicit
github.com/openshift-online/ocm-sdk-go/authentication
github.com/openshift-online/ocm-sdk-go/errors
github.com/openshift-online/ocm-sdk-go/helpers
github.com/openshift-online/ocm-sdk-go/internal
github.com/openshift-online/ocm-sdk-go/logging
# github.com/pkg/errors v0.9.1
github.com/pkg/errors
# github.com/pmezard/go-difflib v1.0.0
@ -525,5 +547,5 @@ google.golang.org/protobuf/types/pluginpb
gopkg.in/ini.v1
# gopkg.in/yaml.v2 v2.3.0
gopkg.in/yaml.v2
# gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
# gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
gopkg.in/yaml.v3