Skip to content
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: impl to create new enollments using APKAM-OTP #453

Merged
merged 54 commits into from
Dec 19, 2024
Merged

Conversation

srieteja
Copy link
Contributor

@srieteja srieteja commented Nov 28, 2024

Closes #451

- What I did

AtAuth changes

  • Implement auth_cli that can send enroll requests using OTP and cut an atKeys file once that enrollment is approved.
  • fix at_activate bug: at_activate crashes when the atsign does not start with '@'
  • Introduce a new flag 'v' that makes activate_cli and auth_cli more verbose
  • Introduce new params 'd', 'p', 'n' in arg_parser that parses device_name, app_name and namespaces from command-line

AtClient changes

  • Add a new param to atclient_pkam_authenticate() named 'err_msg' that is populated with the error message from the server in case of an error
  • Introduce new option in get_public_key_request_options named 'should_auth' that allows the user to specify if the key provided to 'atclient_get_public_key()' should be fetched with/without auth. Supporting getter, setter, init and free methods have also been implemented.

AtCommons changes

  • Introduce new method in atcommons/enroll_namespace.c that parses namespace list strings and returns a 'enroll_namespace_t' struct
  • fix bug: The length var in enroll_namespace_list_t struct defaults to SIZE_MAX. (Fixed, defaults to 0 now)

- How I did it

  • fix bug: The length var in enroll_namespace_list_t struct defaults to SIZE_MAX: In 'atcommons_enroll_namespace_list_append' before appending the namespace to list, check if the length is equal to SIZE_MAX. Set to 0 if true.
  • Introduce new option in get_public_key_request_options named 'should_auth': If should auth is set to true, the client performs a 'plookup' for the given key. Otherwise performs a 'lookup'.

- How to verify it

  • test for 'atcommons_enroll_namespace_list_from_string' on the way

- Description for the changelog

  • feat: impl to create new enollments using APKAM-OTP

srieteja and others added 30 commits November 13, 2024 17:57
…t_commons

# Conflicts:
#	packages/atcommons/CMakeLists.txt
…t_commons

# Conflicts:
#	packages/atauth/src/atactivate.c
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]>
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]>
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]>
@srieteja srieteja merged commit 0fcec5f into trunk Dec 19, 2024
8 checks passed
@srieteja srieteja deleted the enroll_using_otp branch December 19, 2024 18:26
JeremyTubongbanua pushed a commit that referenced this pull request Dec 20, 2024
* feat: introduce new params into the arg_parser

* feat: add param "err_msg" to atclient_pkam_authenticate

* feat: new method to parse enroll_namespace_list_t from string

* feat: introduce auth_cli

* chore: revert changes reg recursive write in atclient/connection.c

* feat: migrate constants to atauth_constants.h + minor refactoring

* feat: support for unauthenticated public key lookup

* feat: support to parse enroll namespaces from string

* feat: add new request param 'should_auth' in get_public_key_request_options

* feat: completed auth_cli implementation

* feat: impl multiple exits for auth_cli + minor refactoring

* fix: linux specific header issue + unit test

* chore: fix examples

* fix: introduce init method and use for enroll namespace list

---------

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>
JeremyTubongbanua pushed a commit that referenced this pull request Dec 20, 2024
* feat: introduce new params into the arg_parser

* feat: add param "err_msg" to atclient_pkam_authenticate

* feat: new method to parse enroll_namespace_list_t from string

* feat: introduce auth_cli

* chore: revert changes reg recursive write in atclient/connection.c

* feat: migrate constants to atauth_constants.h + minor refactoring

* feat: support for unauthenticated public key lookup

* feat: support to parse enroll namespaces from string

* feat: add new request param 'should_auth' in get_public_key_request_options

* feat: completed auth_cli implementation

* feat: impl multiple exits for auth_cli + minor refactoring

* fix: linux specific header issue + unit test

* chore: fix examples

* fix: introduce init method and use for enroll namespace list

---------

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>
JeremyTubongbanua pushed a commit that referenced this pull request Dec 20, 2024
* feat: introduce new params into the arg_parser

* feat: add param "err_msg" to atclient_pkam_authenticate

* feat: new method to parse enroll_namespace_list_t from string

* feat: introduce auth_cli

* chore: revert changes reg recursive write in atclient/connection.c

* feat: migrate constants to atauth_constants.h + minor refactoring

* feat: support for unauthenticated public key lookup

* feat: support to parse enroll namespaces from string

* feat: add new request param 'should_auth' in get_public_key_request_options

* feat: completed auth_cli implementation

* feat: impl multiple exits for auth_cli + minor refactoring

* fix: linux specific header issue + unit test

* chore: fix examples

* fix: introduce init method and use for enroll namespace list

---------

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>
JeremyTubongbanua pushed a commit that referenced this pull request Dec 23, 2024
* feat: introduce new params into the arg_parser

* feat: add param "err_msg" to atclient_pkam_authenticate

* feat: new method to parse enroll_namespace_list_t from string

* feat: introduce auth_cli

* chore: revert changes reg recursive write in atclient/connection.c

* feat: migrate constants to atauth_constants.h + minor refactoring

* feat: support for unauthenticated public key lookup

* feat: support to parse enroll namespaces from string

* feat: add new request param 'should_auth' in get_public_key_request_options

* feat: completed auth_cli implementation

* feat: impl multiple exits for auth_cli + minor refactoring

* fix: linux specific header issue + unit test

* chore: fix examples

* fix: introduce init method and use for enroll namespace list

---------

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>
JeremyTubongbanua pushed a commit that referenced this pull request Dec 23, 2024
* feat: introduce new params into the arg_parser

* feat: add param "err_msg" to atclient_pkam_authenticate

* feat: new method to parse enroll_namespace_list_t from string

* feat: introduce auth_cli

* chore: revert changes reg recursive write in atclient/connection.c

* feat: migrate constants to atauth_constants.h + minor refactoring

* feat: support for unauthenticated public key lookup

* feat: support to parse enroll namespaces from string

* feat: add new request param 'should_auth' in get_public_key_request_options

* feat: completed auth_cli implementation

* feat: impl multiple exits for auth_cli + minor refactoring

* fix: linux specific header issue + unit test

* chore: fix examples

* fix: introduce init method and use for enroll namespace list

---------

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>
JeremyTubongbanua pushed a commit that referenced this pull request Dec 25, 2024
* feat: introduce new params into the arg_parser

* feat: add param "err_msg" to atclient_pkam_authenticate

* feat: new method to parse enroll_namespace_list_t from string

* feat: introduce auth_cli

* chore: revert changes reg recursive write in atclient/connection.c

* feat: migrate constants to atauth_constants.h + minor refactoring

* feat: support for unauthenticated public key lookup

* feat: support to parse enroll namespaces from string

* feat: add new request param 'should_auth' in get_public_key_request_options

* feat: completed auth_cli implementation

* feat: impl multiple exits for auth_cli + minor refactoring

* fix: linux specific header issue + unit test

* chore: fix examples

* fix: introduce init method and use for enroll namespace list

---------

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>
JeremyTubongbanua pushed a commit that referenced this pull request Dec 25, 2024
* feat: introduce new params into the arg_parser

* feat: add param "err_msg" to atclient_pkam_authenticate

* feat: new method to parse enroll_namespace_list_t from string

* feat: introduce auth_cli

* chore: revert changes reg recursive write in atclient/connection.c

* feat: migrate constants to atauth_constants.h + minor refactoring

* feat: support for unauthenticated public key lookup

* feat: support to parse enroll namespaces from string

* feat: add new request param 'should_auth' in get_public_key_request_options

* feat: completed auth_cli implementation

* feat: impl multiple exits for auth_cli + minor refactoring

* fix: linux specific header issue + unit test

* chore: fix examples

* fix: introduce init method and use for enroll namespace list

---------

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>
JeremyTubongbanua added a commit that referenced this pull request Jan 2, 2025
* feat: venv tools

* feat: Almost working

* feat: use dev_env tag

* fix: memory bug in atclient_pkam_authenticate

* feat: implement atclient_connection_set_read_timeout

* fix: add compatibility to staging in test_atclient_pkam_authenticate

* fix: test commands in CI

* fix: file name

* feat: add step to start venv in CI

* ci: install docker-compose step

* ci:

* ci: add longer sleeps

* chore: remove unused keys

* chore: remove sudo from pkam_virtualenv.sh

* feat: move mbedtls sockets into its own layer under connection

* chore: address review comments & cleanup work

* ci:

* ci:

* feat: add read timeout to functional_tests_pkam_auth

* fix:

* fix: do not overwrite ret value during tear down in functional tests

* feat: impl to create new enollments using APKAM-OTP (#453)

* feat: introduce new params into the arg_parser

* feat: add param "err_msg" to atclient_pkam_authenticate

* feat: new method to parse enroll_namespace_list_t from string

* feat: introduce auth_cli

* chore: revert changes reg recursive write in atclient/connection.c

* feat: migrate constants to atauth_constants.h + minor refactoring

* feat: support for unauthenticated public key lookup

* feat: support to parse enroll namespaces from string

* feat: add new request param 'should_auth' in get_public_key_request_options

* feat: completed auth_cli implementation

* feat: impl multiple exits for auth_cli + minor refactoring

* fix: linux specific header issue + unit test

* chore: fix examples

* fix: introduce init method and use for enroll namespace list

---------

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>

* feat: Almost working

* fix: add compatibility to staging in test_atclient_pkam_authenticate

* feat: venv tools

* feat: Almost working

* feat: use dev_env tag

* fix: test commands in CI

* fix: file name

* feat: add step to start venv in CI

* ci: install docker-compose step

* ci:

* ci: add longer sleeps

* chore: remove unused keys

* feat: move mbedtls sockets into its own layer under connection

* chore: address review comments & cleanup work

* ci:

* ci:

* fix: do not overwrite ret value during tear down in functional tests

* feat: impl to create new enollments using APKAM-OTP (#453)

* feat: introduce new params into the arg_parser

* feat: add param "err_msg" to atclient_pkam_authenticate

* feat: new method to parse enroll_namespace_list_t from string

* feat: introduce auth_cli

* chore: revert changes reg recursive write in atclient/connection.c

* feat: migrate constants to atauth_constants.h + minor refactoring

* feat: support for unauthenticated public key lookup

* feat: support to parse enroll namespaces from string

* feat: add new request param 'should_auth' in get_public_key_request_options

* feat: completed auth_cli implementation

* feat: impl multiple exits for auth_cli + minor refactoring

* fix: linux specific header issue + unit test

* chore: fix examples

* fix: introduce init method and use for enroll namespace list

---------

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>

* feat: Almost working

* fix: add compatibility to staging in test_atclient_pkam_authenticate

* fix:

* ci:

* ci:

* ci:

* fix: compilation errors

* fix: warning

* fix:

* ci:

* ci:

* ci:

* ci: add virtual environment step in functional tests

* ci:

* ci: nslookup

* feat: null terminate port_str

* fix: test_atclient_monitor bugs

* feat: modify test_atclient_connection.c

* fix: typo

* fix:

* fix:

* chore: undo playground

* chore: undo random change

* chore: remove unused function

* ci: remove debug statements in our tests.yaml

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: XavierChanth <[email protected]>
Co-authored-by: Sri Teja T <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

at_activate: add functionality to create new enrollment using OTP
2 participants