Skip to content

Commit d401144

Browse files
authored
Remove proof mechanism (#90)
Code now uses whatever proof mechanism that is supported by the backend. AB#9189
1 parent a6d043e commit d401144

7 files changed

Lines changed: 4 additions & 27 deletions

File tree

DEVELOPERS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export TEST_ARCHIVIST="https://app.datatrails.ai"
3939
export TEST_AUTHTOKEN_FILENAME=credentials/.auth_token
4040
export TEST_NAMESPACE="unique label"
4141
export TEST_VERBOSE=-v
42-
export TEST_PROOF_MECHANISM="-i SIMPLE_HASH"
4342
```
4443

4544
If TEST_VERBOSE is "-v" debugging output will appear when running the tests.

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,17 @@ export TEST_ARCHIVIST="https://app.datatrails.ai"
3434
export TEST_AUTHTOKEN_FILENAME=credentials/.auth_token
3535
export TEST_NAMESPACE="unique label"
3636
export TEST_VERBOSE=-v
37-
export TEST_PROOF_MECHANISM="--proof-mechanism=SIMPLE_HASH"
3837
```
3938

4039
If TEST_VERBOSE is "-v" debugging output will appear when running the examples. Otherwise leave blank or undefined.
4140

42-
TEST_PROOF_MECHANISM should be "KHIPU" or "SIMPLE_HASH". If unspecified the default is "SIMPLE_HASH"
43-
4441
Windows using Powershell - at the command prompt set values for environment variables:
4542

4643
```bash
4744
$Env:TEST_ARCHIVIST="https://app.datatrails.ai"
4845
$Env:TEST_AUTHTOKEN_FILENAME = '<path of token location>'
4946
$Env:TEST_NAMESPACE = Get-Date -UFormat %s
5047
$Env:TEST_VERBOSE = '-v'
51-
$Env:TEST_PROOF_MECHANISM="--proof-mechanism=SIMPLE_HASH"
5248
```
5349

5450
TEST_NAMESPACE is set to the date and time value in Unix format, thus providing a unique id upon execution.
@@ -73,7 +69,7 @@ Events are created every execution of an example - currently no check is done if
7369
All examples use a common set of arguments:
7470

7571
```bash
76-
export AUTH="-u $TEST_ARCHIVIST -t $TEST_AUTHTOKEN_FILENAME $TEST_VERBOSE $TEST_PROOF_MECHANISM"
72+
export AUTH="-u $TEST_ARCHIVIST -t $TEST_AUTHTOKEN_FILENAME $TEST_VERBOSE"
7773
export ARGS="$AUTH --namespace $TEST_NAMESPACE"
7874
```
7975

archivist_samples/sample_scripts/c2pa/c2pa_verify.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
from archivist.logger import set_logger
1717
from archivist.archivist import Archivist
18-
from archivist.proof_mechanism import ProofMechanism
1918
from archivist.utils import get_auth
2019

2120
import time

archivist_samples/testing/archivist_parser.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
from archivist.archivist import Archivist
1717
from archivist.logger import set_logger
18-
from archivist.proof_mechanism import ProofMechanism
1918

2019
LOGGER = logging.getLogger(__name__)
2120

@@ -72,16 +71,6 @@ def common_parser(description):
7271
default="https://app.datatrails.ai",
7372
help="url of Archivist service",
7473
)
75-
parser.add_argument(
76-
"-p",
77-
"--proof-mechanism",
78-
type=ProofMechanism,
79-
action=EnumAction,
80-
dest="proof_mechanism",
81-
default=ProofMechanism.SIMPLE_HASH,
82-
help="mechanism for proving the evidence for events on the Asset",
83-
)
84-
8574
parser.add_argument(
8675
"-t",
8776
"--auth-token",
@@ -104,17 +93,12 @@ def endpoint(args):
10493

10594
arch = None
10695
LOGGER.info("Initialising connection to DataTrails...")
107-
fixtures = {
108-
"assets": {
109-
"proof_mechanism": args.proof_mechanism.name,
110-
},
111-
}
11296

11397
if args.auth_token_file:
11498
with open(args.auth_token_file, mode="r", encoding="utf-8") as tokenfile:
11599
authtoken = tokenfile.read().strip()
116100

117-
arch = Archivist(args.url, authtoken, fixtures=fixtures)
101+
arch = Archivist(args.url, authtoken)
118102

119103
if arch is None:
120104
LOGGER.error("Critical error. Aborting.")

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ pyyaml~=6.0.1
77
# the following lines. Also do similar in the Dockerfile.
88
# That way one can test an unreleased version of github datatrails-samples.
99
# NB dont forget to uncomment before merging !!
10-
datatrails-archivist==0.30.0
10+
datatrails-archivist==0.31.0

scripts/api.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ docker run \
1717
-e TEST_NAMESPACE \
1818
-e TEST_SELECTOR \
1919
-e TEST_VERBOSE \
20-
-e TEST_PROOF_MECHANISM \
2120
-e GITHUB_REF \
2221
-e TWINE_USERNAME \
2322
-e TWINE_PASSWORD \

scripts/samples.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ do
8383
done
8484

8585
export PYTHONWARNINGS="ignore:Unverified HTTPS request"
86-
ARGS="-u $TEST_ARCHIVIST -t $TEST_AUTHTOKEN_FILENAME $TEST_VERBOSE $TEST_PROOF_MECHANISM"
86+
ARGS="-u $TEST_ARCHIVIST -t $TEST_AUTHTOKEN_FILENAME $TEST_VERBOSE"
8787

8888
# namespacing ensures that each run of the tests is independent.
8989
if [ -n "$TEST_NAMESPACE" ]

0 commit comments

Comments
 (0)