-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: c at_activate and required components #423
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
9295b4e
feat: create atcommons and introduce enroll related deps
srieteja f786bc7
feat: introduce arg parser for at_activate
srieteja c7c637d
feat: add apkam_symmetric_key to atkeys_file
XavierChanth ff396f8
feat: add apkam_symmetric_key to atkeys
XavierChanth 8964e73
feat: introduce atactivate + hex, base64 and utf8 utils
srieteja 6710bfb
feat: cmakeLists update + default homedir impl + more atactivate code
srieteja c034d1e
docs: added docs + some more refactoring
srieteja b2925c7
fix: migration to mallocs + minor refactoring
srieteja 061439b
chore: resolve compile warnings and refactor methods signatures
srieteja 2e90e60
fix: import platform dependent header limits.
srieteja 04a872b
chore: rename all instance of "atclient_pkam_authenticate_options_*" …
srieteja 013fd0a
fix: analyzer warnings
srieteja 6957202
chore: update .gitignore
srieteja ecf30f1
chore: fix method duplication
srieteja 9a59586
chore: refactoring + add missing docs + better logging
srieteja 2491f69
test: unit tests + refactoring
srieteja eba4ff0
test: unit tests + refactoring
srieteja e5153e9
Merge remote-tracking branch 'origin/create_at_commons' into create_a…
srieteja ac675cf
chore: address review comments
srieteja b23f45c
chore: address review comments - round 2
srieteja c90f62b
fix: atsign memory leak bug
srieteja 88501e5
fix: atsign memory leak bug
srieteja 6a3231d
Merge remote-tracking branch 'origin/create_at_commons' into create_a…
srieteja 6af0010
chore(deps): bump github/codeql-action in the github-actions group
dependabot[bot] 8e43d43
chore(deps): bump github/codeql-action in the github-actions group
dependabot[bot] 70ded5f
chore(deps): bump github/codeql-action in the github-actions group
dependabot[bot] d3e102e
feat: introduce auth_cli
srieteja 6fe4e57
Revert "feat: introduce auth_cli"
srieteja 5162fb8
fix: address review comments
srieteja 9e57229
chore: revert changes reg recursive write in atclient/connection.c
srieteja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private header, see man getopt(3)