Files
SpacetimeDB/test/tests/reverse-dns.sh
T
Phoebe Goldman a1e9984840 Multiple server configurations for CLI (#214)
Alters the CLI's configuration format to support storing multiple server configurations,
and having each server configuration store an (optional) default identity.
Many CLI commands take an additional -s argument, the server on which to operate,
which defaults to the configured default_server.
Using -s consistently requires renaming the publish skip-clippy short flag to -S.

Per discussion with @jdetter , this PR does not directly associate identities with servers.
Instead, each server configuration stores the server's "fingerprint" (i.e. PEM-formatted ECDSA public key),
and the CLI uses that public key to decode tokens to determine if they apply to a given server.
This architecture allows the CLI to behave reasonably
when multiple server configurations use the same set of tokens,
e.g. if multiple distinct URLs resolve to the same SpacetimeDB instance.
For example, one could imagine a configuration with server configurations for both http://127.0.0.1:3000
and http://localhost:3000, which should use the same set of identities.
2023-09-01 17:29:20 +00:00

24 lines
569 B
Bash

#!/bin/bash
if [ "$DESCRIBE_TEST" = 1 ] ; then
echo "This tests the functionality of spacetime reverse dns lookups."
exit
fi
set -euox pipefail
source "./test/lib.include"
RAND=$(random_string)
run_test cargo run dns register-tld "$RAND"
run_test cargo run publish -S -d "$RAND" --project-path "$PROJECT_PATH" --clear-database
ADDRESS="$(grep "reated new database" "$TEST_OUT" | awk 'NF>1{print $NF}')"
if [ "$ADDRESS" == "" ] ; then
exit 1
fi
run_test cargo run dns reverse-lookup "$ADDRESS"
if [ "$RAND" != "$(tail -n 1 $TEST_OUT)" ] ; then
exit 1
fi