Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions bin/genkeys
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ if [ ! -f $site_path/cloud_iot_config.json ]; then
false
fi

registry_id=$(jq -r .registry_id $site_path/cloud_iot_config.json)

metadatas=`find ${site_path%/}/devices -name metadata.json`

for metadata in $metadatas; do
Expand All @@ -29,5 +31,18 @@ for metadata in $metadatas; do
else
$ROOT_DIR/bin/keygen $auth_type $filepath
fi

password=""
if [ -f $filepath/rsa_private.pkcs8 ]; then
password=$(sha256sum $filepath/rsa_private.pkcs8 | cut -c1-8)
elif [ -f $filepath/ec_private.pkcs8 ]; then
password=$(sha256sum $filepath/ec_private.pkcs8 | cut -c1-8)
fi

if [ -n "$password" ]; then
device_id=$(basename $filepath)
username="/r/$registry_id/d/$device_id"
echo "{\"username\": \"$username\", \"password\": \"$password\"}" | jq . > $filepath/credentials.json
fi
fi
done
1 change: 1 addition & 0 deletions bin/test_sites
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function redact_files {
sed -E -i \
-e 's-oading .*udmi/tests/-REDACTED/-' \
-e 's-^ .*udmi/tests/- REDACTED/-' \
-e 's-^ File not found: /app/tests/- REDACTED/-' \
$file
done
}
Expand Down
94 changes: 94 additions & 0 deletions gencode/python/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ class LocalDevice implements SiteDevice {
ADJUNCT_DIR,
EXPECTED_DIR,
CONFIG_DIR,
OUT_DIR);
OUT_DIR,
"credentials.json");
private static final Set<String> OUT_FILES = ImmutableSet.of(
GENERATED_CONFIG_JSON, DEVICE_ERRORS_MAP, NORMALIZED_JSON, EXCEPTION_LOG_FILE);
private static final Set<String> ALL_KEY_FILES =
Expand Down
Loading