Skip to content

Commit

Permalink
Merge pull request #2 from spiffe/ovolkan/hack
Browse files Browse the repository at this point in the history
Removed logger for additional decoupling
  • Loading branch information
v0lkan authored Oct 25, 2024
2 parents 6881805 + 3bb6833 commit 0f0347f
Show file tree
Hide file tree
Showing 33 changed files with 97 additions and 251 deletions.
21 changes: 0 additions & 21 deletions core/crypto/crypto.go

This file was deleted.

40 changes: 0 additions & 40 deletions core/log/level/level.go

This file was deleted.

20 changes: 0 additions & 20 deletions core/log/std/log.go

This file was deleted.

40 changes: 0 additions & 40 deletions core/log/std/print.go

This file was deleted.

7 changes: 7 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package config

type Config struct {
Debug bool
}

var SdkConfig Config = Config{false}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/key"
tpl "github.com/spiffe/vsecm-sdk-go/internal/core/template"
"strings"
"text/template"

"github.com/spiffe/vsecm-sdk-go/core/constants/key"
tpl "github.com/spiffe/vsecm-sdk-go/core/template"
)

// convertMapToStringBytes converts a map[string]string into a map[string][]byte,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

package data

import "github.com/spiffe/vsecm-sdk-go/lib/entity"
import (
"github.com/spiffe/vsecm-sdk-go/internal/lib/entity"
)

// SecretFormat represents the format of the secret.
type SecretFormat string
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
package safe

import (
"github.com/spiffe/vsecm-sdk-go/core/constants/crypto"
"github.com/spiffe/vsecm-sdk-go/core/entity/v1/data"
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/crypto"
data2 "github.com/spiffe/vsecm-sdk-go/internal/core/entity/v1/data"
)

// SecretUpsertRequest is the request to upsert a secret.
type SecretUpsertRequest struct {
WorkloadIds []string `json:"workloads"`
Namespaces []string `json:"namespaces"`
Value string `json:"value"`
Template string `json:"template"`
Format data.SecretFormat `json:"format"`
Encrypt bool `json:"encrypt"`
NotBefore string `json:"notBefore"`
Expires string `json:"expires"`
WorkloadIds []string `json:"workloads"`
Namespaces []string `json:"namespaces"`
Value string `json:"value"`
Template string `json:"template"`
Format data2.SecretFormat `json:"format"`
Encrypt bool `json:"encrypt"`
NotBefore string `json:"notBefore"`
Expires string `json:"expires"`

Err string `json:"err,omitempty"`
}
Expand Down Expand Up @@ -81,16 +81,16 @@ type SecretListRequest struct {

// SecretListResponse is the response to a SecretListRequest.
type SecretListResponse struct {
Secrets []data.Secret `json:"secrets"`
Err string `json:"err,omitempty"`
Secrets []data2.Secret `json:"secrets"`
Err string `json:"err,omitempty"`
}

// SecretEncryptedListResponse is the response that lists secrets
// The secret values will be encrypted.
type SecretEncryptedListResponse struct {
Secrets []data.SecretEncrypted `json:"secrets"`
Algorithm crypto.Algorithm `json:"algorithm"`
Err string `json:"err,omitempty"`
Secrets []data2.SecretEncrypted `json:"secrets"`
Algorithm crypto.Algorithm `json:"algorithm"`
Err string `json:"err,omitempty"`
}

// KeystoneStatusRequest is the request to check the status of
Expand All @@ -101,8 +101,8 @@ type KeystoneStatusRequest struct {

// KeystoneStatusResponse is the response to a KeystoneStatusRequest.
type KeystoneStatusResponse struct {
Status data.InitStatus `json:"status"`
Err string `json:"err,omitempty"`
Status data2.InitStatus `json:"status"`
Err string `json:"err,omitempty"`
}

// GenericRequest is the request for generic operations.
Expand Down
2 changes: 1 addition & 1 deletion core/env/endpoint.go → internal/core/env/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package env

import (
"github.com/spiffe/vsecm-sdk-go/core/constants/env"
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/env"
)

// EndpointUrlForSafe returns the URL for the VSecM Safe endpoint
Expand Down
3 changes: 1 addition & 2 deletions core/env/init.go → internal/core/env/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
package env

import (
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/env"
"strconv"
"time"

"github.com/spiffe/vsecm-sdk-go/core/constants/env"
)

// PollIntervalForInitContainer returns the time interval between each poll in the
Expand Down
3 changes: 1 addition & 2 deletions core/env/logging.go → internal/core/env/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
package env

import (
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/env"
"strconv"

"github.com/spiffe/vsecm-sdk-go/core/constants/env"
)

type Level int
Expand Down
3 changes: 1 addition & 2 deletions core/env/poll.go → internal/core/env/poll.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
package env

import (
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/env"
"strconv"
"time"

"github.com/spiffe/vsecm-sdk-go/core/constants/env"
)

// PollIntervalForSidecar returns the polling interval for sentry in time.Duration
Expand Down
2 changes: 1 addition & 1 deletion core/env/sidecar.go → internal/core/env/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package env

import (
"github.com/spiffe/vsecm-sdk-go/core/constants/env"
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/env"
)

// SecretsPathForSidecar returns the path to the secrets file used by the sidecar.
Expand Down
2 changes: 1 addition & 1 deletion core/env/spiffe.go → internal/core/env/spiffe.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package env

import (
"github.com/spiffe/vsecm-sdk-go/core/constants/env"
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/env"
)

// SpiffeSocketUrl returns the URL for the SPIFFE endpoint socket used in the
Expand Down
2 changes: 1 addition & 1 deletion core/env/spiffeid.go → internal/core/env/spiffeid.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
package env

import (
"github.com/spiffe/vsecm-sdk-go/core/constants/env"
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/env"
)

// SpiffeIdPrefixForSafe returns the prefix for the Safe SPIFFE ID.
Expand Down
5 changes: 2 additions & 3 deletions core/template/filter.go → internal/core/template/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
package template

import (
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/symbol"
"github.com/spiffe/vsecm-sdk-go/internal/core/constants/val"
"strings"

"github.com/spiffe/vsecm-sdk-go/core/constants/symbol"
"github.com/spiffe/vsecm-sdk-go/core/constants/val"
)

// removeKeyValueWithNoValue takes an input string containing key-value pairs
Expand Down
File renamed without changes.
Loading

0 comments on commit 0f0347f

Please sign in to comment.