mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
a179a24c48
All packages, except for `cmd` and `internal`, have been moved into a new `v1` root package. Old packages are kept for backwards-compatibility reasons. All contained code is replaced with simple type aliases and proxy functions to `v1` implementations. Old packages default to the Rego v0 syntax, new `v1` packages default to the Rego v1 syntax. Signed-off-by: Johan Fylling <johan.dev@fylling.se>
33 lines
954 B
Go
33 lines
954 B
Go
// Copyright 2020 The OPA Authors. All rights reserved.
|
|
// Use of this source code is governed by an Apache2
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package bundle
|
|
|
|
import (
|
|
v1 "github.com/open-policy-agent/opa/v1/bundle"
|
|
)
|
|
|
|
// HashingAlgorithm represents a subset of hashing algorithms implemented in Go
|
|
type HashingAlgorithm = v1.HashingAlgorithm
|
|
|
|
// Supported values for HashingAlgorithm
|
|
const (
|
|
MD5 = v1.MD5
|
|
SHA1 = v1.SHA1
|
|
SHA224 = v1.SHA224
|
|
SHA256 = v1.SHA256
|
|
SHA384 = v1.SHA384
|
|
SHA512 = v1.SHA512
|
|
SHA512224 = v1.SHA512224
|
|
SHA512256 = v1.SHA512256
|
|
)
|
|
|
|
// SignatureHasher computes a signature digest for a file with (structured or unstructured) data and policy
|
|
type SignatureHasher = v1.SignatureHasher
|
|
|
|
// NewSignatureHasher returns a signature hasher suitable for a particular hashing algorithm
|
|
func NewSignatureHasher(alg HashingAlgorithm) (SignatureHasher, error) {
|
|
return v1.NewSignatureHasher(alg)
|
|
}
|