mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
Run make fmt with new goimports cmd
Signed-off-by: Patrick East <east.patrick@gmail.com>
This commit is contained in:
committed by
Torin Sandall
parent
29008ffffd
commit
b48c534722
+2
-1
@@ -17,8 +17,9 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/OneOfOne/xxhash"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
)
|
||||
|
||||
var errFindNotFound = fmt.Errorf("find: not found")
|
||||
|
||||
+2
-1
@@ -9,8 +9,9 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/open-policy-agent/opa/rego"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/open-policy-agent/opa/rego"
|
||||
)
|
||||
|
||||
var buildParams = struct {
|
||||
|
||||
+2
-1
@@ -9,10 +9,11 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/loader"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var checkParams = struct {
|
||||
|
||||
+3
-2
@@ -11,11 +11,12 @@ import (
|
||||
"github.com/open-policy-agent/opa/dependencies"
|
||||
"github.com/open-policy-agent/opa/internal/presentation"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/loader"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
type depsCommandParams struct {
|
||||
|
||||
+3
-2
@@ -13,6 +13,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/cover"
|
||||
fileurl "github.com/open-policy-agent/opa/internal/file/url"
|
||||
@@ -24,8 +27,6 @@ import (
|
||||
"github.com/open-policy-agent/opa/topdown"
|
||||
"github.com/open-policy-agent/opa/topdown/lineage"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
type evalCommandParams struct {
|
||||
|
||||
+2
-1
@@ -5,9 +5,10 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
func setMaxErrors(fs *pflag.FlagSet, errLimit *int) {
|
||||
|
||||
+2
-1
@@ -13,9 +13,10 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/open-policy-agent/opa/format"
|
||||
fileurl "github.com/open-policy-agent/opa/internal/file/url"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var fmtParams = struct {
|
||||
|
||||
+2
-1
@@ -9,10 +9,11 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/loader"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
+2
-1
@@ -18,12 +18,13 @@ import (
|
||||
"github.com/open-policy-agent/opa/storage"
|
||||
"github.com/open-policy-agent/opa/topdown/lineage"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/cover"
|
||||
"github.com/open-policy-agent/opa/tester"
|
||||
"github.com/open-policy-agent/opa/topdown"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
+2
-1
@@ -7,8 +7,9 @@ package cmd
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/open-policy-agent/opa/version"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/open-policy-agent/opa/version"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -12,11 +12,12 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/open-policy-agent/opa/bundle"
|
||||
"github.com/open-policy-agent/opa/plugins/rest"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -10,13 +10,14 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/internal/compiler/wasm/opa"
|
||||
"github.com/open-policy-agent/opa/internal/ir"
|
||||
"github.com/open-policy-agent/opa/internal/wasm/encoding"
|
||||
"github.com/open-policy-agent/opa/internal/wasm/instruction"
|
||||
"github.com/open-policy-agent/opa/internal/wasm/module"
|
||||
"github.com/open-policy-agent/opa/internal/wasm/types"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/olekukonko/tablewriter"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/cover"
|
||||
"github.com/open-policy-agent/opa/format"
|
||||
|
||||
@@ -11,9 +11,10 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/open-policy-agent/opa/metrics"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
|
||||
"github.com/open-policy-agent/opa/metrics"
|
||||
)
|
||||
|
||||
// Provider wraps a metrics.Metrics provider with a Prometheus registry that can
|
||||
|
||||
@@ -10,13 +10,14 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/internal/leb128"
|
||||
"github.com/open-policy-agent/opa/internal/wasm/constant"
|
||||
"github.com/open-policy-agent/opa/internal/wasm/instruction"
|
||||
"github.com/open-policy-agent/opa/internal/wasm/module"
|
||||
"github.com/open-policy-agent/opa/internal/wasm/opcode"
|
||||
"github.com/open-policy-agent/opa/internal/wasm/types"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// ReadModule reads a binary-encoded WASM module from r.
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
import "os"
|
||||
import "github.com/open-policy-agent/opa/cmd"
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/open-policy-agent/opa/cmd"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := cmd.RootCommand.Execute(); err != nil {
|
||||
|
||||
@@ -6,10 +6,11 @@ package bundle
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/open-policy-agent/opa/download"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/open-policy-agent/opa/download"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
)
|
||||
|
||||
// ParseConfig validates the config and injects default values. This is
|
||||
|
||||
@@ -6,8 +6,9 @@ package bundle
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gopkg.in/yaml.v2"
|
||||
"testing"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
func TestConfigValidation(t *testing.T) {
|
||||
|
||||
@@ -16,11 +16,12 @@ import (
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/open-policy-agent/opa/bundle"
|
||||
"github.com/open-policy-agent/opa/download"
|
||||
"github.com/open-policy-agent/opa/plugins"
|
||||
"github.com/open-policy-agent/opa/storage"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Plugin implements bundle activation.
|
||||
|
||||
@@ -7,9 +7,10 @@ package bundle
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/server/types"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -12,6 +12,8 @@ import (
|
||||
|
||||
"github.com/open-policy-agent/opa/metrics"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
bundleApi "github.com/open-policy-agent/opa/bundle"
|
||||
"github.com/open-policy-agent/opa/config"
|
||||
@@ -22,7 +24,6 @@ import (
|
||||
"github.com/open-policy-agent/opa/plugins/status"
|
||||
"github.com/open-policy-agent/opa/rego"
|
||||
"github.com/open-policy-agent/opa/storage/inmem"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Discovery implements configuration discovery for OPA. When discovery is
|
||||
|
||||
@@ -16,6 +16,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/plugins"
|
||||
"github.com/open-policy-agent/opa/plugins/rest"
|
||||
@@ -23,8 +26,6 @@ import (
|
||||
"github.com/open-policy-agent/opa/server"
|
||||
"github.com/open-policy-agent/opa/storage"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// Logger defines the interface for decision logging plugins.
|
||||
|
||||
@@ -10,12 +10,13 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/open-policy-agent/opa/internal/version"
|
||||
"io"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/open-policy-agent/opa/internal/version"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
|
||||
@@ -8,13 +8,14 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"github.com/open-policy-agent/opa/internal/version"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/open-policy-agent/opa/internal/version"
|
||||
)
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
|
||||
@@ -11,12 +11,13 @@ import (
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/open-policy-agent/opa/metrics"
|
||||
"github.com/open-policy-agent/opa/plugins"
|
||||
"github.com/open-policy-agent/opa/plugins/bundle"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// UpdateRequestV1 represents the status update message that OPA sends to
|
||||
|
||||
+2
-1
@@ -16,6 +16,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/peterh/liner"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/format"
|
||||
pr "github.com/open-policy-agent/opa/internal/presentation"
|
||||
@@ -25,7 +27,6 @@ import (
|
||||
"github.com/open-policy-agent/opa/storage"
|
||||
"github.com/open-policy-agent/opa/topdown"
|
||||
"github.com/open-policy-agent/opa/topdown/lineage"
|
||||
"github.com/peterh/liner"
|
||||
)
|
||||
|
||||
// REPL represents an instance of the interactive shell.
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/ghodss/yaml"
|
||||
|
||||
"github.com/open-policy-agent/opa/internal/strvals"
|
||||
)
|
||||
|
||||
|
||||
+2
-1
@@ -20,8 +20,9 @@ import (
|
||||
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/open-policy-agent/opa/server/types"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/open-policy-agent/opa/server/types"
|
||||
)
|
||||
|
||||
func loggingEnabled(level logrus.Level) bool {
|
||||
|
||||
+4
-3
@@ -20,6 +20,10 @@ import (
|
||||
|
||||
"github.com/open-policy-agent/opa/bundle"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"gopkg.in/fsnotify.v1"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/internal/prometheus"
|
||||
"github.com/open-policy-agent/opa/internal/runtime"
|
||||
@@ -34,9 +38,6 @@ import (
|
||||
"github.com/open-policy-agent/opa/storage"
|
||||
"github.com/open-policy-agent/opa/storage/inmem"
|
||||
"github.com/open-policy-agent/opa/version"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"gopkg.in/fsnotify.v1"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
+2
-1
@@ -26,6 +26,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/bundle"
|
||||
"github.com/open-policy-agent/opa/metrics"
|
||||
@@ -42,7 +44,6 @@ import (
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/open-policy-agent/opa/version"
|
||||
"github.com/open-policy-agent/opa/watch"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// AuthenticationScheme enumerates the supported authentication schemes. The
|
||||
|
||||
@@ -24,6 +24,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/bundle"
|
||||
"github.com/open-policy-agent/opa/metrics"
|
||||
@@ -36,7 +38,6 @@ import (
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/open-policy-agent/opa/util/test"
|
||||
"github.com/open-policy-agent/opa/version"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type tr struct {
|
||||
|
||||
+2
-1
@@ -19,9 +19,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/open-policy-agent/opa/runtime"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -17,10 +17,11 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/open-policy-agent/opa/rego"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/open-policy-agent/opa/rego"
|
||||
"github.com/open-policy-agent/opa/util"
|
||||
)
|
||||
|
||||
type params struct {
|
||||
|
||||
+4
-2
@@ -4,8 +4,10 @@
|
||||
|
||||
package topdown
|
||||
|
||||
import "github.com/open-policy-agent/opa/ast"
|
||||
import "github.com/open-policy-agent/opa/topdown/builtins"
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"github.com/open-policy-agent/opa/topdown/builtins"
|
||||
)
|
||||
|
||||
func builtinBinaryAnd(a ast.Value, b ast.Value) (ast.Value, error) {
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@ package topdown
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
"testing"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
)
|
||||
|
||||
func TestToArray(t *testing.T) {
|
||||
|
||||
+2
-1
@@ -9,11 +9,12 @@ import (
|
||||
"crypto/tls"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/open-policy-agent/opa/internal/version"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
|
||||
"github.com/open-policy-agent/opa/internal/version"
|
||||
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"crypto/x509"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/open-policy-agent/opa/internal/version"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
@@ -18,6 +17,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/open-policy-agent/opa/internal/version"
|
||||
|
||||
"github.com/open-policy-agent/opa/ast"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package jwa
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// KeyType represents the key type ("kty") that are supported
|
||||
|
||||
@@ -2,6 +2,7 @@ package jwa
|
||||
|
||||
import (
|
||||
"crypto/elliptic"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/buffer"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package jwa
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// SignatureAlgorithm represents the various signature algorithms as described in https://tools.ietf.org/html/rfc7518#section-3.1
|
||||
|
||||
@@ -5,8 +5,9 @@ import (
|
||||
"crypto/elliptic"
|
||||
"math/big"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
func newECDSAPublicKey(key *ecdsa.PublicKey) (*ECDSAPublicKey, error) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package jwk
|
||||
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
// Convenience constants for common JWK parameters
|
||||
|
||||
@@ -3,6 +3,7 @@ package jwk
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"crypto/rsa"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@ import (
|
||||
"crypto/rsa"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
// GetPublicKey returns the public key based on the private key type.
|
||||
|
||||
@@ -3,6 +3,7 @@ package jwk
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@ import (
|
||||
"crypto/rsa"
|
||||
"math/big"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
func newRSAPublicKey(key *rsa.PublicKey) (*RSAPublicKey, error) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package jwk
|
||||
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
func newSymmetricKey(key []byte) (*SymmetricKey, error) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package jws
|
||||
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
// Constants for JWS Common parameters
|
||||
|
||||
@@ -23,11 +23,12 @@ import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwk"
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jws/sign"
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jws/verify"
|
||||
"strings"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"crypto"
|
||||
"crypto/ecdsa"
|
||||
"crypto/rand"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package sign
|
||||
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"testing"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
func TestECDSASign(t *testing.T) {
|
||||
|
||||
@@ -4,9 +4,10 @@ import (
|
||||
"crypto/hmac"
|
||||
"crypto/sha256"
|
||||
"crypto/sha512"
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"hash"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package sign
|
||||
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"testing"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
func TestHMACSign(t *testing.T) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package sign
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"crypto/rsa"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"crypto"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package sign
|
||||
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
// New creates a signer that signs payloads using the given signature algorithm.
|
||||
|
||||
@@ -5,8 +5,9 @@ import (
|
||||
"crypto/ecdsa"
|
||||
"math/big"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
var ecdsaVerifyFuncs = map[jwa.SignatureAlgorithm]ecdsaVerifyFunc{}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package verify
|
||||
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"testing"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
func TestECDSAVerify(t *testing.T) {
|
||||
|
||||
@@ -2,9 +2,11 @@ package verify
|
||||
|
||||
import (
|
||||
"crypto/hmac"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jws/sign"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func newHMAC(alg jwa.SignatureAlgorithm) (*HMACVerifier, error) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package verify
|
||||
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"testing"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
func TestHMACVerify(t *testing.T) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package verify
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"crypto/rsa"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jws/sign"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package verify
|
||||
import (
|
||||
"crypto"
|
||||
"crypto/rsa"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package verify
|
||||
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"testing"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
func TestRSAVerify(t *testing.T) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package verify
|
||||
|
||||
import (
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/open-policy-agent/opa/topdown/internal/jwx/jwa"
|
||||
)
|
||||
|
||||
// New creates a new JWS verifier using the specified algorithm
|
||||
|
||||
+4
-2
@@ -4,8 +4,10 @@
|
||||
|
||||
package util
|
||||
|
||||
import "fmt"
|
||||
import "strings"
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// T is a concise way to refer to T.
|
||||
type T interface{}
|
||||
|
||||
Reference in New Issue
Block a user