mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 18:36:30 +02:00
evaluator: use cryputil to hash (#2384)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
c7a8f11d9a
commit
aa0e6872de
1 changed files with 2 additions and 7 deletions
|
@ -2,8 +2,6 @@ package evaluator
|
|||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
@ -15,6 +13,7 @@ import (
|
|||
"github.com/pomerium/pomerium/config"
|
||||
"github.com/pomerium/pomerium/internal/log"
|
||||
"github.com/pomerium/pomerium/internal/telemetry/trace"
|
||||
"github.com/pomerium/pomerium/pkg/cryptutil"
|
||||
"github.com/pomerium/pomerium/pkg/policy"
|
||||
)
|
||||
|
||||
|
@ -116,13 +115,9 @@ func NewPolicyEvaluator(ctx context.Context, store *Store, configPolicy *config.
|
|||
return nil, err
|
||||
}
|
||||
|
||||
h := sha256.New()
|
||||
h.Write([]byte(script))
|
||||
checksum := hex.EncodeToString(h.Sum(nil))
|
||||
|
||||
e.queries = append(e.queries, policyQuery{
|
||||
PreparedEvalQuery: q,
|
||||
checksum: checksum,
|
||||
checksum: fmt.Sprintf("%x", cryptutil.Hash("script", []byte(script))),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue