Skip to content

Commit

Permalink
feat: c at_activate and required components (#423)
Browse files Browse the repository at this point in the history
* 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
3 people authored and JeremyTubongbanua committed Dec 12, 2024
1 parent 57f41b7 commit f071567
Show file tree
Hide file tree
Showing 35 changed files with 867 additions and 724 deletions.
142 changes: 59 additions & 83 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
# Configurable options
set(TARGET_ESPIDF FALSE CACHE BOOL "Build for the espidf platform")

option(ATSDK_BUILD_TESTS "Build tests for atsdk ON | \"unit\" | \"func\" " OFF)

# to avoid caching issues
if(ATSDK_BUILD_TESTS STREQUAL "func")
message("FUNCTIONAL TESTING ENABLED")
set(ATSDK_BUILD_UNIT_TESTS OFF)
set(ATSDK_BUILD_FUNCTIONAL_TESTS ON)
elseif(ATSDK_BUILD_TESTS STREQUAL "unit")
message("UNIT TESTING ENABLED")
set(ATSDK_BUILD_UNIT_TESTS ON)
set(ATSDK_BUILD_FUNCTIONAL_TESTS OFF)
elseif(ATSDK_BUILD_TESTS)
message("ALL TESTING ENABLED")
set(ATSDK_BUILD_FUNCTIONAL_TESTS ON)
set(ATSDK_BUILD_UNIT_TESTS ON)
else()
message("TESTING DISABLED")
set(ATSDK_BUILD_UNIT_TESTS OFF)
set(ATSDK_BUILD_FUNCTIONAL_TESTS OFF)
endif()
option(ATSDK_BUILD_TESTS "Build tests for atsdk" OFF)

# Basic project setup
cmake_minimum_required(VERSION 3.24)
Expand All @@ -29,87 +9,83 @@ cmake_policy(SET CMP0135 NEW)
include(GNUInstallDirs)

project(
atsdk
VERSION 0.0.1
DESCRIPTION "Atsign's atSDK library"
HOMEPAGE_URL https://atsign.com
LANGUAGES C
atsdk
VERSION 0.0.1
DESCRIPTION "Atsign's atSDK library"
HOMEPAGE_URL https://atsign.com
LANGUAGES C
)

# Determine if atchops is being built as a subproject using add_subdirectory()
if(NOT DEFINED ATSDK_AS_SUBPROJECT)
set(ATSDK_AS_SUBPROJECT ON)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(ATSDK_AS_SUBPROJECT OFF)
endif()
endif()
if (NOT DEFINED ATSDK_AS_SUBPROJECT)
set(ATSDK_AS_SUBPROJECT ON)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(ATSDK_AS_SUBPROJECT OFF)
endif ()
endif ()
message(STATUS "[ATSDK] ATSDK_AS_SUBPROJECT: ${ATSDK_AS_SUBPROJECT}")

# install each package
message(STATUS "Building atlogger")
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/packages/atlogger)

message(STATUS "Building atchops")
set(ATCHOPS_BUILD_TESTS ${ATSDK_BUILD_UNIT_TESTS})
set(ATCHOPS_BUILD_TESTS ${ATSDK_BUILD_TESTS})
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/packages/atchops)

message(STATUS "Building atclient")
set(ATCLIENT_BUILD_TESTS ${ATSDK_BUILD_UNIT_TESTS})
set(ATCLIENT_BUILD_TESTS ${ATSDK_BUILD_TESTS})
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/packages/atclient)

message(STATUS "Building atcommons")
set(ATCOMMONS_BUILD_TESTS ${ATSDK_BUILD_TESTS})
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/packages/atcommons)

message(STATUS "Building atauth")
set(ATAUTH_BUILD_TESTS ${ATSDK_BUILD_UNIT_TESTS})
set(ATAUTH_BUILD_TESTS ${ATSDK_BUILD_TESTS})
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/packages/atauth)

if(NOT ESP_PLATFORM)
# install dependencies
set(
ATSDK_TARGETS
mbedtls
mbedx509
mbedcrypto
everest
p256m
atchops
cjson
atlogger
atclient
atcommons
atauth
)

install(
TARGETS ${ATSDK_TARGETS}
EXPORT ${PROJECT_NAME}-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

# export dependencies
if(NOT ATSDK_AS_SUBPROJECT)
export(PACKAGE ${PROJECT_NAME})

# install as a config.cmake
install(
EXPORT ${PROJECT_NAME}-config
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
FILE ${PROJECT_NAME}-config.cmake
if (NOT ESP_PLATFORM)
# install dependencies
set(
ATSDK_TARGETS
mbedtls
mbedx509
mbedcrypto
everest
p256m
uuid4-static
atchops
cjson
atlogger
atclient
atcommons
atauth
)

# export the config.cmake
export(
EXPORT ${PROJECT_NAME}-config
NAMESPACE ${PROJECT_NAME}::
FILE "cmake/${PROJECT_NAME}-config.cmake"
install(
TARGETS ${ATSDK_TARGETS}
EXPORT ${PROJECT_NAME}-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
endif()

if(ATSDK_BUILD_FUNCTIONAL_TESTS)
message(STATUS "Building functional tests")
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/tests/functional_tests)
endif()

if(ATSDK_BUILD_UNIT_TESTS OR ATSDK_BUILD_FUNCTIONAL_TESTS)
enable_testing()
endif()
# export dependencies
if (NOT ATSDK_AS_SUBPROJECT)
export(PACKAGE ${PROJECT_NAME})

# install as a config.cmake
install(
EXPORT ${PROJECT_NAME}-config
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
FILE ${PROJECT_NAME}-config.cmake
)

# export the config.cmake
export(
EXPORT ${PROJECT_NAME}-config
NAMESPACE ${PROJECT_NAME}::
FILE "cmake/${PROJECT_NAME}-config.cmake"
)
endif ()
endif ()
1 change: 1 addition & 0 deletions examples/desktop/at_talk/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <bits/getopt_core.h>

#define ROOT_HOST "root.atsign.org"
#define ROOT_PORT 64
Expand Down
4 changes: 2 additions & 2 deletions examples/desktop/repl/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ static int set_up_pkam_auth_options(atclient_authenticate_options *pkam_authenti
goto exit;
}

if ((ret = atclient_authenticate_options_set_atdirectory_host(pkam_authenticate_options, root_host)) != 0) {
if ((ret = atclient_authenticate_options_set_at_directory_host(pkam_authenticate_options, root_host)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to set at directory host\n");
goto exit;
}

if ((ret = atclient_authenticate_options_set_atdirectory_port(pkam_authenticate_options, root_port)) != 0) {
if ((ret = atclient_authenticate_options_set_at_directory_port(pkam_authenticate_options, root_port)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to set at directory port\n");
goto exit;
}
Expand Down
Loading

0 comments on commit f071567

Please sign in to comment.