@simonfestl/husky-cli 1.20.0 → 1.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,11 +77,13 @@ export async function fetchAndCacheRole() {
77
77
  // Session is active - fetch permissions for this session role if needed
78
78
  // Check if we have fresh permissions for this session
79
79
  const needsPermissionsFetch = !config.roleLastChecked || !config.permissions;
80
- if (needsPermissionsFetch && config.apiUrl) {
80
+ if (needsPermissionsFetch && config.apiUrl && config.apiKey) {
81
81
  try {
82
- const url = new URL("/api/auth/whoami", config.apiUrl);
82
+ // Fetch permissions for the session role using API key
83
+ // (Bearer tokens are not accepted by /api/auth/whoami)
84
+ const url = new URL(`/api/auth/permissions/${encodeURIComponent(config.sessionRole)}`, config.apiUrl);
83
85
  const res = await fetch(url.toString(), {
84
- headers: { Authorization: `Bearer ${config.sessionToken}` },
86
+ headers: { "x-api-key": config.apiKey },
85
87
  });
86
88
  if (res.ok) {
87
89
  const data = await res.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonfestl/husky-cli",
3
- "version": "1.20.0",
3
+ "version": "1.20.1",
4
4
  "description": "CLI for Huskyv0 Task Orchestration with Claude Agent SDK",
5
5
  "type": "module",
6
6
  "bin": {