mirror of
https://github.com/danielmiessler/Fabric.git
synced 2026-02-13 15:34:59 -05:00
Add initial set of utility plugins for the template system: - datetime: Date/time formatting and manipulation - fetch: HTTP content retrieval and processing - file: File system operations and content handling - sys: System information and environment access - text: String manipulation and formatting operations Each plugin includes: - Implementation with comprehensive test coverage - Markdown documentation of capabilities - Integration with template package This builds on the template system to provide practical utility functions while maintaining a focused scope for the initial plugin release.
39 lines
828 B
Markdown
39 lines
828 B
Markdown
# Fetch Plugin Tests
|
|
|
|
Simple test file for validating fetch plugin functionality.
|
|
|
|
## Basic Fetch Operations
|
|
|
|
```
|
|
Raw Content:
|
|
{{plugin:fetch:get:https://raw.githubusercontent.com/user/repo/main/README.md}}
|
|
|
|
JSON API:
|
|
{{plugin:fetch:get:https://api.example.com/data.json}}
|
|
```
|
|
|
|
## Error Cases
|
|
These should produce appropriate error messages:
|
|
|
|
```
|
|
Invalid Operation:
|
|
{{plugin:fetch:invalid:https://example.com}}
|
|
|
|
Invalid URL:
|
|
{{plugin:fetch:get:not-a-url}}
|
|
|
|
Non-text Content:
|
|
{{plugin:fetch:get:https://example.com/image.jpg}}
|
|
|
|
Server Error:
|
|
{{plugin:fetch:get:https://httpstat.us/500}}
|
|
```
|
|
|
|
## Security Considerations
|
|
|
|
- Only use trusted URLs
|
|
- Be aware of rate limits
|
|
- Content is limited to 1MB
|
|
- Only text content types are allowed
|
|
- Consider URL allow listing in production
|
|
- Validate and sanitize fetched content before use |