From fff47ae6b0c1a9088f1fbf882a7b390ffa7ee522 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 19 Aug 2025 19:28:22 +0000
Subject: [PATCH 1/7] Initial plan
From 79b00f14d7a076ea61879e28b0c2d3ec7c2cd01e Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 19 Aug 2025 19:37:44 +0000
Subject: [PATCH 2/7] Add complete ReadTheDocs documentation with Sphinx
Co-authored-by: djw8605 <79268+djw8605@users.noreply.github.com>
---
.readthedocs.yml | 18 +
Doxyfile | 51 +
docs/Makefile | 20 +
docs/README.md | 60 +
docs/_build/doxygen/xml/Doxyfile.xml | 354 +++
docs/_build/doxygen/xml/combine.xslt | 15 +
docs/_build/doxygen/xml/compound.xsd | 1635 ++++++++++
.../dir_68267d1309a1af8e8297ef4c3efbcdba.xml | 12 +
docs/_build/doxygen/xml/doxyfile.xsd | 45 +
docs/_build/doxygen/xml/index.xml | 77 +
docs/_build/doxygen/xml/index.xsd | 72 +
docs/_build/doxygen/xml/scitokens_8h.xml | 2225 ++++++++++++++
docs/_build/doxygen/xml/structAcl__s.xml | 49 +
docs/_build/doxygen/xml/xml.xsd | 23 +
docs/_build/html/.buildinfo | 4 +
docs/_build/html/.doctrees/api.doctree | Bin 0 -> 296322 bytes
docs/_build/html/.doctrees/environment.pickle | Bin 0 -> 258056 bytes
docs/_build/html/.doctrees/examples.doctree | Bin 0 -> 20641 bytes
docs/_build/html/.doctrees/index.doctree | Bin 0 -> 7997 bytes
.../html/.doctrees/installation.doctree | Bin 0 -> 13762 bytes
docs/_build/html/_sources/api.rst.txt | 8 +
docs/_build/html/_sources/examples.rst.txt | 285 ++
docs/_build/html/_sources/index.rst.txt | 38 +
.../_build/html/_sources/installation.rst.txt | 68 +
.../_sphinx_javascript_frameworks_compat.js | 123 +
docs/_build/html/_static/basic.css | 906 ++++++
docs/_build/html/_static/css/badge_only.css | 1 +
.../_static/css/fonts/Roboto-Slab-Bold.woff | Bin 0 -> 87624 bytes
.../_static/css/fonts/Roboto-Slab-Bold.woff2 | Bin 0 -> 67312 bytes
.../css/fonts/Roboto-Slab-Regular.woff | Bin 0 -> 86288 bytes
.../css/fonts/Roboto-Slab-Regular.woff2 | Bin 0 -> 66444 bytes
.../_static/css/fonts/fontawesome-webfont.eot | Bin 0 -> 165742 bytes
.../_static/css/fonts/fontawesome-webfont.svg | 2671 +++++++++++++++++
.../_static/css/fonts/fontawesome-webfont.ttf | Bin 0 -> 165548 bytes
.../css/fonts/fontawesome-webfont.woff | Bin 0 -> 98024 bytes
.../css/fonts/fontawesome-webfont.woff2 | Bin 0 -> 77160 bytes
.../_static/css/fonts/lato-bold-italic.woff | Bin 0 -> 323344 bytes
.../_static/css/fonts/lato-bold-italic.woff2 | Bin 0 -> 193308 bytes
.../html/_static/css/fonts/lato-bold.woff | Bin 0 -> 309728 bytes
.../html/_static/css/fonts/lato-bold.woff2 | Bin 0 -> 184912 bytes
.../_static/css/fonts/lato-normal-italic.woff | Bin 0 -> 328412 bytes
.../css/fonts/lato-normal-italic.woff2 | Bin 0 -> 195704 bytes
.../html/_static/css/fonts/lato-normal.woff | Bin 0 -> 309192 bytes
.../html/_static/css/fonts/lato-normal.woff2 | Bin 0 -> 182708 bytes
docs/_build/html/_static/css/theme.css | 4 +
docs/_build/html/_static/doctools.js | 149 +
.../html/_static/documentation_options.js | 13 +
docs/_build/html/_static/file.png | Bin 0 -> 286 bytes
.../html/_static/fonts/Lato/lato-bold.eot | Bin 0 -> 256056 bytes
.../html/_static/fonts/Lato/lato-bold.ttf | Bin 0 -> 600856 bytes
.../html/_static/fonts/Lato/lato-bold.woff | Bin 0 -> 309728 bytes
.../html/_static/fonts/Lato/lato-bold.woff2 | Bin 0 -> 184912 bytes
.../_static/fonts/Lato/lato-bolditalic.eot | Bin 0 -> 266158 bytes
.../_static/fonts/Lato/lato-bolditalic.ttf | Bin 0 -> 622572 bytes
.../_static/fonts/Lato/lato-bolditalic.woff | Bin 0 -> 323344 bytes
.../_static/fonts/Lato/lato-bolditalic.woff2 | Bin 0 -> 193308 bytes
.../html/_static/fonts/Lato/lato-italic.eot | Bin 0 -> 268604 bytes
.../html/_static/fonts/Lato/lato-italic.ttf | Bin 0 -> 639388 bytes
.../html/_static/fonts/Lato/lato-italic.woff | Bin 0 -> 328412 bytes
.../html/_static/fonts/Lato/lato-italic.woff2 | Bin 0 -> 195704 bytes
.../html/_static/fonts/Lato/lato-regular.eot | Bin 0 -> 253461 bytes
.../html/_static/fonts/Lato/lato-regular.ttf | Bin 0 -> 607720 bytes
.../html/_static/fonts/Lato/lato-regular.woff | Bin 0 -> 309192 bytes
.../_static/fonts/Lato/lato-regular.woff2 | Bin 0 -> 182708 bytes
.../fonts/RobotoSlab/roboto-slab-v7-bold.eot | Bin 0 -> 79520 bytes
.../fonts/RobotoSlab/roboto-slab-v7-bold.ttf | Bin 0 -> 170616 bytes
.../fonts/RobotoSlab/roboto-slab-v7-bold.woff | Bin 0 -> 87624 bytes
.../RobotoSlab/roboto-slab-v7-bold.woff2 | Bin 0 -> 67312 bytes
.../RobotoSlab/roboto-slab-v7-regular.eot | Bin 0 -> 78331 bytes
.../RobotoSlab/roboto-slab-v7-regular.ttf | Bin 0 -> 169064 bytes
.../RobotoSlab/roboto-slab-v7-regular.woff | Bin 0 -> 86288 bytes
.../RobotoSlab/roboto-slab-v7-regular.woff2 | Bin 0 -> 66444 bytes
docs/_build/html/_static/jquery.js | 2 +
docs/_build/html/_static/js/badge_only.js | 1 +
docs/_build/html/_static/js/theme.js | 1 +
docs/_build/html/_static/js/versions.js | 228 ++
docs/_build/html/_static/language_data.js | 192 ++
docs/_build/html/_static/minus.png | Bin 0 -> 90 bytes
docs/_build/html/_static/plus.png | Bin 0 -> 90 bytes
docs/_build/html/_static/pygments.css | 75 +
docs/_build/html/_static/searchtools.js | 635 ++++
docs/_build/html/_static/sphinx_highlight.js | 154 +
docs/_build/html/api.html | 848 ++++++
docs/_build/html/examples.html | 389 +++
docs/_build/html/genindex.html | 308 ++
docs/_build/html/index.html | 220 ++
docs/_build/html/installation.html | 182 ++
docs/_build/html/objects.inv | Bin 0 -> 3752 bytes
docs/_build/html/search.html | 122 +
docs/_build/html/searchindex.js | 1 +
docs/api.rst | 8 +
docs/conf.py | 53 +
docs/examples.rst | 285 ++
docs/index.rst | 38 +
docs/installation.rst | 68 +
docs/requirements.txt | 3 +
src/scitokens.h | 159 +-
97 files changed, 12893 insertions(+), 5 deletions(-)
create mode 100644 .readthedocs.yml
create mode 100644 Doxyfile
create mode 100644 docs/Makefile
create mode 100644 docs/README.md
create mode 100644 docs/_build/doxygen/xml/Doxyfile.xml
create mode 100644 docs/_build/doxygen/xml/combine.xslt
create mode 100644 docs/_build/doxygen/xml/compound.xsd
create mode 100644 docs/_build/doxygen/xml/dir_68267d1309a1af8e8297ef4c3efbcdba.xml
create mode 100644 docs/_build/doxygen/xml/doxyfile.xsd
create mode 100644 docs/_build/doxygen/xml/index.xml
create mode 100644 docs/_build/doxygen/xml/index.xsd
create mode 100644 docs/_build/doxygen/xml/scitokens_8h.xml
create mode 100644 docs/_build/doxygen/xml/structAcl__s.xml
create mode 100644 docs/_build/doxygen/xml/xml.xsd
create mode 100644 docs/_build/html/.buildinfo
create mode 100644 docs/_build/html/.doctrees/api.doctree
create mode 100644 docs/_build/html/.doctrees/environment.pickle
create mode 100644 docs/_build/html/.doctrees/examples.doctree
create mode 100644 docs/_build/html/.doctrees/index.doctree
create mode 100644 docs/_build/html/.doctrees/installation.doctree
create mode 100644 docs/_build/html/_sources/api.rst.txt
create mode 100644 docs/_build/html/_sources/examples.rst.txt
create mode 100644 docs/_build/html/_sources/index.rst.txt
create mode 100644 docs/_build/html/_sources/installation.rst.txt
create mode 100644 docs/_build/html/_static/_sphinx_javascript_frameworks_compat.js
create mode 100644 docs/_build/html/_static/basic.css
create mode 100644 docs/_build/html/_static/css/badge_only.css
create mode 100644 docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff
create mode 100644 docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2
create mode 100644 docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff
create mode 100644 docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2
create mode 100644 docs/_build/html/_static/css/fonts/fontawesome-webfont.eot
create mode 100644 docs/_build/html/_static/css/fonts/fontawesome-webfont.svg
create mode 100644 docs/_build/html/_static/css/fonts/fontawesome-webfont.ttf
create mode 100644 docs/_build/html/_static/css/fonts/fontawesome-webfont.woff
create mode 100644 docs/_build/html/_static/css/fonts/fontawesome-webfont.woff2
create mode 100644 docs/_build/html/_static/css/fonts/lato-bold-italic.woff
create mode 100644 docs/_build/html/_static/css/fonts/lato-bold-italic.woff2
create mode 100644 docs/_build/html/_static/css/fonts/lato-bold.woff
create mode 100644 docs/_build/html/_static/css/fonts/lato-bold.woff2
create mode 100644 docs/_build/html/_static/css/fonts/lato-normal-italic.woff
create mode 100644 docs/_build/html/_static/css/fonts/lato-normal-italic.woff2
create mode 100644 docs/_build/html/_static/css/fonts/lato-normal.woff
create mode 100644 docs/_build/html/_static/css/fonts/lato-normal.woff2
create mode 100644 docs/_build/html/_static/css/theme.css
create mode 100644 docs/_build/html/_static/doctools.js
create mode 100644 docs/_build/html/_static/documentation_options.js
create mode 100644 docs/_build/html/_static/file.png
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-bold.eot
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-bold.ttf
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-bold.woff
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-bold.woff2
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-bolditalic.eot
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-bolditalic.ttf
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff2
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-italic.eot
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-italic.ttf
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-italic.woff
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-italic.woff2
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-regular.eot
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-regular.ttf
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-regular.woff
create mode 100644 docs/_build/html/_static/fonts/Lato/lato-regular.woff2
create mode 100644 docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot
create mode 100644 docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf
create mode 100644 docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff
create mode 100644 docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2
create mode 100644 docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot
create mode 100644 docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf
create mode 100644 docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff
create mode 100644 docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2
create mode 100644 docs/_build/html/_static/jquery.js
create mode 100644 docs/_build/html/_static/js/badge_only.js
create mode 100644 docs/_build/html/_static/js/theme.js
create mode 100644 docs/_build/html/_static/js/versions.js
create mode 100644 docs/_build/html/_static/language_data.js
create mode 100644 docs/_build/html/_static/minus.png
create mode 100644 docs/_build/html/_static/plus.png
create mode 100644 docs/_build/html/_static/pygments.css
create mode 100644 docs/_build/html/_static/searchtools.js
create mode 100644 docs/_build/html/_static/sphinx_highlight.js
create mode 100644 docs/_build/html/api.html
create mode 100644 docs/_build/html/examples.html
create mode 100644 docs/_build/html/genindex.html
create mode 100644 docs/_build/html/index.html
create mode 100644 docs/_build/html/installation.html
create mode 100644 docs/_build/html/objects.inv
create mode 100644 docs/_build/html/search.html
create mode 100644 docs/_build/html/searchindex.js
create mode 100644 docs/api.rst
create mode 100644 docs/conf.py
create mode 100644 docs/examples.rst
create mode 100644 docs/index.rst
create mode 100644 docs/installation.rst
create mode 100644 docs/requirements.txt
diff --git a/.readthedocs.yml b/.readthedocs.yml
new file mode 100644
index 0000000..03548d8
--- /dev/null
+++ b/.readthedocs.yml
@@ -0,0 +1,18 @@
+# ReadTheDocs Configuration File
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+version: 2
+
+build:
+ os: ubuntu-22.04
+ tools:
+ python: "3.11"
+ apt_packages:
+ - doxygen
+
+sphinx:
+ configuration: docs/conf.py
+
+python:
+ install:
+ - requirements: docs/requirements.txt
\ No newline at end of file
diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 0000000..771d003
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,51 @@
+# Doxyfile configuration for SciTokens C++ library
+
+# Project related configuration options
+PROJECT_NAME = "SciTokens C++"
+PROJECT_NUMBER = "1.0.2"
+PROJECT_BRIEF = "A C++ Library to interface to scitokens"
+OUTPUT_DIRECTORY = docs/_build/doxygen
+
+# Build related configuration options
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = NO
+
+# Configuration options related to the input files
+INPUT = src/scitokens.h
+FILE_PATTERNS = *.h *.hpp *.cpp
+RECURSIVE = NO
+EXCLUDE_PATTERNS = */vendor/* */build/* */_build/*
+
+# Configuration options related to source browsing
+SOURCE_BROWSER = YES
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+
+# Configuration options related to the alphabetical class index
+ALPHABETICAL_INDEX = YES
+
+# Configuration options related to the HTML output
+GENERATE_HTML = NO
+GENERATE_LATEX = NO
+GENERATE_XML = YES
+XML_OUTPUT = xml
+
+# Configuration options related to the preprocessor
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = YES
+INCLUDE_PATH = src/
+PREDEFINED = __cplusplus
+
+# Configuration options related to external references
+TAGFILES =
+GENERATE_TAGFILE =
+
+# Configuration options related to the dot tool
+HAVE_DOT = NO
+
+# Configuration options related to the search engine
+SEARCHENGINE = NO
\ No newline at end of file
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..6fb5427
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,20 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line, and also
+# from the environment for the first two.
+SPHINXOPTS ?=
+SPHINXBUILD ?= sphinx-build
+SOURCEDIR = .
+BUILDDIR = _build
+
+# Put it first so that "make" without argument is like "make help".
+help:
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+.PHONY: help Makefile
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
\ No newline at end of file
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000..194d50b
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,60 @@
+# SciTokens C++ Documentation
+
+This directory contains the Sphinx documentation for the SciTokens C++ library.
+
+## Building the Documentation
+
+### Prerequisites
+
+1. Install Python dependencies:
+ ```bash
+ pip install -r requirements.txt
+ ```
+
+2. Install Doxygen (for API extraction):
+ ```bash
+ # Ubuntu/Debian
+ sudo apt install doxygen
+
+ # CentOS/RHEL
+ sudo yum install doxygen
+ ```
+
+### Building
+
+From this directory, run:
+
+```bash
+make html
+```
+
+Or using sphinx-build directly:
+
+```bash
+sphinx-build -b html . _build/html
+```
+
+The generated documentation will be in `_build/html/`.
+
+## Documentation Structure
+
+- `index.rst` - Main documentation page
+- `installation.rst` - Installation and building instructions
+- `api.rst` - API reference (auto-generated from source comments)
+- `examples.rst` - Usage examples
+- `conf.py` - Sphinx configuration
+- `requirements.txt` - Python dependencies
+
+## ReadTheDocs Integration
+
+This documentation is configured for ReadTheDocs. See `.readthedocs.yml` in the project root for the configuration.
+
+The documentation will automatically build when pushed to the repository.
+
+## Adding Examples
+
+Examples in `examples.rst` are based on the test cases in the `test/` directory. When adding new functionality, please:
+
+1. Add appropriate docstring comments to the public API functions in `src/scitokens.h`
+2. Add usage examples to `examples.rst`
+3. Test that the documentation builds without warnings
\ No newline at end of file
diff --git a/docs/_build/doxygen/xml/Doxyfile.xml b/docs/_build/doxygen/xml/Doxyfile.xml
new file mode 100644
index 0000000..6a10a9c
--- /dev/null
+++ b/docs/_build/doxygen/xml/Doxyfile.xml
@@ -0,0 +1,354 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/_build/doxygen/xml/combine.xslt b/docs/_build/doxygen/xml/combine.xslt
new file mode 100644
index 0000000..3bfa82c
--- /dev/null
+++ b/docs/_build/doxygen/xml/combine.xslt
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/_build/doxygen/xml/compound.xsd b/docs/_build/doxygen/xml/compound.xsd
new file mode 100644
index 0000000..e3cf2e5
--- /dev/null
+++ b/docs/_build/doxygen/xml/compound.xsd
@@ -0,0 +1,1635 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The mentioned file will be located in the directory as specified by XML_OUTPUT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/_build/doxygen/xml/dir_68267d1309a1af8e8297ef4c3efbcdba.xml b/docs/_build/doxygen/xml/dir_68267d1309a1af8e8297ef4c3efbcdba.xml
new file mode 100644
index 0000000..e2b183f
--- /dev/null
+++ b/docs/_build/doxygen/xml/dir_68267d1309a1af8e8297ef4c3efbcdba.xml
@@ -0,0 +1,12 @@
+
+
+
+ src
+ scitokens.h
+
+
+
+
+
+
+
diff --git a/docs/_build/doxygen/xml/doxyfile.xsd b/docs/_build/doxygen/xml/doxyfile.xsd
new file mode 100644
index 0000000..fbfc2c1
--- /dev/null
+++ b/docs/_build/doxygen/xml/doxyfile.xsd
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/_build/doxygen/xml/index.xml b/docs/_build/doxygen/xml/index.xml
new file mode 100644
index 0000000..ba6fa91
--- /dev/null
+++ b/docs/_build/doxygen/xml/index.xml
@@ -0,0 +1,77 @@
+
+
+ Acl_s
+ authz
+ resource
+
+ scitokens.h
+ _profile
+ COMPAT
+ SCITOKENS_1_0
+ SCITOKENS_2_0
+ WLCG_1_0
+ AT_JWT
+ SciTokenKey
+ SciToken
+ Validator
+ Enforcer
+ SciTokenStatus
+ Configuration
+ StringValidatorFunction
+ Acl
+ SciTokenProfile
+ scitoken_key_create
+ scitoken_key_destroy
+ scitoken_create
+ scitoken_destroy
+ scitoken_set_claim_string
+ scitoken_get_claim_string
+ scitoken_get_claim_string_list
+ scitoken_free_string_list
+ scitoken_set_claim_string_list
+ scitoken_get_expiration
+ scitoken_set_lifetime
+ scitoken_serialize
+ scitoken_set_serialize_profile
+ scitoken_set_serialize_mode
+ scitoken_set_deserialize_profile
+ scitoken_deserialize
+ scitoken_deserialize_start
+ scitoken_deserialize_continue
+ scitoken_deserialize_v2
+ scitoken_store_public_ec_key
+ validator_create
+ validator_set_token_profile
+ validator_set_time
+ validator_add
+ validator_add_critical_claims
+ validator_validate
+ validator_destroy
+ enforcer_create
+ enforcer_destroy
+ enforcer_set_validate_profile
+ enforcer_set_time
+ enforcer_generate_acls
+ enforcer_generate_acls_start
+ enforcer_generate_acls_continue
+ enforcer_acl_free
+ enforcer_test
+ scitoken_status_free
+ scitoken_status_get_timeout_val
+ scitoken_status_get_read_fd_set
+ scitoken_status_get_write_fd_set
+ scitoken_status_get_exc_fd_set
+ scitoken_status_get_max_fd
+ keycache_refresh_jwks
+ keycache_get_cached_jwks
+ keycache_set_jwks
+ config_set_int
+ scitoken_config_set_int
+ config_get_int
+ scitoken_config_get_int
+ scitoken_config_set_str
+ scitoken_config_get_str
+
+ src
+
+
diff --git a/docs/_build/doxygen/xml/index.xsd b/docs/_build/doxygen/xml/index.xsd
new file mode 100644
index 0000000..6c847cc
--- /dev/null
+++ b/docs/_build/doxygen/xml/index.xsd
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/_build/doxygen/xml/scitokens_8h.xml b/docs/_build/doxygen/xml/scitokens_8h.xml
new file mode 100644
index 0000000..6d6e4d5
--- /dev/null
+++ b/docs/_build/doxygen/xml/scitokens_8h.xml
@@ -0,0 +1,2225 @@
+
+
+
+ scitokens.h
+ sys/select.h
+ time.h
+ ctime
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Acl_s
+
+
+
+ _profile
+
+ COMPAT
+ = 0
+
+
+
+
+
+
+ SCITOKENS_1_0
+
+
+
+
+
+
+ SCITOKENS_2_0
+
+
+
+
+
+
+ WLCG_1_0
+
+
+
+
+
+
+ AT_JWT
+
+
+
+
+
+
+
+
+Determine the mode we will use to validate tokens.
+COMPAT mode (default) indicates any supported token format is acceptable. Where possible, the scope names are translated into equivalent SciTokens 1.0 claim names (i.e., storage.read -> read; storage.write -> write). If a typ header claim is present, use that to deduce type (RFC8725 Section 3.11).
+SCITOKENS_1_0, SCITOKENS_2_0, WLCG_1_0, AT_JWT: only accept these specific profiles. No automatic translation is performed.
+
+
+
+
+
+
+
+
+
+
+ void *
+ typedef void* SciTokenKey
+
+ SciTokenKey
+
+Opaque handle for cryptographic keys used to sign/verify tokens.
+
+
+Public header for the SciTokens C library.
+
+
+
+
+
+
+ void *
+ typedef void* SciToken
+
+ SciToken
+
+Opaque handle for SciToken objects.
+
+
+
+
+
+
+
+
+ void *
+ typedef void* Validator
+
+ Validator
+
+Opaque handle for token validators.
+
+
+
+
+
+
+
+
+ void *
+ typedef void* Enforcer
+
+ Enforcer
+
+Opaque handle for token enforcers that generate ACLs.
+
+
+
+
+
+
+
+
+ void *
+ typedef void* SciTokenStatus
+
+ SciTokenStatus
+
+Opaque handle for asynchronous operation status.
+
+
+
+
+
+
+
+
+ void *
+ typedef void* Configuration
+
+ Configuration
+
+Opaque handle for configuration objects.
+
+
+
+
+
+
+
+
+ int(*
+ typedef int(* StringValidatorFunction) (const char *value, char **err_msg)
+ )(const char *value, char **err_msg)
+ StringValidatorFunction
+
+Function pointer type for custom string validation.
+
+
+
+
+
+
+
+
+ struct [Acl_s]
+ typedef struct Acl_s Acl
+
+ Acl
+
+Access Control List entry containing authorization and resource.
+
+
+
+
+
+
+
+
+ enum [_profile]
+ typedef enum _profile SciTokenProfile
+
+ SciTokenProfile
+
+
+
+Determine the mode we will use to validate tokens.
+COMPAT mode (default) indicates any supported token format is acceptable. Where possible, the scope names are translated into equivalent SciTokens 1.0 claim names (i.e., storage.read -> read; storage.write -> write). If a typ header claim is present, use that to deduce type (RFC8725 Section 3.11).
+SCITOKENS_1_0, SCITOKENS_2_0, WLCG_1_0, AT_JWT: only accept these specific profiles. No automatic translation is performed.
+
+
+
+
+
+
+
+
+
+
+ [SciTokenKey]
+ SciTokenKey scitoken_key_create
+ (const char *key_id, const char *algorithm, const char *public_contents, const char *private_contents, char **err_msg)
+ scitoken_key_create
+
+ const char *
+ key_id
+
+
+ const char *
+ algorithm
+
+
+ const char *
+ public_contents
+
+
+ const char *
+ private_contents
+
+
+ char **
+ err_msg
+
+
+Create a cryptographic key for signing tokens.
+
+
+
+
+key_id
+
+
+Identifier for the key (used in 'kid' header)
+
+
+
+
+algorithm
+
+
+Signing algorithm (e.g., "ES256", "RS256")
+
+
+
+
+
+public_contents
+
+
+PEM-encoded public key
+
+
+
+
+private_contents
+
+
+PEM-encoded private key
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+SciTokenKey handle on success, NULL on failure
+
+
+
+
+
+
+
+
+ void
+ void scitoken_key_destroy
+ (SciTokenKey private_key)
+ scitoken_key_destroy
+
+ [SciTokenKey]
+ private_key
+
+
+Destroy a key object and free associated memory.
+
+
+
+
+private_key
+
+
+Key handle to destroy
+
+
+
+
+
+
+
+
+
+
+ [SciToken]
+ SciToken scitoken_create
+ (SciTokenKey private_key)
+ scitoken_create
+
+ [SciTokenKey]
+ private_key
+
+
+Create a new SciToken.
+
+
+
+
+private_key
+
+
+Key to use for signing, or NULL for unsigned token
+
+
+
+SciToken handle on success, NULL on failure
+
+
+
+
+
+
+
+
+ void
+ void scitoken_destroy
+ (SciToken token)
+ scitoken_destroy
+
+ [SciToken]
+ token
+
+
+Destroy a token object and free associated memory.
+
+
+
+
+token
+
+
+Token handle to destroy
+
+
+
+
+
+
+
+
+
+
+ int
+ int scitoken_set_claim_string
+ (SciToken token, const char *key, const char *value, char **err_msg)
+ scitoken_set_claim_string
+
+ [SciToken]
+ token
+
+
+ const char *
+ key
+
+
+ const char *
+ value
+
+
+ char **
+ err_msg
+
+
+Set a string claim in the token.
+
+
+
+
+token
+
+
+Token to modify
+
+
+
+
+key
+
+
+Claim name (e.g., "iss", "aud", "scope")
+
+
+
+
+value
+
+
+Claim value
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+0 on success, non-zero on failure
+
+
+
+
+
+
+
+
+ int
+ int scitoken_get_claim_string
+ (const SciToken token, const char *key, char **value, char **err_msg)
+ scitoken_get_claim_string
+
+ const [SciToken]
+ token
+
+
+ const char *
+ key
+
+
+ char **
+ value
+
+
+ char **
+ err_msg
+
+
+Get a string claim from the token.
+
+
+
+
+token
+
+
+Token to query
+
+
+
+
+key
+
+
+Claim name to retrieve
+
+
+
+
+value
+
+
+Output parameter for claim value (caller must free)
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+0 on success, non-zero on failure
+
+
+
+
+
+
+
+
+ int
+ int scitoken_get_claim_string_list
+ (const SciToken token, const char *key, char ***value, char **err_msg)
+ scitoken_get_claim_string_list
+
+ const [SciToken]
+ token
+
+
+ const char *
+ key
+
+
+ char ***
+ value
+
+
+ char **
+ err_msg
+
+
+
+
+Given a SciToken object, parse a specific claim's value as a list of strings. If the JSON value is not actually a list of strings - or the claim is not set
+returns an error and sets the err_msg appropriately.
+
+
+The returned value is a list of strings that ends with a nullptr.
+
+
+
+
+
+
+ void
+ void scitoken_free_string_list
+ (char **value)
+ scitoken_free_string_list
+
+ char **
+ value
+
+
+
+
+Given a list of strings that was returned by scitoken_get_claim_string_list, free all the associated memory.
+
+
+
+
+
+
+ int
+ int scitoken_set_claim_string_list
+ (const SciToken token, const char *key, const char **values, char **err_msg)
+ scitoken_set_claim_string_list
+
+ const [SciToken]
+ token
+
+
+ const char *
+ key
+
+
+ const char **
+ values
+
+
+ char **
+ err_msg
+
+
+
+
+Set the value of a claim to a list of strings.
+
+
+
+
+
+
+ int
+ int scitoken_get_expiration
+ (const SciToken token, long long *value, char **err_msg)
+ scitoken_get_expiration
+
+ const [SciToken]
+ token
+
+
+ long long *
+ value
+
+
+ char **
+ err_msg
+
+
+Get the expiration time of the token.
+
+
+
+
+token
+
+
+Token to query
+
+
+
+
+value
+
+
+Output parameter for expiration time (Unix timestamp)
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+0 on success, non-zero on failure
+
+
+
+
+
+
+
+
+ void
+ void scitoken_set_lifetime
+ (SciToken token, int lifetime)
+ scitoken_set_lifetime
+
+ [SciToken]
+ token
+
+
+ int
+ lifetime
+
+
+Set the lifetime of the token in seconds.
+
+
+
+
+token
+
+
+Token to modify
+
+
+
+
+lifetime
+
+
+Lifetime in seconds from creation
+
+
+
+
+
+
+
+
+
+
+ int
+ int scitoken_serialize
+ (const SciToken token, char **value, char **err_msg)
+ scitoken_serialize
+
+ const [SciToken]
+ token
+
+
+ char **
+ value
+
+
+ char **
+ err_msg
+
+
+Serialize the token to a JWT string.
+
+
+
+
+token
+
+
+Token to serialize
+
+
+
+
+value
+
+
+Output parameter for JWT string (caller must free)
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+0 on success, non-zero on failure
+
+
+
+
+
+
+
+
+ void
+ void scitoken_set_serialize_profile
+ (SciToken token, SciTokenProfile profile)
+ scitoken_set_serialize_profile
+
+ [SciToken]
+ token
+
+
+ [SciTokenProfile]
+ profile
+
+
+
+
+Set the profile used for serialization; if COMPAT mode is used, then the library default is utilized (currently, scitokens 1.0).
+
+
+
+
+
+
+ void
+ void scitoken_set_serialize_mode
+ (SciToken token, SciTokenProfile profile)
+ scitoken_set_serialize_mode
+
+ [SciToken]
+ token
+
+
+ [SciTokenProfile]
+ profile
+
+
+
+
+
+
+
+
+
+
+ void
+ void scitoken_set_deserialize_profile
+ (SciToken token, SciTokenProfile profile)
+ scitoken_set_deserialize_profile
+
+ [SciToken]
+ token
+
+
+ [SciTokenProfile]
+ profile
+
+
+
+
+
+
+
+
+
+
+ int
+ int scitoken_deserialize
+ (const char *value, SciToken *token, char const *const *allowed_issuers, char **err_msg)
+ scitoken_deserialize
+
+ const char *
+ value
+
+
+ [SciToken] *
+ token
+
+
+ char const *const *
+ allowed_issuers
+
+
+ char **
+ err_msg
+
+
+Deserialize a JWT string into a SciToken.
+
+
+
+
+value
+
+
+JWT string to parse
+
+
+
+
+token
+
+
+Output parameter for created token (caller must destroy)
+
+
+
+
+allowed_issuers
+
+
+NULL-terminated array of allowed issuer URLs, or NULL for any
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+0 on success, non-zero on failure
+
+
+
+
+
+
+
+
+ int
+ int scitoken_deserialize_start
+ (const char *value, SciToken *token, char const *const *allowed_issuers, SciTokenStatus *status, char **err_msg)
+ scitoken_deserialize_start
+
+ const char *
+ value
+
+
+ [SciToken] *
+ token
+
+
+ char const *const *
+ allowed_issuers
+
+
+ [SciTokenStatus] *
+ status
+
+
+ char **
+ err_msg
+
+
+Start the deserialization process for a token, returning a status object.
+
+
+
+
+value
+
+
+The serialized token.
+
+
+
+
+token
+
+
+Destination for the token object.
+
+
+
+
+allowed_issuers
+
+
+List of allowed issuers, or nullptr for no issuer check.
+
+
+
+
+status
+
+
+Destination for the status object.
+
+
+
+
+err_msg
+
+
+Destination for error message.
+
+
+
+int 0 on success, -1 on error.
+
+
+
+
+
+
+
+
+ int
+ int scitoken_deserialize_continue
+ (SciToken *token, SciTokenStatus *status, char **err_msg)
+ scitoken_deserialize_continue
+
+ [SciToken] *
+ token
+
+
+ [SciTokenStatus] *
+ status
+
+
+ char **
+ err_msg
+
+
+Continue the deserialization process for a token, updating the status object.
+
+
+If the status object indicates that the token is complete, the token object will be populated and the status object will be nullptr.
+
+
+token
+
+
+The token object, returned from scitoken_deserialize_start.
+
+
+
+
+status
+
+
+Status object for the deserialize.
+
+
+
+
+err_msg
+
+
+Destination for error message.
+
+
+
+int 0 on success, -1 on error.
+
+
+
+
+
+
+
+
+ int
+ int scitoken_deserialize_v2
+ (const char *value, SciToken token, char const *const *allowed_issuers, char **err_msg)
+ scitoken_deserialize_v2
+
+ const char *
+ value
+
+
+ [SciToken]
+ token
+
+
+ char const *const *
+ allowed_issuers
+
+
+ char **
+ err_msg
+
+
+
+
+
+
+
+
+
+
+ int
+ int scitoken_store_public_ec_key
+ (const char *issuer, const char *keyid, const char *value, char **err_msg)
+ scitoken_store_public_ec_key
+
+ const char *
+ issuer
+
+
+ const char *
+ keyid
+
+
+ const char *
+ value
+
+
+ char **
+ err_msg
+
+
+Store a public EC key for token verification.
+
+
+
+
+issuer
+
+
+Issuer URL that will use this key
+
+
+
+
+keyid
+
+
+Key identifier
+
+
+
+
+value
+
+
+PEM-encoded public key
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+0 on success, non-zero on failure
+
+
+
+
+
+
+
+
+ [Validator]
+ Validator validator_create
+ ()
+ validator_create
+
+Create a new token validator.
+
+
+Validator handle on success, NULL on failure
+
+
+
+
+
+
+
+
+ void
+ void validator_set_token_profile
+ (Validator, SciTokenProfile profile)
+ validator_set_token_profile
+
+ [Validator]
+
+
+ [SciTokenProfile]
+ profile
+
+
+
+
+Set the profile used for validating the tokens; COMPAT (default) will accept any known token type while others will only support that specific profile.
+
+
+
+
+
+
+ int
+ int validator_set_time
+ (Validator validator, time_t now, char **err_msg)
+ validator_set_time
+
+ [Validator]
+ validator
+
+
+ time_t
+ now
+
+
+ char **
+ err_msg
+
+
+
+
+Set the time to use with the validator. Useful if you want to see if the token would have been valid at some time in the past.
+
+
+
+
+
+
+ int
+ int validator_add
+ (Validator validator, const char *claim, StringValidatorFunction validator_func, char **err_msg)
+ validator_add
+
+ [Validator]
+ validator
+
+
+ const char *
+ claim
+
+
+ [StringValidatorFunction]
+ validator_func
+
+
+ char **
+ err_msg
+
+
+
+
+
+
+
+
+
+
+ int
+ int validator_add_critical_claims
+ (Validator validator, const char **claims, char **err_msg)
+ validator_add_critical_claims
+
+ [Validator]
+ validator
+
+
+ const char **
+ claims
+
+
+ char **
+ err_msg
+
+
+
+
+
+
+
+
+
+
+ int
+ int validator_validate
+ (Validator validator, SciToken scitoken, char **err_msg)
+ validator_validate
+
+ [Validator]
+ validator
+
+
+ [SciToken]
+ scitoken
+
+
+ char **
+ err_msg
+
+
+Validate a SciToken using the configured validator.
+
+
+
+
+validator
+
+
+Validator to use
+
+
+
+
+scitoken
+
+
+Token to validate
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+0 on success, non-zero on failure
+
+
+
+
+
+
+
+
+ void
+ void validator_destroy
+ (Validator validator)
+ validator_destroy
+
+ [Validator]
+ validator
+
+
+Destroy a validator object and free associated memory.
+
+
+
+
+validator
+
+
+Validator handle to destroy
+
+
+
+
+
+
+
+
+
+
+ [Enforcer]
+ Enforcer enforcer_create
+ (const char *issuer, const char **audience, char **err_msg)
+ enforcer_create
+
+ const char *
+ issuer
+
+
+ const char **
+ audience
+
+
+ char **
+ err_msg
+
+
+Create a new token enforcer.
+
+
+
+
+issuer
+
+
+Required issuer URL for tokens
+
+
+
+
+audience
+
+
+NULL-terminated array of acceptable audience values
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+Enforcer handle on success, NULL on failure
+
+
+
+
+
+
+
+
+ void
+ void enforcer_destroy
+ (Enforcer enforcer)
+ enforcer_destroy
+
+ [Enforcer]
+ enforcer
+
+
+Destroy an enforcer object and free associated memory.
+
+
+
+
+enforcer
+
+
+Enforcer handle to destroy
+
+
+
+
+
+
+
+
+
+
+ void
+ void enforcer_set_validate_profile
+ (Enforcer, SciTokenProfile profile)
+ enforcer_set_validate_profile
+
+ [Enforcer]
+
+
+ [SciTokenProfile]
+ profile
+
+
+
+
+Set the profile used for enforcing ACLs; when set to COMPAT (default), then the authorizations will be converted to SciTokens 1.0-style authorizations (so, WLCG's storage.read becomes read).
+
+
+
+
+
+
+ int
+ int enforcer_set_time
+ (Enforcer enf, time_t now, char **err_msg)
+ enforcer_set_time
+
+ [Enforcer]
+ enf
+
+
+ time_t
+ now
+
+
+ char **
+ err_msg
+
+
+
+
+Set the time to use with the enforcer. Useful if you want to see if the token would have been valid at some time in the past.
+
+
+
+
+
+
+ int
+ int enforcer_generate_acls
+ (const Enforcer enf, const SciToken scitokens, Acl **acls, char **err_msg)
+ enforcer_generate_acls
+
+ const [Enforcer]
+ enf
+
+
+ const [SciToken]
+ scitokens
+
+
+ [Acl] **
+ acls
+
+
+ char **
+ err_msg
+
+
+Generate Access Control Lists from a token.
+
+
+
+
+enf
+
+
+Enforcer to use
+
+
+
+
+scitokens
+
+
+Token to process
+
+
+
+
+acls
+
+
+Output parameter for ACL array (caller must free with enforcer_acl_free)
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+0 on success, non-zero on failure
+
+
+
+
+
+
+
+
+ int
+ int enforcer_generate_acls_start
+ (const Enforcer enf, const SciToken scitokens, SciTokenStatus *status, Acl **acls, char **err_msg)
+ enforcer_generate_acls_start
+
+ const [Enforcer]
+ enf
+
+
+ const [SciToken]
+ scitokens
+
+
+ [SciTokenStatus] *
+ status
+
+
+ [Acl] **
+ acls
+
+
+ char **
+ err_msg
+
+
+
+
+The asynchronous versions of enforcer_generate_acls.
+
+
+
+
+
+
+ int
+ int enforcer_generate_acls_continue
+ (const Enforcer enf, SciTokenStatus *status, Acl **acls, char **err_msg)
+ enforcer_generate_acls_continue
+
+ const [Enforcer]
+ enf
+
+
+ [SciTokenStatus] *
+ status
+
+
+ [Acl] **
+ acls
+
+
+ char **
+ err_msg
+
+
+
+
+
+
+
+
+
+
+ void
+ void enforcer_acl_free
+ (Acl *acls)
+ enforcer_acl_free
+
+ [Acl] *
+ acls
+
+
+Free an array of ACLs returned by enforcer_generate_acls.
+
+
+
+
+acls
+
+
+ACL array to free
+
+
+
+
+
+
+
+
+
+
+ int
+ int enforcer_test
+ (const Enforcer enf, const SciToken sci, const Acl *acl, char **err_msg)
+ enforcer_test
+
+ const [Enforcer]
+ enf
+
+
+ const [SciToken]
+ sci
+
+
+ const [Acl] *
+ acl
+
+
+ char **
+ err_msg
+
+
+Test if a token grants access for a specific ACL.
+
+
+
+
+enf
+
+
+Enforcer to use
+
+
+
+
+sci
+
+
+Token to test
+
+
+
+
+acl
+
+
+ACL to test against
+
+
+
+
+err_msg
+
+
+Output parameter for error messages (caller must free)
+
+
+
+0 if access granted, non-zero if denied or error
+
+
+
+
+
+
+
+
+ void
+ void scitoken_status_free
+ (SciTokenStatus *status)
+ scitoken_status_free
+
+ [SciTokenStatus] *
+ status
+
+
+
+
+
+
+
+
+
+
+ int
+ int scitoken_status_get_timeout_val
+ (const SciTokenStatus *status, time_t expiry_time, struct timeval *timeout, char **err_msg)
+ scitoken_status_get_timeout_val
+
+ const [SciTokenStatus] *
+ status
+
+
+ time_t
+ expiry_time
+
+
+ struct timeval *
+ timeout
+
+
+ char **
+ err_msg
+
+
+
+
+Get the suggested timeout val. After the timeout value has passed, the asynchronous operation should continue.
+
+expiry_time: the expiration time (in Unix epoch seconds) for the operation in total. The returned timeout value will never take the operation past the expiration time.
+
+
+
+
+
+
+
+
+ int
+ int scitoken_status_get_read_fd_set
+ (SciTokenStatus *status, fd_set **read_fd_set, char **err_msg)
+ scitoken_status_get_read_fd_set
+
+ [SciTokenStatus] *
+ status
+
+
+ fd_set **
+ read_fd_set
+
+
+ char **
+ err_msg
+
+
+
+
+Get the set of read file descriptors. This will return a borrowed pointer (whose lifetime matches the status object) pointing at a fd_set array of size FD_SETSIZE. Any file descriptors owned by the status operation will be set and the returned fd_set can be used for select() operations.
+IMPLEMENTATION NOTE: If the file descriptor monitored by libcurl are too high to be stored in this set, libcurl should give a corresponding low timeout val (100ms) and effectively switch to polling. See: https://curl.se/libcurl/c/curl_multi_fdset.html for more information.
+
+
+
+
+
+
+ int
+ int scitoken_status_get_write_fd_set
+ (SciTokenStatus *status, fd_set **write_fd_set, char **err_msg)
+ scitoken_status_get_write_fd_set
+
+ [SciTokenStatus] *
+ status
+
+
+ fd_set **
+ write_fd_set
+
+
+ char **
+ err_msg
+
+
+
+
+Get the set of write FDs; see documentation for scitoken_status_get_read_fd_set.
+
+
+
+
+
+
+ int
+ int scitoken_status_get_exc_fd_set
+ (SciTokenStatus *status, fd_set **exc_fd_set, char **err_msg)
+ scitoken_status_get_exc_fd_set
+
+ [SciTokenStatus] *
+ status
+
+
+ fd_set **
+ exc_fd_set
+
+
+ char **
+ err_msg
+
+
+
+
+Get the set of exception FDs; see documentation for scitoken_status_get_exc_fd_set.
+
+
+
+
+
+
+ int
+ int scitoken_status_get_max_fd
+ (const SciTokenStatus *status, int *max_fd, char **err_msg)
+ scitoken_status_get_max_fd
+
+ const [SciTokenStatus] *
+ status
+
+
+ int *
+ max_fd
+
+
+ char **
+ err_msg
+
+
+
+
+Get the maximum FD in the status set.
+IMPLEMENTATION NOTE: If the max FD is -1 then it implies libcurl is something that cannot be modelled by a socket. In such a case, the libcurl docs suggest using a 100ms timeout for select operations. See https://curl.se/libcurl/c/curl_multi_fdset.html.
+
+
+
+
+
+
+ int
+ int keycache_refresh_jwks
+ (const char *issuer, char **err_msg)
+ keycache_refresh_jwks
+
+ const char *
+ issuer
+
+
+ char **
+ err_msg
+
+
+
+
+API for explicity managing the key cache.
+This manipulates the keycache for the current eUID. Refresh the JWKS in the keycache for a given issuer; the refresh will occur even if the JWKS is not otherwise due for updates.
+Returns 0 on success, nonzero on failure.
+
+
+
+
+
+
+
+
+ int
+ int keycache_get_cached_jwks
+ (const char *issuer, char **jwks, char **err_msg)
+ keycache_get_cached_jwks
+
+ const char *
+ issuer
+
+
+ char **
+ jwks
+
+
+ char **
+ err_msg
+
+
+
+
+Retrieve the JWKS from the keycache for a given issuer.
+Returns 0 if successful, nonzero on failure.
+If the existing JWKS has expired - or does not exist - this does not trigger a new download of the JWKS from the issuer. Instead, it will return a JWKS object with an empty set of keys.
+jwks is an output variable set to the contents of the JWKS in the key cache.
+
+
+
+
+
+
+
+
+ int
+ int keycache_set_jwks
+ (const char *issuer, const char *jwks, char **err_msg)
+ keycache_set_jwks
+
+ const char *
+ issuer
+
+
+ const char *
+ jwks
+
+
+ char **
+ err_msg
+
+
+
+
+Replace any existing key cache entry with one provided by the user. The expiration and next update time of the user-provided JWKS will utilize the same rules as a download from an issuer with no explicit cache lifetime directives.
+jwks is value that will be set in the cache.
+
+
+
+
+
+
+
+
+ int
+ int config_set_int
+ (const char *key, int value, char **err_msg)
+ config_set_int
+
+ const char *
+ key
+
+
+ int
+ value
+
+
+ char **
+ err_msg
+
+
+
+
+APIs for managing scitokens configuration parameters.
+
+
+
+
+
+
+ int
+ int scitoken_config_set_int
+ (const char *key, int value, char **err_msg)
+ scitoken_config_set_int
+
+ const char *
+ key
+
+
+ int
+ value
+
+
+ char **
+ err_msg
+
+
+
+
+Update scitokens int parameters. Takes in key/value pairs and assigns the input value to whatever configuration variable is indicated by the key. Returns 0 on success, and non-zero for invalid keys or values.
+
+
+
+
+
+
+ int
+ int config_get_int
+ (const char *key, char **err_msg)
+ config_get_int
+
+ const char *
+ key
+
+
+ char **
+ err_msg
+
+
+
+
+
+
+
+
+
+
+ int
+ int scitoken_config_get_int
+ (const char *key, char **err_msg)
+ scitoken_config_get_int
+
+ const char *
+ key
+
+
+ char **
+ err_msg
+
+
+
+
+Get current scitokens int parameters. Returns the value associated with the supplied input key on success, and -1 on failure. This assumes there are no keys for which a negative return value is permissible.
+
+
+
+
+
+
+ int
+ int scitoken_config_set_str
+ (const char *key, const char *value, char **err_msg)
+ scitoken_config_set_str
+
+ const char *
+ key
+
+
+ const char *
+ value
+
+
+ char **
+ err_msg
+
+
+
+
+Set current scitokens str parameters. Returns 0 on success, nonzero on failure
+
+
+
+
+
+
+ int
+ int scitoken_config_get_str
+ (const char *key, char **output, char **err_msg)
+ scitoken_config_get_str
+
+ const char *
+ key
+
+
+ char **
+ output
+
+
+ char **
+ err_msg
+
+
+
+
+Get current scitokens str parameters. Returns 0 on success, nonzero on failure, and populates the value associated with the input key to output.
+
+
+
+
+
+
+
+
+
+
+
+
+#include<sys/select.h>
+#include<time.h>
+
+#ifdef__cplusplus
+#include<ctime>
+extern"C"{
+#else
+#include<time.h>
+#endif
+
+typedefvoid*[SciTokenKey];
+
+typedefvoid*[SciToken];
+
+typedefvoid*[Validator];
+
+typedefvoid*[Enforcer];
+
+typedefvoid*[SciTokenStatus];
+
+typedefvoid*[Configuration];
+
+typedefint(*[StringValidatorFunction])(constchar*value,char**err_msg);
+
+typedefstruct[Acl_s]{
+constchar*[authz];
+constchar*[resource];
+}[Acl];
+
+typedefenum[_profile]{
+[COMPAT]=0,
+[SCITOKENS_1_0],
+[SCITOKENS_2_0],
+[WLCG_1_0],
+[AT_JWT]
+}[SciTokenProfile];
+
+[SciTokenKey][scitoken_key_create](constchar*key_id,constchar*algorithm,
+constchar*public_contents,
+constchar*private_contents,char**err_msg);
+
+void[scitoken_key_destroy]([SciTokenKey]private_key);
+
+[SciToken][scitoken_create]([SciTokenKey]private_key);
+
+void[scitoken_destroy]([SciToken]token);
+
+int[scitoken_set_claim_string]([SciToken]token,constchar*key,
+constchar*value,char**err_msg);
+
+int[scitoken_get_claim_string](const[SciToken]token,constchar*key,
+char**value,char**err_msg);
+
+int[scitoken_get_claim_string_list](const[SciToken]token,constchar*key,
+char***value,char**err_msg);
+
+void[scitoken_free_string_list](char**value);
+
+int[scitoken_set_claim_string_list](const[SciToken]token,constchar*key,
+constchar**values,char**err_msg);
+
+int[scitoken_get_expiration](const[SciToken]token,longlong*value,
+char**err_msg);
+
+void[scitoken_set_lifetime]([SciToken]token,intlifetime);
+
+int[scitoken_serialize](const[SciToken]token,char**value,char**err_msg);
+
+void[scitoken_set_serialize_profile]([SciToken]token,[SciTokenProfile]profile);
+
+void[scitoken_set_serialize_mode]([SciToken]token,[SciTokenProfile]profile);
+
+void[scitoken_set_deserialize_profile]([SciToken]token,[SciTokenProfile]profile);
+
+int[scitoken_deserialize](constchar*value,[SciToken]*token,
+charconst*const*allowed_issuers,char**err_msg);
+
+int[scitoken_deserialize_start](constchar*value,[SciToken]*token,
+charconst*const*allowed_issuers,
+[SciTokenStatus]*status,char**err_msg);
+
+int[scitoken_deserialize_continue]([SciToken]*token,[SciTokenStatus]*status,
+char**err_msg);
+
+int[scitoken_deserialize_v2](constchar*value,[SciToken]token,
+charconst*const*allowed_issuers,char**err_msg);
+
+int[scitoken_store_public_ec_key](constchar*issuer,constchar*keyid,
+constchar*value,char**err_msg);
+
+[Validator][validator_create]();
+
+void[validator_set_token_profile]([Validator],[SciTokenProfile]profile);
+
+int[validator_set_time]([Validator]validator,time_tnow,char**err_msg);
+
+int[validator_add]([Validator]validator,constchar*claim,
+[StringValidatorFunction]validator_func,char**err_msg);
+
+int[validator_add_critical_claims]([Validator]validator,constchar**claims,
+char**err_msg);
+
+int[validator_validate]([Validator]validator,[SciToken]scitoken,char**err_msg);
+
+void[validator_destroy]([Validator]validator);
+
+[Enforcer][enforcer_create](constchar*issuer,constchar**audience,
+char**err_msg);
+
+void[enforcer_destroy]([Enforcer]enforcer);
+
+void[enforcer_set_validate_profile]([Enforcer],[SciTokenProfile]profile);
+
+int[enforcer_set_time]([Enforcer]enf,time_tnow,char**err_msg);
+
+int[enforcer_generate_acls](const[Enforcer]enf,const[SciToken]scitokens,
+[Acl]**acls,char**err_msg);
+
+int[enforcer_generate_acls_start](const[Enforcer]enf,const[SciToken]scitokens,
+[SciTokenStatus]*status,[Acl]**acls,
+char**err_msg);
+int[enforcer_generate_acls_continue](const[Enforcer]enf,[SciTokenStatus]*status,
+[Acl]**acls,char**err_msg);
+
+void[enforcer_acl_free]([Acl]*acls);
+
+int[enforcer_test](const[Enforcer]enf,const[SciToken]sci,const[Acl]*acl,
+char**err_msg);
+
+void[scitoken_status_free]([SciTokenStatus]*status);
+
+int[scitoken_status_get_timeout_val](const[SciTokenStatus]*status,
+time_texpiry_time,structtimeval*timeout,
+char**err_msg);
+
+int[scitoken_status_get_read_fd_set]([SciTokenStatus]*status,
+fd_set**read_fd_set,char**err_msg);
+
+int[scitoken_status_get_write_fd_set]([SciTokenStatus]*status,
+fd_set**write_fd_set,char**err_msg);
+
+int[scitoken_status_get_exc_fd_set]([SciTokenStatus]*status,fd_set**exc_fd_set,
+char**err_msg);
+
+int[scitoken_status_get_max_fd](const[SciTokenStatus]*status,int*max_fd,
+char**err_msg);
+
+int[keycache_refresh_jwks](constchar*issuer,char**err_msg);
+
+int[keycache_get_cached_jwks](constchar*issuer,char**jwks,char**err_msg);
+
+int[keycache_set_jwks](constchar*issuer,constchar*jwks,char**err_msg);
+
+
+int[config_set_int](constchar*key,intvalue,char**err_msg);
+
+int[scitoken_config_set_int](constchar*key,intvalue,char**err_msg);
+
+
+int[config_get_int](constchar*key,char**err_msg);
+
+int[scitoken_config_get_int](constchar*key,char**err_msg);
+
+int[scitoken_config_set_str](constchar*key,constchar*value,char**err_msg);
+
+int[scitoken_config_get_str](constchar*key,char**output,char**err_msg);
+
+#ifdef__cplusplus
+}
+#endif
+
+
+
+
diff --git a/docs/_build/doxygen/xml/structAcl__s.xml b/docs/_build/doxygen/xml/structAcl__s.xml
new file mode 100644
index 0000000..29824bd
--- /dev/null
+++ b/docs/_build/doxygen/xml/structAcl__s.xml
@@ -0,0 +1,49 @@
+
+
+
+ Acl_s
+ scitokens.h
+
+
+ const char *
+ const char* Acl_s::authz
+
+ authz
+ Acl_s::authz
+
+
+
+Authorization type (e.g., "read", "write")
+
+
+
+
+
+
+ const char *
+ const char* Acl_s::resource
+
+ resource
+ Acl_s::resource
+
+
+
+Resource path or pattern
+
+
+
+
+
+
+
+Access Control List entry containing authorization and resource.
+
+
+
+
+
+ Acl_sauthz
+ Acl_sresource
+
+
+
diff --git a/docs/_build/doxygen/xml/xml.xsd b/docs/_build/doxygen/xml/xml.xsd
new file mode 100644
index 0000000..9f80fe1
--- /dev/null
+++ b/docs/_build/doxygen/xml/xml.xsd
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo
new file mode 100644
index 0000000..0c3d565
--- /dev/null
+++ b/docs/_build/html/.buildinfo
@@ -0,0 +1,4 @@
+# Sphinx build info version 1
+# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
+config: 6a7bdebd82926a9cc2e036598b0d98d8
+tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/_build/html/.doctrees/api.doctree b/docs/_build/html/.doctrees/api.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..34d7003108ca60b8081e32a94a8dc3078525de82
GIT binary patch
literal 296322
zcmeEvdAuZ5bub9C0>cdOU>LS$5a=0Z9=*Tr0Z|wR1csTB8Pr6{v%0%_x{LQ-Kf3$P
zFhmr@1+=31^nq)lQRA*Lei%)RJ4WM*8ufEGn8di?9#=Hqxm(>^w{D$V)!pOc5B