tradmangh-key-expiry-tracker

TotalClaw 作者 totalclaw

仅追踪 API 密钥/证书过期日期(元数据),在到期前发出提醒,不存储凭据值。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~tradmangh-key-expiry-tracker
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~tradmangh-key-expiry-tracker/file -o tradmangh-key-expiry-tracker.md
## 概述(中文)

仅追踪 API 密钥/证书过期日期(元数据),在到期前发出提醒,不存储凭据值。

## 技能正文

# 密钥过期追踪器

仅追踪 API 密钥/客户端密钥/证书的**过期日期**(元数据),并在它们过期前发出提醒。

## 说明

密钥过期追踪器通过**仅追踪**凭据(API 密钥、客户端密钥、证书)的**过期日期**并提前提醒你,从而帮助你避免服务中断。

**它从不存储、读取或传输任何凭据值** —— 你在本地维护一份带有标签和过期时间戳的 JSON 列表。

**令牌成本:** 每次运行约 200-500 个令牌(cron + 简单的 JSON 解析)。

## 用法

### 添加新凭据

编辑 `~/.openclaw/workspace/.credentials.json`:

```json
{
  "credentials": [
    {
      "name": "Azure OpenClaw Calendar",
      "type": "client-secret",
      "expires": "2026-03-15T00:00:00Z",
      "provider": "Microsoft Azure",
      "notes": "For M365 calendar integration"
    }
  ]
}
```

### 手动运行检查

```bash
~/.openclaw/workspace/skills/key-expiry-tracker/scripts/check-credentials.sh
```

### Cron 计划

每周日 10:00:

```
cron add --name "key-expiry-tracker" \
  --schedule "0 10 * * 0" \
  --payload '{"kind":"systemEvent","text":"Run key-expiry-tracker weekly check"}' \
  --sessionTarget main
```

## 凭据类型

- `client-secret`:Azure AD、API 密钥
- `api-key`:第三方 API(OpenAI 等)
- `certificate`:SSL/TLS 证书
- `token`:OAuth 令牌、刷新令牌
- `password`:带过期时间的密码

## 提醒阈值

- **14 天**:警告(黄色)
- **7 天**:紧急(红色)
- **已过期**:已经过期!

## JSON 结构

```json
{
  "credentials": [
    {
      "name": "string (required)",
      "type": "client-secret|api-key|certificate|token|password",
      "expires": "ISO-8601 timestamp (required)",
      "provider": "string (optional)",
      "renewed": "ISO-8601 timestamp (optional, last renewal)",
      "notes": "string (optional)"
    }
  ]
}
```