{% extends "base.html" %} {% block title %}API Tokens — {{ project.name }} — Fossilrepo{% endblock %} {% block content %}

{{ project.name }}

{% include "fossil/_project_nav.html" %}

API Tokens

Tokens for CI/CD systems and automation. Used with Bearer authentication.

Generate Token
{% if tokens %}
{% for token in tokens %}
{{ token.name }} {{ token.token_prefix }}...
Permissions: {{ token.permissions }} Created {{ token.created_at|timesince }} ago {% if token.last_used_at %} Last used {{ token.last_used_at|timesince }} ago {% else %} Never used {% endif %} {% if token.expires_at %} Expires {{ token.expires_at|date:"Y-m-d" }} {% else %} No expiration {% endif %}
{% csrf_token %}
{% endfor %}
{% else %}

{% if search %}No tokens matching "{{ search }}".{% else %}No API tokens generated yet.{% endif %}

{% if not search %} Generate the first token {% endif %}
{% endif %} {% include "includes/_pagination.html" %}

Usage

Use the token with the CI Status API:

curl -X POST {{ request.scheme }}://{{ request.get_host }}/projects/{{ project.slug }}/fossil/api/status \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"checkin": "abc123", "context": "ci/tests", "state": "success"}'
{% endblock %}