nuts-foundation/hashicorp-vault-proxy

View on GitHub

Showing 17 of 17 total issues

Function main has 62 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func main() {
    logFormat := os.Getenv("LOG_FORMAT")
    switch logFormat {
    case "json":
        logrus.SetFormatter(&logrus.JSONFormatter{})
Severity: Minor
Found in main.go - About 1 hr to fix

    Method Wrapper.StoreSecret has 5 return statements (exceeds 4 allowed).
    Open

    func (w Wrapper) StoreSecret(ctx context.Context, request StoreSecretRequestObject) (StoreSecretResponseObject, error) {
        if request.Body.Secret == "" {
            return StoreSecret400JSONResponse(ErrorResponse{
                Backend: backend,
                Detail:  "Secret is required",
    Severity: Major
    Found in api/v1/api.go - About 35 mins to fix

      Method KVStorage.getValue has 5 return statements (exceeds 4 allowed).
      Open

      func (v KVStorage) getValue(path, key string) ([]byte, error) {
          result, err := v.client.Read(path)
          if err != nil {
              return nil, fmt.Errorf("unable to read key from vault: %w", err)
          }
      Severity: Major
      Found in vault/kv.go - About 35 mins to fix

        exported method Wrapper.DeleteSecret should have comment or be unexported
        Open

        func (w Wrapper) DeleteSecret(ctx context.Context, request DeleteSecretRequestObject) (DeleteSecretResponseObject, error) {
        Severity: Minor
        Found in api/v1/api.go by golint

        exported method Wrapper.ListKeys should have comment or be unexported
        Open

        func (w Wrapper) ListKeys(ctx context.Context, request ListKeysRequestObject) (ListKeysResponseObject, error) {
        Severity: Minor
        Found in api/v1/api.go by golint

        exported method KVStorage.GetSecret should have comment or be unexported
        Open

        func (v KVStorage) GetSecret(key string) ([]byte, error) {
        Severity: Minor
        Found in vault/kv.go by golint

        exported method Wrapper.LookupSecret should have comment or be unexported
        Open

        func (w Wrapper) LookupSecret(ctx context.Context, request LookupSecretRequestObject) (LookupSecretResponseObject, error) {
        Severity: Minor
        Found in api/v1/api.go by golint

        exported var ErrKeyAlreadyExists should have comment or be unexported
        Open

        var ErrKeyAlreadyExists = errors.New("key already exists")
        Severity: Minor
        Found in vault/types.go by golint

        exported type Wrapper should have comment or be unexported
        Open

        type Wrapper struct {
        Severity: Minor
        Found in api/v1/api.go by golint

        exported type KVStorage should have comment or be unexported
        Open

        type KVStorage struct {
        Severity: Minor
        Found in vault/kv.go by golint

        exported method Wrapper.StoreSecret should have comment or be unexported
        Open

        func (w Wrapper) StoreSecret(ctx context.Context, request StoreSecretRequestObject) (StoreSecretResponseObject, error) {
        Severity: Minor
        Found in api/v1/api.go by golint

        2: cannot find package "github.com/nuts-foundation/hashicorp-vault-proxy/vault" in any of:
        Open

            "github.com/nuts-foundation/hashicorp-vault-proxy/vault"
        Severity: Minor
        Found in api/v1/api.go by govet

        exported method KVStorage.Ping should have comment or be unexported
        Open

        func (v KVStorage) Ping() error {
        Severity: Minor
        Found in vault/kv.go by golint

        exported method Wrapper.HealthCheck should have comment or be unexported
        Open

        func (w Wrapper) HealthCheck(ctx context.Context, _ HealthCheckRequestObject) (HealthCheckResponseObject, error) {
        Severity: Minor
        Found in api/v1/api.go by golint

        exported method KVStorage.DeleteSecret should have comment or be unexported
        Open

        func (v KVStorage) DeleteSecret(key string) error {
        Severity: Minor
        Found in vault/kv.go by golint

        exported function NewWrapper should have comment or be unexported
        Open

        func NewWrapper(vault vault.Storage) Wrapper {
        Severity: Minor
        Found in api/v1/api.go by golint

        exported method KVStorage.StoreSecret should have comment or be unexported
        Open

        func (v KVStorage) StoreSecret(key string, value []byte) error {
        Severity: Minor
        Found in vault/kv.go by golint
        Severity
        Category
        Status
        Source
        Language