Skip to content

Commit

Permalink
chore: fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
srieteja committed Dec 13, 2024
1 parent ea3fb92 commit 3e95460
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/desktop/at_talk/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) {
pthread_mutex_lock(&client_mutex);
atclient_authenticate_options options;
atclient_authenticate_options_init(&options);
if ((ret = atclient_pkam_authenticate(&atclient1, from_atsign, &atkeys, &options)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient1, from_atsign, &atkeys, &options, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "\natclient_pkam_authenticate: %d\n", ret);
goto exit;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/desktop/crud/delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int main() {
goto exit;
}

if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, &options)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, &options, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate");
goto exit;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/desktop/crud/get_publickey.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ int main() {

char *metadatajsonstr = NULL;

if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, &options)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, &options, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate");
goto exit;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/desktop/crud/get_selfkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main() {

char *atkeystr = NULL;

if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, &options)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, &options, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate\n");
goto exit;
} else {
Expand Down
2 changes: 1 addition & 1 deletion examples/desktop/crud/get_sharedkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int main() {

char *atkeystr = NULL;

if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, &options)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, &options, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate\n");
goto exit;
} else {
Expand Down
2 changes: 1 addition & 1 deletion examples/desktop/crud/put_publickey.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main() {

char *atkeystr = NULL;

if ((ret = atclient_pkam_authenticate(&atclient, ATSIGN, &atkeys, &options)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient, ATSIGN, &atkeys, &options, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate");
goto exit;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/desktop/crud/put_selfkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main() {

char *atkeystr = NULL;

if ((ret = atclient_pkam_authenticate(&atclient, ATSIGN, &atkeys, &options)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient, ATSIGN, &atkeys, &options, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate");
goto exit;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/desktop/crud/put_sharedkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int main() {

char *atkeystr = NULL;

if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, &options)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, &options, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate");
goto exit;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/desktop/events/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ int main(int argc, char *argv[]) {
goto exit;
}

if ((ret = atclient_pkam_authenticate(&atclient2, atsign, &atkeys, NULL)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient2, atsign, &atkeys, NULL, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate with PKAM\n");
goto exit;
}

if ((ret = atclient_monitor_pkam_authenticate(&monitor_conn, atsign, &atkeys, NULL)) != 0) {
if ((ret = atclient_monitor_pkam_authenticate(&monitor_conn, atsign, &atkeys, NULL, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate monitor with PKAM\n");
goto exit;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/desktop/events/notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) {



if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, NULL)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient, atsign, &atkeys, NULL, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate\n");
goto exit;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/desktop/events/resilient_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ int main(int argc, char *argv[]) {
goto exit;
}

if ((ret = atclient_pkam_authenticate(&atclient2, atsign, &atkeys, NULL)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient2, atsign, &atkeys, NULL, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate with PKAM\n");
goto exit;
}

if ((ret = atclient_monitor_pkam_authenticate(&monitor_conn, atsign, &atkeys, NULL)) != 0) {
if ((ret = atclient_monitor_pkam_authenticate(&monitor_conn, atsign, &atkeys, NULL, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate monitor with PKAM\n");
goto exit;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/desktop/reconnection/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main() {
goto exit;
}

if ((ret = atclient_pkam_authenticate(&atclient1, ATSIGN, &atkeys, &options)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient1, ATSIGN, &atkeys, &options, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to PKAM authenticate.\n");
goto exit;
}
Expand All @@ -47,7 +47,7 @@ int main() {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_INFO, "We are connected to the atServer! :)\n");
} else {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_INFO, "We are not connected to atServer? :(\n");
if((ret = atclient_pkam_authenticate(&atclient1, ATSIGN, &atkeys, &options)) == 0) {
if((ret = atclient_pkam_authenticate(&atclient1, ATSIGN, &atkeys, &options, NULL)) == 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_INFO, "Reconnected to atServer! :)\n");
atclient_set_read_timeout(&atclient1, 1000);
} else {
Expand Down
2 changes: 1 addition & 1 deletion examples/desktop/repl/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) {
goto exit;
}

if ((ret = atclient_pkam_authenticate(&atclient, repl_args.atsign, &atkeys, NULL)) != 0) {
if ((ret = atclient_pkam_authenticate(&atclient, repl_args.atsign, &atkeys, NULL, NULL)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to authenticate\n");
goto exit;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/atauth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ set(
${CMAKE_CURRENT_LIST_DIR}/src/auth_cli.c
${CMAKE_CURRENT_LIST_DIR}/src/atauth_build_atkeys_file_path.c
${CMAKE_CURRENT_LIST_DIR}/src/atauth_fetch_home_dir.c
../../examples/desktop/at_talk/src/main.c
../../examples/desktop/connection_hooks/main.c
../../examples/desktop/crud/delete.c
)

# Project setup
Expand Down

0 comments on commit 3e95460

Please sign in to comment.