-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: c at_activate and required components (#423)
* feat: create atcommons and introduce enroll related deps * feat: introduce arg parser for at_activate * feat: add apkam_symmetric_key to atkeys_file * feat: add apkam_symmetric_key to atkeys * feat: introduce atactivate + hex, base64 and utf8 utils * feat: cmakeLists update + default homedir impl + more atactivate code * fix: import platform dependent header limits. * chore: rename all instance of "atclient_pkam_authenticate_options_*" -> "atclient_authenticate_options_*" * test: atcommons unit tests * chore(deps): bump github/codeql-action in the github-actions group Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action). Updates `github/codeql-action` from 3.27.1 to 3.27.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@4f3212b...396bb3e) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> * chore(deps): bump github/codeql-action in the github-actions group Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action). Updates `github/codeql-action` from 3.27.3 to 3.27.4 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@396bb3e...ea9e4e3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> * chore(deps): bump github/codeql-action in the github-actions group Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action). Updates `github/codeql-action` from 3.27.4 to 3.27.5 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@ea9e4e3...f09c1c0) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> * feat: introduce auth_cli * Revert "feat: introduce auth_cli" This reverts commit a3d043a. This reverts commit d646b46. This reverts commit aff312e. This reverts commit e8c7b71. * fix: address review comments * chore: revert changes reg recursive write in atclient/connection.c --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: xavierchanth <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
5d7f0c1
commit 2ac634b
Showing
86 changed files
with
3,086 additions
and
325 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ __pycache__/ | |
.pio/ | ||
|
||
test/*/test_* | ||
/.clang-format |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if(NOT TARGET atauth) | ||
include(FetchContent) | ||
message( | ||
STATUS | ||
"[ATAUTH] package not found, fetching from local repository.." | ||
) | ||
FetchContent_Declare(atauth SOURCE_DIR ${atauth_DIR}) | ||
FetchContent_MakeAvailable(atauth) | ||
install(TARGETS atauth) | ||
endif() |
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,10 @@ | ||
if(NOT TARGET atclient) | ||
message( | ||
STATUS | ||
"[ATCLIENT] package not found, fetching from local repository.." | ||
) | ||
fetchcontent_declare(atclient SOURCE_DIR ${atclient_DIR}) | ||
fetchcontent_makeavailable(atclient) | ||
install(TARGETS atclient) | ||
include(FetchContent) | ||
message( | ||
STATUS | ||
"[ATCLIENT] package not found, fetching from local repository.." | ||
) | ||
FetchContent_Declare(atclient SOURCE_DIR ${atclient_DIR}) | ||
FetchContent_MakeAvailable(atclient) | ||
install(TARGETS atclient) | ||
endif() |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if(NOT TARGET atcommons) | ||
include(FetchContent) | ||
message( | ||
STATUS | ||
"[ATCOMMONS] package not found, fetching from local repository.. [PATH: ${atcommons_DIR}]" | ||
) | ||
FetchContent_Declare(atcommons SOURCE_DIR ${atcommons_DIR}) | ||
FetchContent_MakeAvailable(atcommons) | ||
install(TARGETS atcommons) | ||
endif() |
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,10 @@ | ||
if(NOT TARGET atlogger) | ||
message( | ||
STATUS | ||
"[ATLOGGER] package not found, fetching from local repository.." | ||
) | ||
fetchcontent_declare(atlogger SOURCE_DIR ${atlogger_DIR}) | ||
fetchcontent_makeavailable(atlogger) | ||
install(TARGETS atlogger) | ||
include(FetchContent) | ||
message( | ||
STATUS | ||
"[ATLOGGER] package not found, fetching from local repository.." | ||
) | ||
fetchcontent_declare(atlogger SOURCE_DIR ${atlogger_DIR}) | ||
fetchcontent_makeavailable(atlogger) | ||
install(TARGETS atlogger) | ||
endif() |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/*build*/ |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.19) | ||
|
||
project(cram_authenticate LANGUAGES C VERSION 0.0.1) | ||
|
||
add_executable(main ${CMAKE_CURRENT_LIST_DIR}/src/main.c) | ||
|
||
find_package(atsdk CONFIG REQUIRED) | ||
|
||
target_link_libraries(main PRIVATE atsdk::atclient atsdk::atchops atsdk::atcommons) | ||
|
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -eu | ||
FULL_PATH_TO_SCRIPT="$(realpath "${BASH_SOURCE[0]}")" | ||
SCRIPT_DIRECTORY="$(dirname "$FULL_PATH_TO_SCRIPT")" | ||
cd "$SCRIPT_DIRECTORY/../../../packages/atclient" | ||
cmake -S . -B build | ||
sudo cmake --build build --target install | ||
pwd | ||
cd "$SCRIPT_DIRECTORY" | ||
cmake -S . -B build | ||
cmake --build build --target all | ||
echo "Running main:" | ||
echo "" | ||
echo "" | ||
cd build && ./main | ||
cd .. |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include <atclient/atclient.h> | ||
#include <atlogger/atlogger.h> | ||
#include <atchops/base64.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#define ROOT_HOST "root.atsign.org" | ||
#define ROOT_PORT 64 | ||
|
||
#define CRAM_SECRET "66e026167a79cb7e9d190afe7b01b3fc4f31bc3866a08cdcec06d82a7296e9febcac5d4f4a081728fb0ec9d08f27d4f866bd6570f3fe20c65464ace76643becb" | ||
#define ATSIGN "@disciplinarygemini" | ||
|
||
#define TAG "cram_authenticate" | ||
|
||
int main(int argc, char **argv) { | ||
int ret = 1; | ||
|
||
atlogger_set_logging_level(ATLOGGER_LOGGING_LEVEL_DEBUG); | ||
|
||
atclient_authenticate_options options; | ||
atclient_authenticate_options_init(&options); | ||
|
||
atclient atclient; | ||
atclient_init(&atclient); | ||
|
||
const char *atsign = ATSIGN; | ||
const char *cram_secret = &CRAM_SECRET[0]; | ||
|
||
if ((ret = atclient_cram_authenticate(&atclient, ATSIGN, cram_secret, &options)) != 0) { | ||
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate\n"); | ||
goto exit; | ||
} else { | ||
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_DEBUG, "Authenticated\n"); | ||
} | ||
|
||
exit: { | ||
atclient_free(&atclient); | ||
atclient_authenticate_options_free(&options); | ||
return ret; | ||
} | ||
} |
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
Oops, something went wrong.