diff --git a/bin/golangci-lint b/bin/golangci-lint new file mode 100755 index 0000000..ce66cb9 Binary files /dev/null and b/bin/golangci-lint differ diff --git a/cmd/root.go b/cmd/root.go index 66ccfda..edc4a4c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -1,3 +1,17 @@ +/* +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package cmd import ( @@ -8,8 +22,9 @@ import ( "syscall" "time" - "github.com/external-secrets/bitwarden-sdk-server/pkg/server" "github.com/spf13/cobra" + + "github.com/external-secrets/bitwarden-sdk-server/pkg/server" ) var ( diff --git a/main.go b/main.go index 37d0728..4074eb4 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,17 @@ +/* +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package main import ( diff --git a/pkg/server/server.go b/pkg/server/server.go index 35f24ba..cdca25e 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -1,8 +1,23 @@ +/* +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package server import ( "context" "net/http" + "time" "github.com/go-chi/chi" "github.com/go-chi/chi/middleware" @@ -38,7 +53,7 @@ func (s *Server) Run(_ context.Context) error { _, _ = w.Write([]byte("welcome")) }) - srv := &http.Server{Addr: s.Addr, Handler: r} + srv := &http.Server{Addr: s.Addr, Handler: r, ReadTimeout: 5 * time.Second} s.server = srv if s.Insecure {