secrets.mojo (1365B)
1 from std.os.path import exists 2 3 from hyf_runtime.paths import RuntimePaths, join_runtime_path 4 5 6 # Runtime status posture only: do not load, create, wrap, or persist secrets here. 7 comptime _DEFAULT_SECRET_BACKEND = "encrypted_file" 8 comptime _SECRET_STORAGE_STATUS = "reserved" 9 comptime _PROTECTED_LOCAL_DATA_STATUS = "reserved" 10 11 12 def default_secret_backend_name() -> String: 13 return _DEFAULT_SECRET_BACKEND 14 15 16 def secret_storage_status_name() -> String: 17 return _SECRET_STORAGE_STATUS 18 19 20 def secret_storage_backend_implemented() -> Bool: 21 return False 22 23 24 def identity_material_loaded() -> Bool: 25 return False 26 27 28 def identity_material_created_by_startup() -> Bool: 29 return False 30 31 32 def identity_material_configured_for_runtime_paths(paths: RuntimePaths) -> Bool: 33 return exists(paths.identity_path) 34 35 36 def protected_local_data_status_name() -> String: 37 return _PROTECTED_LOCAL_DATA_STATUS 38 39 40 def protected_local_data_support_implemented() -> Bool: 41 return False 42 43 44 def protected_local_data_store_open() -> Bool: 45 return False 46 47 48 def protected_local_data_configured_for_runtime_paths( 49 paths: RuntimePaths, 50 ) raises -> Bool: 51 return exists(protected_local_data_dir_for_runtime_paths(paths)) 52 53 54 def protected_local_data_dir_for_runtime_paths( 55 paths: RuntimePaths, 56 ) raises -> String: 57 return join_runtime_path(paths.data_dir, "protected")