Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rekor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SafSec
rekor
Commits
74a26e6a
Unverified
Commit
74a26e6a
authored
4 years ago
by
dlorenc
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #114 from dlorenc/cors
Set a default CORS policy.
parents
422c62ab
6750e7a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
go.mod
+7
-10
7 additions, 10 deletions
go.mod
go.sum
+20
-63
20 additions, 63 deletions
go.sum
pkg/generated/restapi/configure_rekor_server.go
+4
-0
4 additions, 0 deletions
pkg/generated/restapi/configure_rekor_server.go
with
31 additions
and
73 deletions
go.mod
+
7
−
10
View file @
74a26e6a
...
...
@@ -7,6 +7,7 @@ require (
github.com/blang/semver
v3.5.1+incompatible
github.com/coreos/bbolt
v1.3.3 // indirect
github.com/coreos/etcd
v3.3.18+incompatible // indirect
github.com/fsnotify/fsnotify
v1.4.9 // indirect
github.com/ghodss/yaml
v1.0.0
github.com/go-chi/chi
v4.1.2+incompatible
github.com/go-openapi/errors
v0.19.9
...
...
@@ -16,38 +17,34 @@ require (
github.com/go-openapi/strfmt
v0.19.11
github.com/go-openapi/swag
v0.19.12
github.com/go-openapi/validate
v0.20.0
github.com/go-swagger/go-swagger
v0.25.1-0.20201206132650-7c73d972c8b9 // indirect
github.com/golang/protobuf
v1.4.3
github.com/google/certificate-transparency-go
v1.1.0 // indirect
github.com/google/go-cmp
v0.5.2
github.com/google/martian
v2.1.0+incompatible
github.com/google/trillian
v1.3.10
github.com/gorilla/handlers
v1.5.1 // indirect
github.com/jedisct1/go-minisign
v0.0.0-20210106175330-e54e81d562c7
github.com/jessevdk/go-flags
v1.4.0
github.com/kr/pretty
v0.2.1 // indirect
github.com/magiconair/properties
v1.8.4 // indirect
github.com/mitchellh/go-homedir
v1.1.0
github.com/mitchellh/mapstructure
v1.4.0
github.com/pelletier/go-toml
v1.8.1 // indirect
github.com/
prometheus/common
v0.10
.0
github.com/
rs/cors
v1.7
.0
github.com/spf13/afero
v1.5.0 // indirect
github.com/spf13/cast
v1.3.1 // indirect
github.com/spf13/cobra
v1.0.0
github.com/spf13/jwalterweatherman
v1.1.0 // indirect
github.com/spf13/pflag
v1.0.5
github.com/spf13/viper
v1.7.1
github.com/tidwall/
sjson
v1.
1
.2
github.com/tidwall/
pretty
v1.
0
.2
// indirect
github.com/urfave/negroni
v1.0.0
github.com/xeipuuv/gojsonschema
v1.2.0
go.etcd.io/etcd
v3.3.25+incompatible // indirect
go.uber.org/goleak
v1.1.10
go.uber.org/zap
v1.16.0
golang.org/x/crypto
v0.0.0-20201221181555-eec23a3978ad
golang.org/x/mod
v0.4.0 // indirect
golang.org/x/net
v0.0.0-20201207224615-747e23833adb
golang.org/x/oauth2
v0.0.0-20201109201403-9fd604954f58 // indirect
golang.org/x/sync
v0.0.0-20201020160332-67f06af15bc9
golang.org/x/sys
v0.0.0-20201207223542-d4d67f95c62d // indirect
golang.org/x/tools
v0.0.0-20201208062317-e652b2f42cc7 // indirect
google.golang.org/appengine
v1.6.7
google.golang.org/appengine
v1.6.7
// indirect
google.golang.org/genproto
v0.0.0-20200825200019-8632dd797987
google.golang.org/grpc
v1.32.0
gopkg.in/ini.v1
v1.62.0 // indirect
...
...
This diff is collapsed.
Click to expand it.
go.sum
+
20
−
63
View file @
74a26e6a
This diff is collapsed.
Click to expand it.
pkg/generated/restapi/configure_rekor_server.go
+
4
−
0
View file @
74a26e6a
...
...
@@ -25,6 +25,7 @@ import (
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/mitchellh/mapstructure"
"github.com/rs/cors"
pkgapi
"github.com/projectrekor/rekor/pkg/api"
"github.com/projectrekor/rekor/pkg/generated/restapi/operations"
...
...
@@ -117,6 +118,9 @@ func setupGlobalMiddleware(handler http.Handler) http.Handler {
returnHandler
=
middleware
.
Recoverer
(
returnHandler
)
returnHandler
=
middleware
.
Heartbeat
(
"/ping"
)(
returnHandler
)
handleCORS
:=
cors
.
Default
()
.
Handler
returnHandler
=
handleCORS
(
returnHandler
)
return
middleware
.
RequestID
(
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
ctx
:=
r
.
Context
()
r
=
r
.
WithContext
(
log
.
WithRequestID
(
ctx
,
middleware
.
GetReqID
(
ctx
)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment