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

refactor: remove atclient_atsign, atclient_atstr, refactor a bunch of function signatures #337

Merged
merged 194 commits into from
Jul 30, 2024

Conversation

JeremyTubongbanua
Copy link
Member

@JeremyTubongbanua JeremyTubongbanua commented Jul 11, 2024

closes #263
closes #247
closes #267
closes #127
closes #145
closes #153
closes #154
closes #128
closes #129
closes #317
closes #341
closes #335
closes #336
closes #172
closes #226
closes #235
closes #346
closes #342

- What I did

Done as of July 12th:

  • Refactored atclient_atkey_to_string function signature to take char ** (originally was char *buf, const size_t bufsize, size_t *buflen)
  • Refactored atclient_atkey_metadata_to_protocol_str function signature to take char **
  • Refactored and optimized atclient_put to reflect changes and added comments to increase readability
  • New AES CTR functions. Used to help create an optimal buffer size to be allocated to hold the result of the encrypt/decrypt operation:
  • Removed unused function in connection.h/c
  • Removed unused function in atkeysfile.h/c
size_t atchops_aes_ctr_ciphertext_size(const size_t plaintextlen);

size_t atchops_aes_ctr_plaintext_size(const size_t ciphertextlen);

Done as of July 16th

  • Optimized atclient_delete
  • Optimized atclient_put
  • Optimized atclient_pkam_authenticate
  • Optimized atclient_get_atkeys
  • Handle malloc==NULL where it was easy to handle it

Done as of July 18th

Done as of July 20th

  • Finished up metadata.h/.c refactors completely, including some of the to/from jsonstr/cjson node functions
  • Removed atstr from metadata
  • Made all tests pass
  • Removed isHidden (see at_c: remove isHidden from metadata.c and all uses #145 as to why)
  • at_c: atkeys.c initializedfields #128 - atkeys.c/.h now has _initializedfields for optimized memory management
  • Removed atstr from atkeys
  • Removed atstr from atkeysfile
  • Deleted atstr and atbytes completely from the code base

Done as of July 22nd

  • Removed atclient_atsign
  • Cleaned up encryption_key_helpers.h by changing the function signatures to be more predictable
  • atclient_delete now returns commit_id

Done as of July 23rd

  • notify_params.h/.c (represents notification request object before sending notify command)
  • atnotification.h/.c (represents a notification from monitor)

Done as of July 29th

  • request_options.c/.h
  • atclient_get_shared_key_request_options, atclient_get_public_key_request_options, atclient_get_self_key_request_options implementations
  • atclient_delete_request_options
  • atclient_put_shared_key_request_options, atclient_put_self_key_request_options, atclient_put_public_key_request_options,
  • atclient_put broken down to atclient_put_self_key, _public_key, and _shared_key
  • All CRUD operations take the request_options as an optional parameter (NULLABLE)
  • atclient_get_self_key takes char ** now
  • atclient_get_public_key takes char ** now
  • atclient_get_shared_key takes char ** now
  • Updated all tests accordingly
  • atchops/mbedtls.h
  • atclient/mbedtls.h
  • atclient/cjson.h
  • Removed readonly_src feature from hooks
  • port in atclient_connection is now uint16_t

- How to verify it

  • Tests still pass

- Description for the changelog

@JeremyTubongbanua JeremyTubongbanua self-assigned this Jul 11, 2024
@JeremyTubongbanua JeremyTubongbanua marked this pull request as ready for review July 30, 2024 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment