@@ -858,6 +858,9 @@ int ziti_get_appdata(ziti_context ztx, const char *key, void *data,
858858
859859void ziti_dump (ziti_context ztx , int (* printer )(void * arg , const char * fmt , ...), void * ctx ) {
860860 uint64_t now = uv_now (ztx -> loop );
861+ uv_timeval64_t now_ts = {};
862+ uv_gettimeofday (& now_ts );
863+
861864 printer (ctx , "\n======= Application Info ==========\n" );
862865 printer (ctx , "Application:\t%s@%s\n" , APP_ID ? APP_ID : "<unset>" , APP_VERSION ? APP_VERSION : "<unknown>" );
863866 const ziti_version * sdk_ver = ziti_get_version ();
@@ -871,8 +874,10 @@ void ziti_dump(ziti_context ztx, int (*printer)(void *arg, const char *fmt, ...)
871874 if (info -> device_id ) {
872875 printer (ctx , "Device ID: %s\n" , info -> device_id );
873876 }
874- printer (ctx , "OS/arch: %s %s (%s/%s)\n" , info -> os , info -> arch , info -> os_release , info -> os_version );
875- printer (ctx , "Hostname: %s/%s\n" , info -> hostname , info -> domain );
877+ printer (ctx , "OS/arch: %s %s (%s/%s)\n" , info -> os , info -> arch , info -> os_release , info -> os_version );
878+ printer (ctx , "Hostname: %s/%s\n" , info -> hostname , info -> domain );
879+ printer (ctx , "Current time: %s (%" PRIu64 ".%0" PRIu64 ")" ,
880+ get_utc_time (), now_ts .tv_sec , now_ts .tv_usec / 1000 );
876881
877882 printer (ctx , "\n=================\nZiti Context:\n" );
878883 printer (ctx , "ID:\t%d\n" , ztx -> id );
@@ -922,6 +927,25 @@ void ziti_dump(ziti_context ztx, int (*printer)(void *arg, const char *fmt, ...)
922927 printer (ctx , "No Session found\n" );
923928 }
924929
930+ printer (ctx , "\n=================\nExternal Credentials:\n" );
931+ const char * signer_name ;
932+ ziti_jwt_signer * signer ;
933+ printer (ctx , "ext signers[%zd]:\n" , model_map_size (& ztx -> ext_signers ));
934+ MODEL_MAP_FOREACH (signer_name , signer , & ztx -> ext_signers ) {
935+ printer (ctx , "\t%s: id[%s] provider[%s]\n" ,
936+ signer_name , signer -> id ,
937+ signer -> provider_url ? signer -> provider_url : "(none)" );
938+ }
939+
940+ const char * iss ;
941+ zt_jwt * jwt ;
942+ printer (ctx , "ext jwt tokens[%zd]:\n" , model_map_size (& ztx -> ext_jwt_tokens ));
943+ MODEL_MAP_FOREACH (iss , jwt , & ztx -> ext_jwt_tokens ) {
944+ printer (ctx , "\tissuer[%s] expiration[%" PRIu64 "]%s\n" ,
945+ iss , jwt -> expiration ,
946+ (jwt -> expiration != 0 && jwt -> expiration < now_ts .tv_sec ) ? " EXPIRED" : "" );
947+ }
948+
925949 printer (ctx , "\n=================\nServices:\n" );
926950 ziti_service * zs ;
927951 const char * name ;
0 commit comments