Skip to content

Commit cf2b010

Browse files
committed
fix document
1 parent ba0221c commit cf2b010

13 files changed

Lines changed: 823 additions & 39 deletions

File tree

‎docs/advanced/index.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ Production topics for **CipherToken** — the next-generation token engine.
44

55
## Topics
66

7-
- [Async Usage](async.md) — Full async API with Tokio under the hood
8-
- [Security Best Practices](security.md) — Key management, rotation, algorithm selection
7+
<div class="grid cards" markdown>
8+
9+
- :fontawesome-solid-bolt: [Async Usage](async.md)
10+
11+
- :fontawesome-solid-shield: [Security Best Practices](security.md)
12+
13+
</div>
914

1015
---
1116

‎docs/getting-started/index.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ Developed and maintained by **[Cipher-Unit](https://cipherunit.xyz/)**.
5050

5151
<div class="grid cards" markdown>
5252

53-
- [Installation](installation.md) — pip, poetry, and other package managers
54-
- [Quick Start](quick-start.md) — Your first tokens in under 2 minutes
55-
- [API Reference](../reference/index.md) — Complete API documentation
53+
- :fontawesome-solid-download: [Installation](installation.md)
54+
55+
- :fontawesome-solid-bolt: [Quick Start](quick-start.md)
56+
57+
- :fontawesome-solid-book: [API Reference](../reference/index.md)
5658

5759
</div>

‎docs/getting-started/quick-start.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ token = CipherToken(
2020
```
2121

2222
!!! warning "Never hardcode secrets"
23-
Use environment variables or a secret manager in production. See the [Security guide](../advanced/security.md).
23+
Use environment variables or a secret manager in production. See the [Security guide](../advanced/security.md).
2424

2525
---
2626

‎docs/index.md‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# CipherToken
2+
3+
**CipherToken** is a next-generation token engine for developers who demand speed, security, and reliability. Unlike conventional JWT libraries, CipherToken delivers a complete token lifecycle — from creation and decoding to rotation and expiry tracking — all backed by the raw performance of **Rust**.
4+
5+
---
6+
7+
## Why CipherToken?
8+
9+
| | Conventional JWT Libraries | CipherToken |
10+
|---|---|---|
11+
| **Language** | Pure Python | Rust + PyO3 |
12+
| **Performance** | Interpreted overhead | Near-native speed |
13+
| **Async** | Often limited or absent | Fully async (Tokio) |
14+
| **Token lifecycle** | Generate / verify | Create · Decode · Verify · Rotate · Inspect |
15+
| **Key management** | Manual | Built-in HMAC + RSA key generation |
16+
| **Expiry tracking** | Manual | Built-in (`remaining_time`) |
17+
18+
---
19+
20+
## Quick Install
21+
22+
```bash
23+
pip install ciphertoken
24+
```
25+
26+
---
27+
28+
## Quick Example
29+
30+
```python
31+
from ciphertoken import CipherToken
32+
from ciphertoken.algorithms import HS256
33+
from ciphertoken.time import minutes, days
34+
from ciphertoken.jwt import access, refresh, rotation
35+
36+
token = CipherToken(
37+
secret="your-strong-secret-key",
38+
algorithm=HS256,
39+
access_ttl=minutes(10),
40+
refresh_ttl=days(7),
41+
)
42+
43+
access_token = access(token, payload={"user_id": 42})
44+
refresh_token = refresh(token, payload={"user_id": 42})
45+
new_access, new_refresh = rotation(token, refresh_token)
46+
47+
print(token.verify(access_token)) # True
48+
```
49+
50+
---
51+
52+
## Get Started
53+
54+
<div class="grid cards" markdown>
55+
56+
- :fontawesome-solid-download: [Installation](getting-started/installation.md) — pip, poetry, pdm, and more
57+
58+
- :fontawesome-solid-bolt: [Quick Start](getting-started/quick-start.md) — Your first tokens in under 2 minutes
59+
60+
- :fontawesome-solid-book: [API Reference](reference/index.md) — Complete module documentation
61+
62+
- :fontawesome-solid-gear: [Advanced Guide](advanced/index.md) — Production best practices
63+
64+
</div>

‎docs/logo.png‎

84.8 KB
Loading

‎docs/reference/index.md‎

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,29 @@ ciphertoken/
1414
└── jwt # High-level JWT convenience functions
1515
```
1616

17-
| Module | Description | API Lookup |
18-
|--------|-------------|------------|
19-
| [`CipherToken`](ciphertoken.md) | Main class — sync and async methods | [⇗](api-lookup.md) |
20-
| [`secret`](secret.md) | HMAC secret and RSA key pair generation | [⇗](api-lookup.md) |
21-
| [`time`](time.md) | UNIX timestamp and TTL utilities | [⇗](api-lookup.md) |
22-
| [`utils`](utils.md) | Shared constants | [⇗](api-lookup.md) |
23-
| [`algorithms`](algorithms.md) | Algorithm constants | [⇗](api-lookup.md) |
24-
| [`jwt`](jwt.md) | High-level JWT helpers (sync + async) | [⇗](api-lookup.md) |
17+
<div class="grid cards" markdown>
18+
19+
- :fontawesome-solid-key: [CipherToken](ciphertoken.md)
20+
21+
- :fontawesome-solid-lock: [secret](secret.md)
22+
23+
- :fontawesome-solid-clock: [time](time.md)
24+
25+
- :fontawesome-solid-cog: [utils](utils.md)
26+
27+
- :fontawesome-solid-shield-halved: [algorithms](algorithms.md)
28+
29+
- :fontawesome-solid-file-code: [jwt](jwt.md)
30+
31+
</div>
32+
33+
| Module | API Lookup |
34+
|--------|-------------|
35+
| CipherToken | [⇗](api-lookup.md) |
36+
| secret | [⇗](api-lookup.md) |
37+
| time | [⇗](api-lookup.md) |
38+
| utils | [⇗](api-lookup.md) |
39+
| algorithms | [⇗](api-lookup.md) |
40+
| jwt | [⇗](api-lookup.md) |
2541

2642
> **New here?** Start with the [Quick Start](../getting-started/quick-start.md).

‎site/advanced/index.html‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,16 @@
519519
<h1 id="advanced-guide">Advanced Guide<a class="headerlink" href="#advanced-guide" title="Permanent link">&para;</a></h1>
520520
<p>Production topics for <strong>CipherToken</strong> — the next-generation token engine.</p>
521521
<h2 id="topics">Topics<a class="headerlink" href="#topics" title="Permanent link">&para;</a></h2>
522+
<div class="grid cards">
522523
<ul>
523-
<li><a href="async/">Async Usage</a> — Full async API with Tokio under the hood</li>
524-
<li><a href="security/">Security Best Practices</a> — Key management, rotation, algorithm selection</li>
524+
<li>
525+
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc.--><path fill="currentColor" d="M338.8-9.9c11.9 8.6 16.3 24.2 10.9 37.8L271.3 224H416c13.5 0 25.5 8.4 30.1 21.1s.7 26.9-9.6 35.5l-288 240c-11.3 9.4-27.4 9.9-39.3 1.3s-16.3-24.2-10.9-37.8L176.7 288H32c-13.5 0-25.5-8.4-30.1-21.1s-.7-26.9 9.6-35.5l288-240c11.3-9.4 27.4-9.9 39.3-1.3"/></svg></span> <a href="async/">Async Usage</a></p>
526+
</li>
527+
<li>
528+
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc.--><path fill="currentColor" d="M256 0c4.6 0 9.2 1 13.4 2.9l188.4 79.9c22 9.3 38.4 31 38.3 57.2-.5 99.2-41.3 280.7-213.6 363.2-16.7 8-36.1 8-52.8 0C57.3 420.7 16.6 239.2 16.1 140c-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.9 1 251.4 0 256 0"/></svg></span> <a href="security/">Security Best Practices</a></p>
529+
</li>
525530
</ul>
531+
</div>
526532
<hr />
527533
<h2 id="async-first">Async First<a class="headerlink" href="#async-first" title="Permanent link">&para;</a></h2>
528534
<p>Developed by <strong><a href="https://cipherunit.xyz/">Cipher-Unit</a></strong>. Every sync method has an async twin, backed by <strong>Tokio</strong>. No secondary package, no compatibility layers — it is part of the core engine.</p>

‎site/getting-started/index.html‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,15 @@ <h2 id="project">Project<a class="headerlink" href="#project" title="Permanent l
657657
<p>Developed and maintained by <strong><a href="https://cipherunit.xyz/">Cipher-Unit</a></strong>.</p>
658658
<div class="grid cards">
659659
<ul>
660-
<li><a href="installation/">Installation</a> — pip, poetry, and other package managers</li>
661-
<li><a href="quick-start/">Quick Start</a> — Your first tokens in under 2 minutes</li>
662-
<li><a href="../reference/">API Reference</a> — Complete API documentation</li>
660+
<li>
661+
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc.--><path fill="currentColor" d="M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32v210.7l-41.4-41.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 242.7zM64 320c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64h320c35.3 0 64-28.7 64-64v-32c0-35.3-28.7-64-64-64h-46.9l-56.6 56.6c-31.2 31.2-81.9 31.2-113.1 0L110.9 320zm304 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48"/></svg></span> <a href="installation/">Installation</a></p>
662+
</li>
663+
<li>
664+
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc.--><path fill="currentColor" d="M338.8-9.9c11.9 8.6 16.3 24.2 10.9 37.8L271.3 224H416c13.5 0 25.5 8.4 30.1 21.1s.7 26.9-9.6 35.5l-288 240c-11.3 9.4-27.4 9.9-39.3 1.3s-16.3-24.2-10.9-37.8L176.7 288H32c-13.5 0-25.5-8.4-30.1-21.1s-.7-26.9 9.6-35.5l288-240c11.3-9.4 27.4-9.9 39.3-1.3"/></svg></span> <a href="quick-start/">Quick Start</a></p>
665+
</li>
666+
<li>
667+
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc.--><path fill="currentColor" d="M384 512H96c-53 0-96-43-96-96V96C0 43 43 0 96 0h304c26.5 0 48 21.5 48 48v288c0 20.9-13.4 38.7-32 45.3V448c17.7 0 32 14.3 32 32s-14.3 32-32 32zM96 384c-17.7 0-32 14.3-32 32s14.3 32 32 32h256v-64zm32-232c0 13.3 10.7 24 24 24h176c13.3 0 24-10.7 24-24s-10.7-24-24-24H152c-13.3 0-24 10.7-24 24m24 72c-13.3 0-24 10.7-24 24s10.7 24 24 24h176c13.3 0 24-10.7 24-24s-10.7-24-24-24z"/></svg></span> <a href="../reference/">API Reference</a></p>
668+
</li>
663669
</ul>
664670
</div>
665671

0 commit comments

Comments
 (0)