Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Initial fixes #13

Merged
merged 2 commits into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help clean build fmt lint vet run test cover style cyclo
.PHONY: default clean build fmt lint vet cyclo ineffassign shellcheck errcheck goconst gosec abcgo style run test cover integration_tests rest_api_tests license before_commit help

SOURCES:=$(shell find . -name '*.go')

Expand Down Expand Up @@ -31,7 +31,7 @@ ineffassign: ## Run ineffassign checker
./ineffassign.sh

shellcheck: ## Run shellcheck
shellcheck *.sh
shellcheck $(shell find . -name "*.sh")

errcheck: ## Run errcheck
@echo "Running errcheck"
Expand Down
2 changes: 0 additions & 2 deletions abcgo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

threshold=45

RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
BLUE=$(tput setaf 4)
RED_BG=$(tput setab 1)
GREEN_BG=$(tput setab 2)
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

# this is improper - we need to start using tags in GitHub properly
version=0.5
version=0.1

buildtime=$(date)
branch=$(git rev-parse --abbrev-ref HEAD)
Expand Down
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ require (
github.com/BurntSushi/toml v0.3.1
github.com/RedHatInsights/insights-operator-utils v0.0.0-20200430065955-b0b675035360
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/droptheplot/abcgo v0.0.0-20171120220436-23529565504c // indirect
github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf // indirect
github.com/kisielk/errcheck v1.2.0 // indirect
github.com/rs/zerolog v1.18.0
github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989 // indirect
github.com/spf13/viper v1.6.3
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
)
57 changes: 57 additions & 0 deletions go.sum

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions gosec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ NC=$(tput sgr0) # No Color

GO_SEC_ARGS=""

VERBOSE=false
if [[ $* == *verbose* ]]; then
VERBOSE=true
fi

if [[ $* != *verbose* ]]; then
GO_SEC_ARGS="-quiet"
fi
Expand Down
3 changes: 3 additions & 0 deletions server/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ type Configuration struct {
Address string `mapstructure:"address" toml:"address"`
APIPrefix string `mapstructure:"api_prefix" toml:"api_prefix"`
APISpecFile string `mapstructure:"api_spec_file" toml:"api_spec_file"`
Debug bool `mapstructure:"debug" toml:"debug"`
Auth bool `mapstructure:"auth" toml:"auth"`
AuthType string `mapstructure:"auth_type" toml:"auth_type"`
}
10 changes: 10 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ limitations under the License.
// Insights content service. In current version, the following
// REST API endpoints are available:
package server

import (
"net/http"
)

// HTTPServer in an implementation of Server interface
type HTTPServer struct {
Config Configuration
Serv *http.Server
}