Implement role-aware HTTPS and SSH authentication

This commit is contained in:
2026-08-30 01:31:05 +02:00
parent cd235445c7
commit 0c058b6a8f
16 changed files with 707 additions and 331 deletions
+8 -1
View File
@@ -9,6 +9,7 @@
#include "esp_err.h"
#include "session_broker.h"
#include "user_database.h"
#ifdef __cplusplus
extern "C" {
@@ -56,6 +57,7 @@ typedef struct {
typedef struct {
bool active;
bool authenticated;
bool principal_valid;
bool writer;
bool close_requested;
bool rx_pending;
@@ -65,6 +67,9 @@ typedef struct {
int socket_fd;
session_broker_client_id_t broker_client_id;
ssh_transport_session_state_t state;
user_role_t user_role;
user_auth_method_t auth_method;
char username[USER_DATABASE_USERNAME_CAPACITY + 1U];
char peer[48];
} ssh_transport_session_snapshot_t;
@@ -93,8 +98,10 @@ esp_err_t ssh_transport_replace_host_key(bool reset);
esp_err_t ssh_transport_get_snapshot(ssh_transport_snapshot_t *snapshot);
esp_err_t ssh_transport_clear_counters(void);
/* Close one transport session or all authenticated/handshaking sessions. */
/* Close one session, one account's sessions, or every transport session. */
esp_err_t ssh_transport_disconnect(uint32_t session_id);
esp_err_t ssh_transport_revoke_user(const uint8_t *username,
size_t username_length);
esp_err_t ssh_transport_revoke_sessions(void);
#ifdef __cplusplus