Skip to content

Commit 56c88b8

Browse files
committed
docs: refine tone and messaging
- Focus on speed and scalability - Remove enterprise terminology - Add concrete performance tips - Emphasize quick time-to-value - Streamline multi-tenant setup - Improve code examples
1 parent 1398227 commit 56c88b8

File tree

3 files changed

+50
-92
lines changed

3 files changed

+50
-92
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# KeyHippo
22

3-
Add powerful, secure API key authentication to your Supabase project.
3+
Industrial-strength API key auth for modern Postgres applications.
44

55
<!-- markdownlint-disable-next-line -->
66
<div align="center">
@@ -13,15 +13,15 @@ Add powerful, secure API key authentication to your Supabase project.
1313

1414
## What is KeyHippo?
1515

16-
KeyHippo extends Supabase with industrial-strength API key authentication that works seamlessly with Row Level Security (RLS) and Role-Based Access Control (RBAC).
16+
KeyHippo adds production-ready API key authentication to Supabase that works seamlessly with Row Level Security (RLS) and Role-Based Access Control (RBAC).
1717

1818
### Key Features
1919

20-
- **Easy Integration**: Works directly with your existing Supabase setup
21-
- **🔒 Security First**: Zero plaintext storage, high-entropy keys, audit logging
22-
- **🎯 Fine-Grained Control**: Tenant isolation, role-based access, custom claims
23-
- **⚡ High Performance**: Pure SQL implementation, optimized queries
24-
- **🛠️ Developer Friendly**: Clear APIs, comprehensive docs, real-world patterns
20+
- **Instant Setup**: 2-minute setup, immediate value
21+
- **🔒 Production Ready**: Built-in audit logs, key rotation, tenant isolation
22+
- **🎯 Scale With You**: From prototype to millions of users
23+
- **⚡ High Performance**: Pure SQL, no extra services
24+
- **🛠️ Developer Experience**: Clear APIs, real examples, zero friction
2525

2626
## Quick Start
2727

@@ -69,16 +69,16 @@ curl -X GET 'https://your-project.supabase.co/rest/v1/resources' \
6969
## Documentation
7070

7171
### Getting Started
72-
- [🚀 QuickStart Guide](docs/guides/quickstart.md) - Basic setup and usage
73-
- [🏢 Enterprise Guide](docs/guides/enterprise_quickstart.md) - Multi-tenant setup
72+
- [🚀 5-Minute Quickstart](docs/guides/quickstart.md) - From zero to working API keys
73+
- [🏢 Multi-Tenant Setup](docs/guides/multi_tenant_quickstart.md) - Scale with your user base
7474

7575
### Implementation Guides
76-
- [🔑 API Key Patterns](docs/guides/api_key_patterns.md) - Common implementation patterns
77-
- [🏠 Multi-Tenant Guide](docs/guides/multi_tenant.md) - Tenant isolation patterns
76+
- [🔑 API Key Patterns](docs/guides/api_key_patterns.md) - Real-world implementation patterns
77+
- [🏠 Tenant Isolation](docs/guides/multi_tenant.md) - Clean multi-tenant architecture
7878

7979
### Reference
8080
- [📚 API Documentation](docs/api/index.md) - Complete API reference
81-
- [🛡️ Security Guide](docs/api/security/rls_policies.md) - Security best practices
81+
- [🛡️ Security Guide](docs/api/security/rls_policies.md) - Production security
8282

8383
## Development
8484

@@ -113,7 +113,7 @@ We welcome contributions! Before submitting a PR:
113113
- [📝 Issues](https://github.com/integrated-reasoning/KeyHippo/issues) - Bug reports and features
114114
- [🤝 Discussions](https://github.com/integrated-reasoning/KeyHippo/discussions) - Questions and ideas
115115
- [🔒 Security](SECURITY.md) - Vulnerability reporting
116-
- [💼 Enterprise](https://keyhippo.com) - Commercial support
116+
- [💼 Pro Support](https://keyhippo.com) - Priority support & custom features
117117

118118
## License
119119

docs/api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# KeyHippo API Reference
22

3-
Complete reference documentation for KeyHippo's API.
3+
Production-ready API reference for fast-moving teams.
44

55
## Core Concepts
66

docs/guides/enterprise_quickstart.md renamed to docs/guides/multi_tenant_quickstart.md

Lines changed: 36 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
# Enterprise QuickStart Guide
1+
# Multi-Tenant Quickstart
22

3-
Implementation guide for setting up KeyHippo in a multi-tenant enterprise environment.
3+
Scale your application with clean tenant isolation and robust access controls.
44

5-
## Prerequisites
6-
7-
- PostgreSQL 14 or higher
8-
- Supabase Enterprise or self-hosted setup
9-
- Database superuser access
10-
- Basic understanding of RBAC concepts
11-
12-
## Architecture Overview
5+
## Overview
136

147
```mermaid
158
graph TD
@@ -20,7 +13,7 @@ graph TD
2013
F[Admin] -->|Impersonation| B
2114
```
2215

23-
## Installation
16+
## Setup
2417

2518
1. Install dependencies:
2619
```sql
@@ -34,7 +27,7 @@ CREATE EXTENSION IF NOT EXISTS pg_cron;
3427
\i sql/keyhippo.sql
3528
```
3629

37-
## Tenant Setup
30+
## Tenant Architecture
3831

3932
1. Create tenant tables:
4033
```sql
@@ -59,41 +52,7 @@ ALTER TABLE tenants ENABLE ROW LEVEL SECURITY;
5952
ALTER TABLE tenant_members ENABLE ROW LEVEL SECURITY;
6053
```
6154

62-
## RBAC Configuration
63-
64-
1. Create tenant-specific groups:
65-
```sql
66-
DO $$
67-
DECLARE
68-
tenant_group_id uuid;
69-
BEGIN
70-
-- Create tenant admin group
71-
SELECT keyhippo_rbac.create_group(
72-
'Tenant Administrators',
73-
'Tenant-level administrative access'
74-
) INTO tenant_group_id;
75-
76-
-- Create admin role
77-
PERFORM keyhippo_rbac.create_role(
78-
'Tenant Admin',
79-
'Full tenant access',
80-
tenant_group_id,
81-
'admin'
82-
);
83-
END $$;
84-
```
85-
86-
2. Set up permissions:
87-
```sql
88-
-- Add tenant management permissions
89-
INSERT INTO keyhippo_rbac.permissions (name, description)
90-
VALUES
91-
('tenant:admin', 'Full tenant access'),
92-
('tenant:member', 'Basic tenant access'),
93-
('tenant:read', 'Read-only tenant access');
94-
```
95-
96-
## Access Control Implementation
55+
## Access Control
9756

9857
1. Create tenant access function:
9958
```sql
@@ -142,7 +101,7 @@ CREATE POLICY resource_tenant_policy ON resource_table
142101
USING (has_tenant_access(tenant_id));
143102
```
144103

145-
## API Key Management
104+
## API Keys
146105

147106
1. Create tenant-specific API key:
148107
```sql
@@ -181,7 +140,7 @@ END;
181140
$$;
182141
```
183142

184-
## Monitoring Setup
143+
## Security
185144

186145
1. Enable audit logging:
187146
```sql
@@ -192,40 +151,17 @@ VALUES
192151
('audit_retention_days', '90');
193152
```
194153

195-
2. Create audit views:
196-
```sql
197-
CREATE VIEW tenant_audit_log AS
198-
SELECT
199-
a.*,
200-
(a.data->'claims'->>'tenant_id')::uuid as tenant_id
201-
FROM keyhippo.audit_log a
202-
WHERE a.data ? 'tenant_id';
203-
```
204-
205-
## Security Hardening
206-
207-
1. Configure key expiration:
154+
2. Configure key expiration:
208155
```sql
209156
-- Set default key expiration to 90 days
210157
UPDATE keyhippo_internal.config
211158
SET value = '90'
212159
WHERE key = 'key_expiry_notification_hours';
213160
```
214161

215-
2. Enable automatic key rotation:
216-
```sql
217-
SELECT cron.schedule(
218-
'rotate-tenant-keys',
219-
'0 0 * * 0',
220-
$$
221-
SELECT rotate_expired_tenant_keys();
222-
$$
223-
);
224-
```
225-
226-
## Testing Setup
162+
## Testing
227163

228-
1. Create test tenant:
164+
1. Set up test data:
229165
```sql
230166
DO $$
231167
DECLARE
@@ -234,7 +170,7 @@ DECLARE
234170
BEGIN
235171
-- Create test tenant
236172
INSERT INTO tenants (name)
237-
VALUES ('Test Tenant')
173+
VALUES ('Acme Corp')
238174
RETURNING id INTO tenant_id;
239175

240176
-- Create test user
@@ -248,7 +184,7 @@ BEGIN
248184
END $$;
249185
```
250186

251-
2. Verify setup:
187+
2. Test the setup:
252188
```sql
253189
-- Create test API key
254190
SELECT create_tenant_api_key(
@@ -260,6 +196,28 @@ SELECT create_tenant_api_key(
260196
SELECT has_tenant_access('tenant_id_here');
261197
```
262198

199+
## Performance Tips
200+
201+
1. **Index Critical Fields**
202+
```sql
203+
CREATE INDEX idx_tenant_members_user_id
204+
ON tenant_members(user_id);
205+
206+
CREATE INDEX idx_resources_tenant_id
207+
ON resources(tenant_id);
208+
```
209+
210+
2. **Batch Operations**
211+
```sql
212+
-- Example: Bulk user assignment
213+
INSERT INTO tenant_members (tenant_id, user_id, role)
214+
SELECT
215+
tenant_id,
216+
unnest(user_ids) as user_id,
217+
'member' as role
218+
FROM json_array_elements_text('["user1", "user2"]') as user_ids;
219+
```
220+
263221
## Next Steps
264222

265223
- Implement [Custom Claims](../api/functions/update_key_claims.md)
@@ -268,6 +226,6 @@ SELECT has_tenant_access('tenant_id_here');
268226

269227
## Related Resources
270228

271-
- [Multi-Tenant Guide](multi_tenant.md)
272229
- [API Key Patterns](api_key_patterns.md)
230+
- [Multi-Tenant Guide](multi_tenant.md)
273231
- [Security Best Practices](../api/security/rls_policies.md)

0 commit comments

Comments
 (0)