caido.cr

Crystal language client library for Caido, a lightweight web security auditing toolkit.

Features

Installation

Add this to your application's shard.yml:

dependencies:
  caido-crystal:
    github: hahwul/caido-crystal

Run shards install to install dependencies.

Quick Start

Basic Usage

require "caido-crystal"

# Initialize the client
client = CaidoClient.new "http://localhost:8080/graphql"

# Get all requests
query = CaidoQueries::Requests.all(first: 50)
response = client.query query
puts response

# Get sitemap root entries
query = CaidoQueries::Sitemap.root_entries
response = client.query query
puts response

Authentication

Set the authentication token via environment variable:

export CAIDO_AUTH_TOKEN="your-token-here"

Or provide custom headers:

headers = {"Authorization" => "Bearer your-token-here"}
client = CaidoClient.new "http://localhost:8080/graphql", headers

Examples

See the example/ directory for usage examples:

Available Endpoints

The library includes helper modules for common operations:

Query Modules (CaidoQueries)

Mutation Modules (CaidoMutations)

For complete documentation of all available endpoints, see ENDPOINTS.md.

Documentation

Development

Build the project:

shards build

Run tests:

crystal spec

Contributing

  1. Fork it (https://github.com/hahwul/caido-crystal/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

License

MIT License - see LICENSE file for details