Skip to content

Commit

Permalink
Merge pull request #48 from ibm-hyper-protect/cleue-update-contract
Browse files Browse the repository at this point in the history
fix: update to latest contract and adjust to glitches in fp-go
  • Loading branch information
CarstenLeue authored Sep 28, 2023
2 parents aa89045 + 06e0f57 commit 5b8639b
Show file tree
Hide file tree
Showing 13 changed files with 8,153 additions and 15 deletions.
2 changes: 1 addition & 1 deletion common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func ToTypeE[A any](data any) E.Either[error, A] {
return F.Pipe2(
data,
O.ToType[A],
E.FromOption[error, A](func() error {
E.FromOption[A](func() error {
return fmt.Errorf("invalid type of input [%T]", data)
}),
)
Expand Down
2 changes: 1 addition & 1 deletion contract/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func createEnvWorkloadSignature(signer func([]byte) func([]byte) E.Either[error,
// lookup the
return F.Pipe3(
seqE(getWorkloadO(contract), getEnvO(contract)),
E.FromOption[error, []byte](func() error {
E.FromOption[[]byte](func() error {
return fmt.Errorf("the contract is missing [%s] or [%s] or both", KeyEnv, KeyWorkload)
}),
E.Chain(sign),
Expand Down
2 changes: 1 addition & 1 deletion contract/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestUpsertEncrypted(t *testing.T) {
// validate that the key exists and that it is a token
getKeyE := F.Flow2(
R.Lookup[any](KeyEnv),
E.FromOption[error, any](func() error {
E.FromOption[any](func() error {
return fmt.Errorf("Key not found")
}),
)
Expand Down
4 changes: 2 additions & 2 deletions data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
_ "embed"
)

//go:embed ibm-hyper-protect-container-runtime-1-0-s390x-11-encrypt.crt
//go:embed ibm-hyper-protect-container-runtime-1-0-s390x-12-encrypt.crt
var DefaultCertificate string

//go:embed hpse-contract-schema-1.0.34.json
//go:embed hpse-contract-schema-1.0.42.json
var ContractSchema string
Loading

0 comments on commit 5b8639b

Please sign in to comment.