summaryrefslogtreecommitdiff
path: root/src/panto_home.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/panto_home.zig')
-rw-r--r--src/panto_home.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/panto_home.zig b/src/panto_home.zig
index e75d14b..5d111d6 100644
--- a/src/panto_home.zig
+++ b/src/panto_home.zig
@@ -35,6 +35,10 @@ pub const Layout = struct {
/// binary. Searched after user/project layers for tools and
/// extensions; project shadows user shadows base.
agent_dir: []u8,
+ /// `$PANTO_HOME/auth/` — persisted provider auth tokens, one
+ /// `<auth-name>.json` per OAuth session. Files are written owner-only;
+ /// treat them like passwords.
+ auth_dir: []u8,
/// `$PANTO_HOME/rocks/lua-<lua_version>/` — the versioned tree.
tree: []u8,
/// `<tree>/include/` — where Lua headers are staged.
@@ -58,6 +62,7 @@ pub const Layout = struct {
const a = self.allocator;
a.free(self.home);
a.free(self.agent_dir);
+ a.free(self.auth_dir);
a.free(self.tree);
a.free(self.include_dir);
a.free(self.share_lua_dir);
@@ -85,6 +90,9 @@ pub fn resolve(
const agent_dir = try std.fs.path.join(allocator, &.{ home, "agent" });
errdefer allocator.free(agent_dir);
+ const auth_dir = try std.fs.path.join(allocator, &.{ home, "auth" });
+ errdefer allocator.free(auth_dir);
+
// `<home>/rocks/lua-<lua_version>`
const tree_subdir = try std.fmt.allocPrint(
allocator,
@@ -121,6 +129,7 @@ pub fn resolve(
.allocator = allocator,
.home = home,
.agent_dir = agent_dir,
+ .auth_dir = auth_dir,
.tree = tree,
.include_dir = include_dir,
.share_lua_dir = share_lua_dir,