Skip to content

Commit

Permalink
Merge pull request #250 from openziti/fix.posture.double.run.no.mfa
Browse files Browse the repository at this point in the history
fix multiple posture submits erroring on top of eachother
  • Loading branch information
andrewpmartinez authored Mar 12, 2021
2 parents 8a7baed + 52142e0 commit d6900c2
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 106 deletions.
24 changes: 22 additions & 2 deletions inc_internal/posture.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,31 @@ limitations under the License.
#ifdef __cplusplus
extern "C" {
#endif
void posture_init(struct ziti_ctx *ztx, long interval_secs);

struct posture_checks {
uv_timer_t *timer;
double interval;

// map<type/process_path,response>
model_map *previous_responses;

// map<type/process_path,response>
model_map *current_responses;


// map<type/process_path, is errored
model_map *error_states;

char *previous_session_id;
bool must_send;
bool must_send_every_time;
};

void ziti_posture_init(ziti_context ztx, long interval_secs);

void ziti_posture_checks_free(struct posture_checks *pcs);

void ziti_send_posture_data(struct ziti_ctx *ztx);
void ziti_send_posture_data(ziti_context ztx);

#ifdef __cplusplus
}
Expand Down
16 changes: 1 addition & 15 deletions inc_internal/zt_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ limitations under the License.
#include "ziti_ctrl.h"
#include "metrics.h"
#include "edge_protocol.h"
#include "posture.h"

#include <sodium.h>

Expand Down Expand Up @@ -158,21 +159,6 @@ struct process {
int num_signers;
};

struct posture_checks {
uv_timer_t timer;
double interval;

// map<type/process_path,response>
model_map *previous_responses;

// map<type/process_path,response>
model_map *current_responses;

char *previous_session_id;
bool must_send;
bool must_send_every_time;
};

struct ziti_ctx {
ziti_options *opts;
ziti_controller controller;
Expand Down
Loading

0 comments on commit d6900c2

Please sign in to comment.