deepgram-enterprise-rbac
БесплатноБез исполняемых скриптовНе проверенConfigure enterprise role-based access control for Deepgram integrations. Use when implementing team permissions, managing API key scopes, or setting up…
от jeremylongshore★ 2 961 звезда на GitHubОб этом скилле
Deepgram Enterprise RBAC
Prerequisites
- A verified identity source, named project/role owners, least-privilege role map, and access-review schedule.
- Authority to provision/revoke users and service credentials through approved identity/admin paths.
Examples
Grant a transcription service account only the development project scope it needs, validate its permitted action with a synthetic fixture, and record the owner and expiration/review date. Confirm that the same identity cannot access production; on role mismatch, revoke the broad assignment and correct the group mapping before further use.
Overview
Role-based access control for enterprise Deepgram deployments. Maps five application roles to Deepgram API key scopes, implements scoped key provisioning via the Deepgram Management API, Express permission middleware, team management with auto-provisioned keys, and automated key rotation.
Deepgram Scope Reference
| Scope | Permission | Used By |
|---|---|---|
member |
Full access (all scopes) | Admin only |
listen |
STT transcription | Developers, Services |
speak |
TTS synthesis | Developers, Services |
manage |
Project/key management | Admin |
usage:read |
View usage metrics | Analysts, Auditors |
keys:read |
List API keys | Auditors |
keys:write |
Create/delete keys | Admin |
Instructions
Step 1: Define Roles and Scope Mapping
interface Role {
name: string;
deepgramScopes: string[];
keyExpiry: number; // Days
description: string;
}
const ROLES: Record<string, Role> = {
admin: {
name: 'Admin',
deepgramScopes: ['member'],
keyExpiry: 90,
description: 'Full access — project and key management',
},
developer: {
name: 'Developer',
deepgramScopes: ['listen', 'speak'],
keyExpiry: 90,
description: 'STT and TTS — no management access',
},
analyst: {
name: 'Analyst',
deepgramScopes: ['usage:read'],
keyExpiry: 365,
description: 'Read-only usage metrics',
},
service: {
name: 'Service Account',
deepgramScopes: ['listen'],
keyExpiry: 90,
description: 'STT only — for automated systems',
},
auditor: {
name: 'Auditor',
deepgramScopes: ['usage:read', 'keys:read'],
keyExpiry: 30,
description: 'Read-only audit access',
},
};
Step 2: Scoped Key Provisioning
import { createClient } from '@deepgram/sdk';
class DeepgramKeyManager {
private admin: ReturnType<typeof createClient>;
private projectId: string;
constructor(adminKey: string, projectId: string) {
this.admin = createClient(adminKey);
this.projectId = projectId;
}
async createScopedKey(userId: string, roleName: string): Promise<{
keyId: string;
key: string;
scopes: string[];
expiresAt: string;
}> {
const role = ROLES[roleName];
if (!role) throw new Error(`Unknown role: ${roleName}`);
const expirationDate = new Date(Date.now() + role.keyExpiry * 86400000);
const { result, error } = await this.admin.manage.createProjectKey(
this.projectId,
{
comment: `${roleName}:${userId}:${new Date().toISOString().split('T')[0]}`,
scopes: role.deepgramScopes,
expiration_date: expirationDate.toISOString(),
}
);
if (error) throw new Error(`Key creation failed: ${error.message}`);
console.log(`Created ${roleName} key for ${userId} (expires ${expirationDate.toISOString().split('T')[0]})`);
return {
keyId: result.key_id,
key: result.key,
scopes: role.deepgramScopes,
expiresAt: expirationDate.toISOString(),
};
}
async revokeKey(keyId: string) {
const { error } = await this.admin.manage.deleteProjectKey(
this.projectId, keyId
);
if (error) throw new Error(`Key revocation failed: ${error.message}`);
console.log(`Revoked key: ${keyId}`);
}
async listKeys() {
const { result, error } = await this.admin.manage.getProjectKeys(this.projectId);
if (error) throw error;
return result.api_keys.map((k: any) => ({
keyId: k.api_key_id,
comment: k.comment,
scopes: k.scopes,
created: k.created,
expiration: k.expiration_date,
}));
}
}
Step 3: Permission Middleware
import { Request, Response, NextFunction } from 'express';
interface AuthenticatedRequest extends Request {
user?: { id: string; role: string; deepgramKeyId: string };
}
function requireRole(...allowedRoles: string[]) {
return (req: AuthenticatedRequest, res: Response, next: NextFunction) => {
if (!req.user) {
return res.status(401).json({ error: 'Authentication required' });
}
if (!allowedRoles.includes(req.user.role)) {
console.warn(`Access denied: user ${req.user.id} (${req.user.role}) tried to access ${req.path}`);
return res.status(403).json({
error: 'Insufficient permissions',
required: allowedRoles,
current: req.u
Установить deepgram-enterprise-rbac в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBash(curl:*)Вложенные файлы
FAQ
Что делает скилл deepgram-enterprise-rbac?
Configure enterprise role-based access control for Deepgram integrations. Use when implementing team permissions, managing API key scopes, or setting up organization-level access controls. Trigger: "deepgram RBAC", "deepgram permissions", "deepgram access control", "deepgram team roles", "deepgram enterprise", "deepgram key scopes".
Как установить скилл deepgram-enterprise-rbac?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл deepgram-enterprise-rbac запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic