Skip to content

Commit

Permalink
refactor(attestation): refactor recently moved getters
Browse files Browse the repository at this point in the history
These changes previously appeared in src/attestation.nim, which was
removed.
  • Loading branch information
ee7 committed Mar 28, 2024
1 parent fe97d3a commit 4f9a7c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/attestation_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ proc writeInToto(info: DockerInvocation,
raise newException(OSError, "could not write toto to file: " & getCurrentExceptionMsg())

let
log = $(chalkConfig.getUseTransparencyLog())
log = $(get[bool](chalkConfig, "use_transparency_log"))
args = @["attest", ("--tlog-upload=" & log), "--yes", "--key",
"chalk.key", "--type", "custom", "--predicate", path,
digestStr]
Expand Down Expand Up @@ -242,7 +242,7 @@ proc coreVerify(key: AttestationKey, chalk: ChalkObj): bool =
## Used both for validation, and for downloading just the signature
## after we've signed.
const fName = "chalk.pub"
let noTlog = not chalkConfig.getUseTransparencyLog()
let noTlog = not get[bool](chalkConfig, "use_transparency_log")

key.withCosignKey:
let
Expand Down Expand Up @@ -356,7 +356,7 @@ proc willSignNonContainer*(chalk: ChalkObj): string =
return ""

# We sign non-container artifacts if either condition is true.
if not (isSubscribedKey("SIGNATURE") or chalkConfig.getAlwaysTryToSign()):
if not (isSubscribedKey("SIGNATURE") or get[bool](chalkConfig, "always_try_to_sign")):
trace("File artifact signing not configured.")
return ""

Expand All @@ -374,7 +374,7 @@ proc willSignNonContainer*(chalk: ChalkObj): string =
proc signNonContainer*(chalk: ChalkObj, unchalkedMD, metadataMD : string):
string =
let
log = $(chalkConfig.getUseTransparencyLog())
log = $(get[bool](chalkConfig, "use_transparency_log"))
args = @["sign-blob", ("--tlog-upload=" & log), "--yes", "--key",
"chalk.key", "-"]
blob = unchalkedMD & metadataMD
Expand All @@ -394,7 +394,7 @@ proc cosignNonContainerVerify*(chalk: ChalkObj,
artHash, mdHash, sig, pk: string):
ValidateResult =
let
log = $(not chalkConfig.getUseTransparencyLog())
log = $(not get[bool](chalkConfig, "use_transparency_log"))
args = @["verify-blob",
"--insecure-ignore-tlog=" & log,
"--key=chalk.pub",
Expand Down

0 comments on commit 4f9a7c4

Please sign in to comment.