Home / Docs / Configure a package

Trust a dependency adds: trust

What it does

A trusted module may declare policies, which release labeled data, such as secret text, to a lower label. That is trust: the checker cannot prove a release safe, so a person reviews it. A dependency's trusted modules are trusted in a program only when the package consents to them by name, with a trust line, and the lock records that consent for the dependency's whole content. Any change of the dependency's files, its trusted modules or the code they call, needs the consent again.

ita.unauna
ita shop
  version 0.1.0
  edition 0.4

needs
  privacy from path "deps/privacy"
    accept name

trust
  privacy modules keys
ita.lockuna
lock 1

solver
  encoding "una-smt-1"
  name "z3"
  version "5.1.0"
  logic "QF_UFLIA"
  steps 5000000
  seed 0

package privacy 1.0.0
  from path "deps/privacy"
  digest "sha256:3fe7550783d474c8fdee6cc550375b7d5906cda5d448f75a865524cce35e8526"
  consented "sha256:3fe7550783d474c8fdee6cc550375b7d5906cda5d448f75a865524cce35e8526"
  trusted modules keys
deps/privacy/ita.unauna
ita privacy
  version 1.0.0
  edition 0.4

trusted
  keys
deps/privacy/src/keys.unauna
trusted module keys

pub policy reveal
  from secret Text
  to Text
  via shown
  purpose "show a token"
  owner team

shown(t: secret Text) -> Text = t
src/shop.unauna
module shop

import privacy.keys (reveal)

pub show(t: secret Text) -> Text = reveal(t)

The release in privacy.keys is not a release into a boundary: its policy is declared in a module the package trusts.

Forms

text
trust
  <name> [<major>] [from <source>] modules <module path>, ...
    may <Capability>[<op>, ...]

Examples

A trusted module that no trust line names, or whose consent the lock does not record for the dependency's content as it is now, is U7012 at the need. The refusal and the review print the flag to copy, with the content digest of the package as it is now. The repair is to review the trusted modules and the code they run, then:

Terminal
$ una ita lock --accept-trust privacy@sha256:…
change privacy 1.0.0 (path deps/privacy): digest sha256:… -> sha256:…; may …; uses …
wrote ita.lock

Edge cases

Diagnostics

Edition

Edition 0.4 and later, a preview.

Normative source