forked from openthread/ot-registrar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [src] removed CSRAttrs, not used in cBRSKI * [src] remove Commissioner class, tests and related ace-java dependency (was used for CWT-like/token function) * [pom.xml] bump versions to avoid log4j related performance WARNING msg. * removal of ACE, doc updates, src format updates, and new generic-main function WIP. * [registrar] enable -registrar option to run the registrar function. * restructuring code for main and option parsing. * [all] use dedicated configs for each role; fix logging init to right levels. * [all] moved code to right packages; split Constants into 3 separate files; source style formatting. * [all][tests] remove HW related code from repo; code and test updates to remove code warnings/deprecation warnings. * [masa] bugfix missing return statements and code warning fixes. * [pom.xml] set release level at 11 (hopefully that should cover all used std lib functions like readAllBytes()) * [script] added helper script to avoid code duplication; removed unneeded scripts. * [all] coaps URI bugfix; log fix to avoid Californium library logs to show up always; code formatting. * [script] rename Docker container to ot-registrar:latest and some updates.
- Loading branch information
Showing
75 changed files
with
1,173 additions
and
3,010 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,15 +12,15 @@ Help us keep OpenThread open and inclusive. Please read and follow our [Code of | |
|
||
## Bugs | ||
|
||
If you find a bug in the source code, you can help us by [submitting a GitHub Issue](https://github.com/openthread/ot-registrar/issues/new). Even better, you can [submit a Pull Request](#submitting-a-pull-request) with a fix. | ||
If you find a bug in the source code, you can help us by [submitting a GitHub Issue](https://github.com/EskoDijk/ot-registrar/issues/new). Even better, you can [submit a Pull Request](#submitting-a-pull-request) with a fix. | ||
|
||
## New features | ||
|
||
You can request a new feature by [submitting a GitHub Issue](https://github.com/openthread/ot-registrar/issues/new). | ||
You can request a new feature by [submitting a GitHub Issue](https://github.com/EskoDijk/ot-registrar/issues/new). | ||
|
||
If you would like to implement a new feature, please consider the scope of the new feature: | ||
|
||
* *Large feature* — [Submit a GitHub Issue](https://github.com/openthread/ot-registrar/issues/new) with your proposal so that the community can review and provide feedback first. Early feedback helps to ensure your proposal is accepted by the community, better coordinate our efforts, and minimize duplicated work. | ||
* *Large feature* — [Submit a GitHub Issue](https://github.com/EskoDijk/ot-registrar/issues/new) with your proposal so that the community can review and provide feedback first. Early feedback helps to ensure your proposal is accepted by the community, better coordinate our efforts, and minimize duplicated work. | ||
|
||
* *Small feature* — Can be implemented and directly [submitted as a Pull Request](#submitting-a-pull-request) without a proposal. | ||
|
||
|
@@ -32,17 +32,17 @@ The OpenThread Project follows the "Fork-and-Pull" model for accepting contribut | |
|
||
Setup your GitHub fork and continuous integration services: | ||
|
||
1. Fork the [OT Registrar repository](https://github.com/openthread/ot-registrar) by clicking **Fork** on the web UI. | ||
2. Enable [Travis CI](https://travis-ci.org/) by logging into the respective service with your GitHub account and enabling your newly created fork. We use Travis CI for Linux-based continuous integration checks. All contributions must pass these checks to be accepted. | ||
1. Fork the [OT Registrar repository](https://github.com/EskoDijk/ot-registrar) by clicking **Fork** on the web UI. | ||
2. Enable GitHub CI by logging into your GitHub account and enabling it on your newly created fork. We use CI for Linux-based continuous integration checks. All contributions must pass these checks to be accepted. | ||
|
||
Setup your local development environment: | ||
|
||
```bash | ||
# Clone your fork | ||
git clone [email protected]:<username>/ot-registrar.git | ||
git clone https://<username>@github.com/EskoDijk/ot-registrar.git | ||
|
||
# Configure upstream alias | ||
git remote add upstream git@github.com:openthread/ot-registrar.git | ||
git remote add upstream https://<username>@github.com/EskoDijk/ot-registrar.git | ||
``` | ||
|
||
### Submitting a pull request | ||
|
@@ -99,11 +99,8 @@ This will open up a text editor where you can specify which commits to squash. | |
|
||
#### Coding conventions and style | ||
|
||
OT Registrar uses and enforces the [Google Java Style](https://google.github.io/styleguide/javaguide.html) on all code. OT Registrar will automatically reformat the code when building the project with [maven](https://maven.apache.org). Use command `mvn com.coveo:fmt-maven-plugin:format` and `mvn com.coveo:fmt-maven-plugin:check` to explicitly reformat code and check for code-style compliance, respectively. | ||
|
||
As part of the cleanup process, also run `mvn com.coveo:fmt-maven-plugin:check` to ensure that your code passes the baseline code style checks. | ||
|
||
Make sure to include any code format changes in your commits. | ||
OT Registrar uses most of the [Google Java Style](https://google.github.io/styleguide/javaguide.html) at this moment. The reason for not using the full set of guidelines is that it introduces a very narrow line width (100), which makes code hard to read on normal-size desktop monitors used for coding that can easily handle long line lengths. | ||
For an IDE, the XML file for this style can be [downloaded](https://github.com/google/styleguide) and applied and the line width increased to 200. | ||
|
||
#### Push and test | ||
|
||
|
@@ -115,8 +112,8 @@ git checkout <branch-name> | |
git push origin <branch-name> | ||
``` | ||
|
||
This will trigger the Travis Continuous Integration (CI) checks. You can view the results in the respective services. Note that the integration checks will report failures on occasion. If a failure occurs, you may try rerunning the test using the Travis web UI. | ||
This will trigger Github Continuous Integration (CI) checks. You can view the results in the respective services. | ||
|
||
#### Submit the pull request | ||
|
||
Once you've validated the Travis CI results, go to the page for your fork on GitHub, select your development branch, and click the **Pull Request** button. If you need to make any adjustments to your pull request, push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update. | ||
Once you've validated the CI results, go to the page for your fork on GitHub, select your development branch, and click the **Pull Request** button. If you need to make any adjustments to your pull request, push the updates to GitHub. Your pull request will automatically track the changes on your development branch and update. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,15 +29,8 @@ | |
|
||
set -e | ||
|
||
## This is not a public repository, make sure you have the access! | ||
readonly [email protected]:threadgroup/tce-registrar-java.git | ||
|
||
readonly IMAGE_NAME=ot-registrar | ||
|
||
if [ ! -d tri ]; then | ||
echo "cloning 'tce-registrar-java' into 'tri'..." | ||
git clone $TRI_REPO tri | ||
fi | ||
readonly VERSION=latest | ||
|
||
# Enable ipv6 | ||
if [ ! -f /etc/docker/daemon.json ]; then | ||
|
@@ -46,12 +39,14 @@ if [ ! -f /etc/docker/daemon.json ]; then | |
sudo systemctl restart docker | ||
fi | ||
|
||
# Create docker image if not exist | ||
# Create docker image if not existing yet | ||
if ! $(sudo docker image ls | grep -q "${IMAGE_NAME}"); then | ||
# Building package | ||
echo "building OT Registrar package..." | ||
mvn clean -Dmaven.test.skip=true package | ||
|
||
echo "building docker image..." | ||
sudo docker build --no-cache -f script/Dockerfile -t ubuntu:${IMAGE_NAME} . | ||
sudo docker build --no-cache -f script/Dockerfile -t ${IMAGE_NAME}:${VERSION} . | ||
else | ||
echo "Docker image '${IMAGE_NAME}' is already present." | ||
fi | ||
|
||
# Building package | ||
echo "building OT Registrar package..." | ||
mvn clean -Dmaven.test.skip=true package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,36 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2022, The OpenThread Registrar Authors. | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# 1. Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# 2. Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# 3. Neither the name of the copyright holder nor the | ||
# names of its contributors may be used to endorse or promote products | ||
# derived from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
# POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
CREDS=./credentials/ietf-draft-constrained-brski | ||
echo "Creating .p12 keystore file for credentials in $CREDS ..." | ||
java -cp target/ot-registrar-0.1-SNAPSHOT-jar-with-dependencies.jar com.google.openthread.tools.CredentialGenerator \ | ||
./script/helper-cp-run.sh com.google.openthread.tools.CredentialGenerator \ | ||
-c $CREDS/domain_ca.pem $CREDS/privkey_domain_ca.pem \ | ||
-r $CREDS/registrar.pem $CREDS/privkey_registrar.pem \ | ||
-m $CREDS/masa_ca.pem $CREDS/privkey_masa_ca.pem \ | ||
-p $CREDS/pledge.pem $CREDS/privkey_pledge.pem \ | ||
-o ./credentials/keystore_ietf-draft-constrained-brski.p12 | ||
-o ./credentials/keystore_ietf-draft-constrained-brski.p12 |
Oops, something went wrong.