aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.buildbot/build.sh3
-rwxr-xr-x.buildbot/firefly-x86_64-amdepyc_deploy.sh6
-rw-r--r--.gitignore5
-rw-r--r--Makefile61
-rw-r--r--README15
-rw-r--r--_exts/httpdomain/__init__.py14
-rw-r--r--_exts/httpdomain/autohttp/__init__.py11
-rw-r--r--_exts/httpdomain/autohttp/bottle.py114
-rw-r--r--_exts/httpdomain/autohttp/common.py36
-rw-r--r--_exts/httpdomain/autohttp/flask.py48
-rw-r--r--_exts/httpdomain/autohttp/flask_base.py215
-rw-r--r--_exts/httpdomain/autohttp/flaskqref.py80
-rw-r--r--_exts/httpdomain/autohttp/tornado.py128
-rw-r--r--_exts/httpdomain/httpdomain.py773
-rw-r--r--_exts/typescriptdomain.py587
-rw-r--r--_static/css/custom.css3
-rw-r--r--about.rst52
-rw-r--r--conf.py120
-rw-r--r--dot-alt/Makefile22
-rw-r--r--dot-alt/POLICY13
-rw-r--r--dot-alt/README8
-rw-r--r--dot-alt/registry.rec36
-rw-r--r--dot-alt/rst.header.template11
-rw-r--r--dot-alt/rst.template4
-rwxr-xr-xformat.sh3
-rw-r--r--gns-protocol-numbers/.gitignore1
-rw-r--r--gns-protocol-numbers/Makefile28
-rw-r--r--gns-protocol-numbers/POLICY20
-rw-r--r--gns-protocol-numbers/README8
-rw-r--r--gns-protocol-numbers/h.footer42
-rw-r--r--gns-protocol-numbers/h.header46
-rw-r--r--gns-protocol-numbers/h.template8
-rw-r--r--gns-protocol-numbers/registry.rec22
-rw-r--r--gns-protocol-numbers/rst.footer0
-rw-r--r--gns-protocol-numbers/rst.header.template11
-rw-r--r--gns-protocol-numbers/rst.template4
-rw-r--r--gns-service-port-numbers/.gitignore1
-rw-r--r--gns-service-port-numbers/Makefile28
-rw-r--r--gns-service-port-numbers/POLICY20
-rw-r--r--gns-service-port-numbers/README8
-rw-r--r--gns-service-port-numbers/h.footer42
-rw-r--r--gns-service-port-numbers/h.header46
-rw-r--r--gns-service-port-numbers/h.template8
-rw-r--r--gns-service-port-numbers/registry.rec27
-rw-r--r--gns-service-port-numbers/rst.footer0
-rw-r--r--gns-service-port-numbers/rst.header.template11
-rw-r--r--gns-service-port-numbers/rst.template4
-rw-r--r--gnu-name-system-default-tlds/.gitignore1
-rw-r--r--gnu-name-system-default-tlds/Makefile12
-rw-r--r--gnu-name-system-default-tlds/POLICY4
-rw-r--r--gnu-name-system-default-tlds/README4
-rw-r--r--gnu-name-system-default-tlds/registry.rec10
-rw-r--r--gnu-name-system-default-tlds/rst.footer0
-rw-r--r--gnu-name-system-default-tlds/rst.header.template10
-rw-r--r--gnu-name-system-default-tlds/rst.template3
-rw-r--r--gnu-name-system-record-flags/.gitignore1
-rw-r--r--gnu-name-system-record-flags/Makefile28
-rw-r--r--gnu-name-system-record-flags/POLICY20
-rw-r--r--gnu-name-system-record-flags/README13
-rw-r--r--gnu-name-system-record-flags/h.footer11
-rw-r--r--gnu-name-system-record-flags/h.header49
-rw-r--r--gnu-name-system-record-flags/h.template6
-rw-r--r--gnu-name-system-record-flags/registry.rec43
-rw-r--r--gnu-name-system-record-flags/rst.footer0
-rw-r--r--gnu-name-system-record-flags/rst.header.template11
-rw-r--r--gnu-name-system-record-flags/rst.template4
-rw-r--r--gnu-name-system-record-types/Makefile12
-rw-r--r--gnu-name-system-record-types/POLICY6
-rw-r--r--gnu-name-system-record-types/README4
-rw-r--r--gnu-name-system-record-types/registry.rec43
-rw-r--r--gnu-name-system-record-types/rst.footer0
-rw-r--r--gnu-name-system-record-types/rst.header.template11
-rw-r--r--gnu-name-system-record-types/rst.template4
-rw-r--r--gnu-taler-db-events/Makefile8
-rw-r--r--gnu-taler-db-events/registry.rec66
-rw-r--r--gnu-taler-db-events/rst.footer0
-rw-r--r--gnu-taler-db-events/rst.header13
-rw-r--r--gnu-taler-db-events/rst.template3
-rw-r--r--gnu-taler-error-codes/.gitignore1
-rw-r--r--gnu-taler-error-codes/Makefile23
-rw-r--r--gnu-taler-error-codes/go.footer1
-rw-r--r--gnu-taler-error-codes/go.header26
-rw-r--r--gnu-taler-error-codes/go.template8
-rw-r--r--gnu-taler-error-codes/kt.template2
-rw-r--r--gnu-taler-error-codes/registry.rec1156
-rw-r--r--gnu-taler-error-codes/rst.footer0
-rw-r--r--gnu-taler-error-codes/rst.header14
-rw-r--r--gnu-taler-error-codes/rst.template4
-rw-r--r--gnu-taler-extensions/registry.rec14
-rw-r--r--gnu-taler-extensions/rst.footer0
-rw-r--r--gnu-taler-extensions/rst.header4
-rw-r--r--gnu-taler-extensions/rst.template9
-rw-r--r--gnu-taler-kyc-attributes/Makefile6
-rw-r--r--gnu-taler-kyc-attributes/registry.rec66
-rw-r--r--gnunet-dht-block-types/.gitignore1
-rw-r--r--gnunet-dht-block-types/Makefile12
-rw-r--r--gnunet-dht-block-types/POLICY11
-rw-r--r--gnunet-dht-block-types/README4
-rw-r--r--gnunet-dht-block-types/registry.rec8
-rw-r--r--gnunet-dht-block-types/rst.footer0
-rw-r--r--gnunet-dht-block-types/rst.header.template11
-rw-r--r--gnunet-dht-block-types/rst.template4
-rw-r--r--gnunet-error-codes/.gitignore3
-rw-r--r--gnunet-error-codes/Makefile71
-rw-r--r--gnunet-error-codes/POLICY11
-rw-r--r--gnunet-error-codes/README5
-rw-r--r--gnunet-error-codes/c-length.template9
-rw-r--r--gnunet-error-codes/c.footer66
-rw-r--r--gnunet-error-codes/c.header55
-rw-r--r--gnunet-error-codes/c.template6
-rw-r--r--gnunet-error-codes/go.footer1
-rw-r--r--gnunet-error-codes/go.header23
-rw-r--r--gnunet-error-codes/go.template7
-rw-r--r--gnunet-error-codes/h.footer45
-rw-r--r--gnunet-error-codes/h.header43
-rw-r--r--gnunet-error-codes/h.template7
-rw-r--r--gnunet-error-codes/registry.rec136
-rw-r--r--gnunet-error-codes/rst.footer0
-rw-r--r--gnunet-error-codes/rst.header.template11
-rw-r--r--gnunet-error-codes/rst.template4
-rw-r--r--gnunet-error-codes/ts.footer3
-rw-r--r--gnunet-error-codes/ts.header21
-rw-r--r--gnunet-error-codes/ts.template7
-rw-r--r--gnunet-protocols/.gitignore1
-rw-r--r--gnunet-protocols/Makefile30
-rw-r--r--gnunet-protocols/POLICY20
-rw-r--r--gnunet-protocols/README10
-rw-r--r--gnunet-protocols/h.footer11
-rw-r--r--gnunet-protocols/h.header30
-rw-r--r--gnunet-protocols/h.template6
-rw-r--r--gnunet-protocols/registry.rec23
-rw-r--r--gnunet-protocols/rst.footer0
-rw-r--r--gnunet-protocols/rst.header.template4
-rw-r--r--gnunet-protocols/rst.template10
-rw-r--r--gnunet-signatures/Makefile12
-rw-r--r--gnunet-signatures/POLICY11
-rw-r--r--gnunet-signatures/README4
-rw-r--r--gnunet-signatures/registry.rec135
-rw-r--r--gnunet-signatures/rst.footer0
-rw-r--r--gnunet-signatures/rst.header.template12
-rw-r--r--gnunet-signatures/rst.template5
-rw-r--r--http-status-codes/Makefile8
-rw-r--r--http-status-codes/POLICY5
-rwxr-xr-xhttp-status-codes/extend.sh4
-rw-r--r--http-status-codes/http-status-codes-1.csv4
-rw-r--r--images/gnunet-blue.pngbin0 -> 27941 bytes
-rw-r--r--index.rst10
-rw-r--r--payto-payment-target-types/Makefile18
-rw-r--r--payto-payment-target-types/eth.txt119
-rw-r--r--payto-payment-target-types/registry.rec12
-rw-r--r--payto-payment-target-types/rst.footer0
-rw-r--r--payto-payment-target-types/rst.header13
-rw-r--r--payto-payment-target-types/rst.template3
-rw-r--r--payto-payment-target-types/wallee-transaction.txt49
-rw-r--r--registries.rst19
155 files changed, 5428 insertions, 232 deletions
diff --git a/.buildbot/build.sh b/.buildbot/build.sh
new file mode 100755
index 0000000..2aad486
--- /dev/null
+++ b/.buildbot/build.sh
@@ -0,0 +1,3 @@
1#!/bin/bash
2
3make
diff --git a/.buildbot/firefly-x86_64-amdepyc_deploy.sh b/.buildbot/firefly-x86_64-amdepyc_deploy.sh
new file mode 100755
index 0000000..a7f8ea5
--- /dev/null
+++ b/.buildbot/firefly-x86_64-amdepyc_deploy.sh
@@ -0,0 +1,6 @@
1#!/bin/bash
2
3# Deploy rest api from buildbot
4
5chmod -R ag+rX _build
6rsync --exclude=".*" --exclude="Makefile" --exclude="conf.py" -a --delete ./_build/ handbook@firefly.gnunet.org:~/gana/_build/
diff --git a/.gitignore b/.gitignore
index b25c15b..48ed587 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,6 @@
1__pycache__
2_build
1*~ 3*~
4*.h
5*.tmp
6*/*.rst
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ca57b10
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,61 @@
1# Minimal makefile for Sphinx documentation
2#
3
4REGISTRIES = dot-alt \
5 gnu-name-system-default-tlds \
6 gnu-name-system-record-flags \
7 gnu-name-system-record-types \
8 gnu-taler-db-events \
9 gnu-taler-error-codes \
10 gnu-taler-extensions \
11 gnu-taler-kyc-attributes \
12 gnunet-dht-block-types \
13 gnunet-error-codes \
14 gnunet-protocols \
15 gnunet-signatures \
16 http-status-codes \
17 payto-payment-target-types \
18 gns-protocol-numbers \
19 gns-service-port-numbers
20
21# You can set these variables from the command line, and also
22# from the environment for the first two.
23SPHINXOPTS ?=
24SPHINXBUILD ?= sphinx-build
25SOURCEDIR = .
26BUILDDIR = _build
27
28
29all: rsts html
30
31# Put it first so that "make" without argument is like "make help".
32help:
33 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
34
35.PHONY: all clean help texinfo info Makefile
36
37rsts:
38 for dir in $(REGISTRIES); do \
39 $(MAKE) -C $$dir; \
40 done
41
42html:
43 @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
44
45texinfo:
46 @$(SPHINXBUILD) -M texinfo "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
47
48info:
49 @$(SPHINXBUILD) -M info "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
50
51clean:
52 rm -rf $(BUILDDIR)
53 for dir in $(REGISTRIES); do \
54 $(MAKE) -C $$dir; \
55 done
56
57distclean: clean
58
59# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
60#%: Makefile
61# @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/README b/README
index ccad190..dda0881 100644
--- a/README
+++ b/README
@@ -8,6 +8,21 @@ protocols. If you need to open a new registry, please feel free
8to contact us at gana@gnunet.org. 8to contact us at gana@gnunet.org.
9 9
10 10
11Contributors
12============
13
14If you have Git access to GANA, you are generally authorized to add
15new entries to the registries. Most registries are under a simple
16first-come first-use policy. If you are unsure about the registration
17policy of a particular registry, do ask gana@gnunet.org before making
18changes.
19
20Deleting or modifying existing entries (except improving comments)
21should be done particularly carefully, so if unsure you might want to
22double-check with gana@gnunet.org before changing or deleting
23anything.
24
25
11History 26History
12======= 27=======
13 28
diff --git a/_exts/httpdomain/__init__.py b/_exts/httpdomain/__init__.py
new file mode 100644
index 0000000..b5a7dc2
--- /dev/null
+++ b/_exts/httpdomain/__init__.py
@@ -0,0 +1,14 @@
1# -*- coding: utf-8 -*-
2"""
3 sphinxcontrib
4 ~~~~~~~~~~~~~
5
6 This package is a namespace package that contains all extensions
7 distributed in the ``sphinx-contrib`` distribution.
8
9 :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
10 :license: BSD, see LICENSE for details.
11"""
12
13__import__('pkg_resources').declare_namespace(__name__)
14
diff --git a/_exts/httpdomain/autohttp/__init__.py b/_exts/httpdomain/autohttp/__init__.py
new file mode 100644
index 0000000..95372d4
--- /dev/null
+++ b/_exts/httpdomain/autohttp/__init__.py
@@ -0,0 +1,11 @@
1"""
2 sphinxcontrib.autohttp
3 ~~~~~~~~~~~~~~~~~~~~~~
4
5 The sphinx.ext.autodoc-style HTTP API reference builder
6 for sphinxcontrib.httpdomain.
7
8 :copyright: Copyright 2011 by Hong Minhee
9 :license: BSD, see LICENSE for details.
10
11"""
diff --git a/_exts/httpdomain/autohttp/bottle.py b/_exts/httpdomain/autohttp/bottle.py
new file mode 100644
index 0000000..d8c1859
--- /dev/null
+++ b/_exts/httpdomain/autohttp/bottle.py
@@ -0,0 +1,114 @@
1"""
2 sphinxcontrib.autohttp.bottle
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5 The sphinx.ext.autodoc-style HTTP API reference builder (from Bottle)
6 for sphinxcontrib.httpdomain.
7
8 :copyright: Copyright 2012 by Jameel Al-Aziz
9 :license: BSD, see LICENSE for details.
10
11"""
12
13import re
14import six
15
16from docutils import nodes
17from docutils.parsers.rst import directives
18from docutils.statemachine import ViewList
19
20from sphinx.util import force_decode
21from sphinx.util.compat import Directive
22from sphinx.util.nodes import nested_parse_with_titles
23from sphinx.util.docstrings import prepare_docstring
24from sphinx.pycode import ModuleAnalyzer
25
26from sphinxcontrib import httpdomain
27from sphinxcontrib.autohttp.common import http_directive, import_object
28
29
30def translate_bottle_rule(app, rule):
31 buf = six.StringIO()
32 if hasattr(app.router, "parse_rule"):
33 iterator = app.router.parse_rule(rule) # bottle 0.11
34 else:
35 iterator = app.router._itertokens(rule) # bottle 0.12
36 for name, filter, conf in iterator:
37 if filter:
38 buf.write('(')
39 buf.write(name)
40 if (filter != app.router.default_filter and filter != 'default')\
41 or conf:
42 buf.write(':')
43 buf.write(filter)
44 if conf:
45 buf.write(':')
46 buf.write(conf)
47 buf.write(')')
48 else:
49 buf.write(name)
50 return buf.getvalue()
51
52
53def get_routes(app):
54 for route in app.routes:
55 path = translate_bottle_rule(app, route.rule)
56 yield route.method, path, route
57
58
59class AutobottleDirective(Directive):
60
61 has_content = True
62 required_arguments = 1
63 option_spec = {'endpoints': directives.unchanged,
64 'undoc-endpoints': directives.unchanged,
65 'include-empty-docstring': directives.unchanged}
66
67 @property
68 def endpoints(self):
69 endpoints = self.options.get('endpoints', None)
70 if not endpoints:
71 return None
72 return frozenset(re.split(r'\s*,\s*', endpoints))
73
74 @property
75 def undoc_endpoints(self):
76 undoc_endpoints = self.options.get('undoc-endpoints', None)
77 if not undoc_endpoints:
78 return frozenset()
79 return frozenset(re.split(r'\s*,\s*', undoc_endpoints))
80
81 def make_rst(self):
82 app = import_object(self.arguments[0])
83 for method, path, target in get_routes(app):
84 endpoint = target.name or target.callback.__name__
85 if self.endpoints and endpoint not in self.endpoints:
86 continue
87 if endpoint in self.undoc_endpoints:
88 continue
89 view = target.callback
90 docstring = view.__doc__ or ''
91 if not isinstance(docstring, six.text_type):
92 analyzer = ModuleAnalyzer.for_module(view.__module__)
93 docstring = force_decode(docstring, analyzer.encoding)
94 if not docstring and 'include-empty-docstring' not in self.options:
95 continue
96 docstring = prepare_docstring(docstring)
97 for line in http_directive(method, path, docstring):
98 yield line
99
100 def run(self):
101 node = nodes.section()
102 node.document = self.state.document
103 result = ViewList()
104 for line in self.make_rst():
105 result.append(line, '<autobottle>')
106 nested_parse_with_titles(self.state, result, node)
107 return node.children
108
109
110def setup(app):
111 if 'http' not in app.domains:
112 httpdomain.setup(app)
113 app.add_directive('autobottle', AutobottleDirective)
114
diff --git a/_exts/httpdomain/autohttp/common.py b/_exts/httpdomain/autohttp/common.py
new file mode 100644
index 0000000..199e297
--- /dev/null
+++ b/_exts/httpdomain/autohttp/common.py
@@ -0,0 +1,36 @@
1"""
2 sphinxcontrib.autohttp.common
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5 The common functions for web framework reflection.
6
7 :copyright: Copyright 2011 by Hong Minhee
8 :license: BSD, see LICENSE for details.
9
10"""
11import six
12from six.moves import builtins
13from six.moves import reduce
14
15def import_object(import_name):
16 module_name, expr = import_name.split(':', 1)
17 mod = __import__(module_name)
18 mod = reduce(getattr, module_name.split('.')[1:], mod)
19 globals = builtins
20 if not isinstance(globals, dict):
21 globals = globals.__dict__
22 return eval(expr, globals, mod.__dict__)
23
24
25def http_directive(method, path, content):
26 method = method.lower().strip()
27 if isinstance(content, six.string_types):
28 content = content.splitlines()
29 yield ''
30 paths = [path] if isinstance(path, six.string_types) else path
31 for path in paths:
32 yield '.. http:{method}:: {path}'.format(**locals())
33 yield ''
34 for line in content:
35 yield ' ' + line
36 yield ''
diff --git a/_exts/httpdomain/autohttp/flask.py b/_exts/httpdomain/autohttp/flask.py
new file mode 100644
index 0000000..4bd5232
--- /dev/null
+++ b/_exts/httpdomain/autohttp/flask.py
@@ -0,0 +1,48 @@
1"""
2 sphinxcontrib.autohttp.flask
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5 The sphinx.ext.autodoc-style HTTP API reference builder (from Flask)
6 for sphinxcontrib.httpdomain.
7
8 :copyright: Copyright 2011 by Hong Minhee
9 :license: BSD, see LICENSE for details.
10
11"""
12from __future__ import absolute_import
13
14import re
15import itertools
16import six
17
18from docutils import nodes
19from docutils.parsers.rst import directives
20from docutils.statemachine import ViewList
21
22from sphinx.util import force_decode
23from sphinx.util.compat import Directive
24from sphinx.util.nodes import nested_parse_with_titles
25from sphinx.util.docstrings import prepare_docstring
26from sphinx.pycode import ModuleAnalyzer
27
28from sphinxcontrib import httpdomain
29from sphinxcontrib.autohttp.common import http_directive, import_object
30
31from .flask_base import AutoflaskBase
32
33class AutoflaskDirective(AutoflaskBase):
34
35 def run(self):
36 node = nodes.section()
37 node.document = self.state.document
38 result = ViewList()
39 for line in self.make_rst():
40 result.append(line, '<autoflask>')
41 nested_parse_with_titles(self.state, result, node)
42 return node.children
43
44
45def setup(app):
46 if 'http' not in app.domains:
47 httpdomain.setup(app)
48 app.add_directive('autoflask', AutoflaskDirective)
diff --git a/_exts/httpdomain/autohttp/flask_base.py b/_exts/httpdomain/autohttp/flask_base.py
new file mode 100644
index 0000000..50454fe
--- /dev/null
+++ b/_exts/httpdomain/autohttp/flask_base.py
@@ -0,0 +1,215 @@
1"""
2 sphinxcontrib.autohttp.flask
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5 The sphinx.ext.autodoc-style HTTP API reference builder (from Flask)
6 for sphinxcontrib.httpdomain.
7
8 :copyright: Copyright 2011 by Hong Minhee
9 :license: BSD, see LICENSE for details.
10
11"""
12
13import re
14import itertools
15import six
16
17from docutils import nodes
18from docutils.parsers.rst import directives
19from docutils.statemachine import ViewList
20
21from sphinx.util import force_decode
22from sphinx.util.compat import Directive
23from sphinx.util.nodes import nested_parse_with_titles
24from sphinx.util.docstrings import prepare_docstring
25from sphinx.pycode import ModuleAnalyzer
26
27from sphinxcontrib import httpdomain
28from sphinxcontrib.autohttp.common import http_directive, import_object
29
30
31def translate_werkzeug_rule(rule):
32 from werkzeug.routing import parse_rule
33 buf = six.StringIO()
34 for conv, arg, var in parse_rule(rule):
35 if conv:
36 buf.write('(')
37 if conv != 'default':
38 buf.write(conv)
39 buf.write(':')
40 buf.write(var)
41 buf.write(')')
42 else:
43 buf.write(var)
44 return buf.getvalue()
45
46
47def get_routes(app, endpoint=None, order=None):
48 endpoints = []
49 for rule in app.url_map.iter_rules(endpoint):
50 url_with_endpoint = (
51 six.text_type(next(app.url_map.iter_rules(rule.endpoint))),
52 rule.endpoint
53 )
54 if url_with_endpoint not in endpoints:
55 endpoints.append(url_with_endpoint)
56 if order == 'path':
57 endpoints.sort()
58 endpoints = [e for _, e in endpoints]
59 for endpoint in endpoints:
60 methodrules = {}
61 for rule in app.url_map.iter_rules(endpoint):
62 methods = rule.methods.difference(['OPTIONS', 'HEAD'])
63 path = translate_werkzeug_rule(rule.rule)
64 for method in methods:
65 if method in methodrules:
66 methodrules[method].append(path)
67 else:
68 methodrules[method] = [path]
69 for method, paths in methodrules.items():
70 yield method, paths, endpoint
71
72
73def quickref_directive(method, path, content):
74 rcomp = re.compile("^\s*.. :quickref:\s*(?P<quick>.*)$")
75 method = method.lower().strip()
76 if isinstance(content, six.string_types):
77 content = content.splitlines()
78 description=""
79 name=""
80 ref = path.replace("<","(").replace(">",")").replace("/","-").replace(":","-")
81 for line in content:
82 qref = rcomp.match(line)
83 if qref:
84 quickref = qref.group("quick")
85 parts = quickref.split(";",1)
86 if len(parts)>1:
87 name = parts[0]
88 description= parts[1]
89 else:
90 description= quickref
91 break
92
93 row ={}
94 row['name'] = name
95 row['operation'] = ' - `%s %s <#%s-%s>`_' % (method.upper(), path, method.lower(), ref)
96 row['description'] = description
97
98 return row
99
100class AutoflaskBase(Directive):
101
102 has_content = True
103 required_arguments = 1
104 option_spec = {'endpoints': directives.unchanged,
105 'blueprints': directives.unchanged,
106 'modules': directives.unchanged,
107 'order': directives.unchanged,
108 'undoc-endpoints': directives.unchanged,
109 'undoc-blueprints': directives.unchanged,
110 'undoc-modules': directives.unchanged,
111 'undoc-static': directives.unchanged,
112 'include-empty-docstring': directives.unchanged}
113
114 @property
115 def endpoints(self):
116 endpoints = self.options.get('endpoints', None)
117 if not endpoints:
118 return None
119 return re.split(r'\s*,\s*', endpoints)
120
121 @property
122 def undoc_endpoints(self):
123 undoc_endpoints = self.options.get('undoc-endpoints', None)
124 if not undoc_endpoints:
125 return frozenset()
126 return frozenset(re.split(r'\s*,\s*', undoc_endpoints))
127
128 @property
129 def blueprints(self):
130 blueprints = self.options.get('blueprints', None)
131 if not blueprints:
132 return None
133 return frozenset(re.split(r'\s*,\s*', blueprints))
134
135 @property
136 def undoc_blueprints(self):
137 undoc_blueprints = self.options.get('undoc-blueprints', None)
138 if not undoc_blueprints:
139 return frozenset()
140 return frozenset(re.split(r'\s*,\s*', undoc_blueprints))
141
142 @property
143 def modules(self):
144 modules = self.options.get('modules', None)
145 if not modules:
146 return frozenset()
147 return frozenset(re.split(r'\s*,\s*', modules))
148
149 @property
150 def undoc_modules(self):
151 undoc_modules = self.options.get('undoc-modules', None)
152 if not undoc_modules:
153 return frozenset()
154 return frozenset(re.split(r'\s*,\s*', undoc_modules))
155
156 @property
157 def order(self):
158 order = self.options.get('order', None)
159 if order not in (None, 'path'):
160 raise ValueError('Invalid value for :order:')
161 return order
162
163 def make_rst(self, qref=False):
164 app = import_object(self.arguments[0])
165 if self.endpoints:
166 routes = itertools.chain(*[get_routes(app, endpoint, self.order)
167 for endpoint in self.endpoints])
168 else:
169 routes = get_routes(app, order=self.order)
170 for method, paths, endpoint in routes:
171 try:
172 blueprint, _, endpoint_internal = endpoint.rpartition('.')
173 if self.blueprints and blueprint not in self.blueprints:
174 continue
175 if blueprint in self.undoc_blueprints:
176 continue
177 except ValueError:
178 pass # endpoint is not within a blueprint
179
180 if endpoint in self.undoc_endpoints:
181 continue
182 try:
183 static_url_path = app.static_url_path # Flask 0.7 or higher
184 except AttributeError:
185 static_url_path = app.static_path # Flask 0.6 or under
186 if ('undoc-static' in self.options and endpoint == 'static' and
187 static_url_path + '/(path:filename)' in paths):
188 continue
189 view = app.view_functions[endpoint]
190
191 if self.modules and view.__module__ not in self.modules:
192 continue
193
194 if self.undoc_modules and view.__module__ in self.modules:
195 continue
196
197 docstring = view.__doc__ or ''
198 if hasattr(view, 'view_class'):
199 meth_func = getattr(view.view_class, method.lower(), None)
200 if meth_func and meth_func.__doc__:
201 docstring = meth_func.__doc__
202 if not isinstance(docstring, six.text_type):
203 analyzer = ModuleAnalyzer.for_module(view.__module__)
204 docstring = force_decode(docstring, analyzer.encoding)
205
206 if not docstring and 'include-empty-docstring' not in self.options:
207 continue
208 docstring = prepare_docstring(docstring)
209 if qref == True:
210 for path in paths:
211 row = quickref_directive(method, path, docstring)
212 yield row
213 else:
214 for line in http_directive(method, paths, docstring):
215 yield line
diff --git a/_exts/httpdomain/autohttp/flaskqref.py b/_exts/httpdomain/autohttp/flaskqref.py
new file mode 100644
index 0000000..c28bb15
--- /dev/null
+++ b/_exts/httpdomain/autohttp/flaskqref.py
@@ -0,0 +1,80 @@
1"""
2 sphinxcontrib.autohttp.flaskqref
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5 The sphinx.ext.autodoc-style HTTP API quick reference
6 builder (from Flask)
7 for sphinxcontrib.httpdomain.
8
9 :copyright: Copyright 2011 by Hong Minhee
10 :license: BSD, see LICENSE for details.
11
12"""
13
14from docutils import nodes
15from docutils.statemachine import ViewList
16
17from sphinxcontrib import httpdomain
18from sphinx.util.nodes import nested_parse_with_titles
19
20from .flask import AutoflaskBase
21
22
23class QuickReferenceFlaskDirective(AutoflaskBase):
24
25
26 header = [ '',
27 '.. list-table::',
28 ' :widths: 20 45 35',
29 ' :header-rows: 1',
30 '',
31 ' * - Resource',
32 ' - Operation',
33 ' - Description'
34 ]
35
36 def run(self):
37 node = nodes.section()
38 node.document = self.state.document
39 result = ViewList()
40 for line in QuickReferenceFlaskDirective.header:
41 result.append(line, '<qrefflask>')
42 table={}
43 table_sorted_names=[]
44
45 for table_row in self.make_rst(qref=True):
46 name = table_row['name']
47 if table.get(name) is None:
48 table[name]=[]
49 table[name].append(table_row)
50 if name not in table_sorted_names:
51 table_sorted_names.append(name)
52
53 table_sorted_names.sort()
54
55 for name in table_sorted_names:
56 # Keep table display clean by not repeating duplicate
57 # resource names and descriptions
58 display_name = name
59 previous_description=None
60 for row in table[name]:
61 result.append(' * - %s' % display_name, '<qrefflask>')
62 display_name =""
63 result.append(row['operation'], '<qrefflask>')
64 description = row['description']
65 if previous_description is not None and previous_description == description:
66 description =""
67 else:
68 previous_description = description
69
70 result.append(' - %s' % description, '<qrefflask>')
71
72 result.append('', '<qrefflask>')
73 nested_parse_with_titles(self.state, result, node)
74 return node.children
75
76def setup(app):
77 if 'http' not in app.domains:
78 httpdomain.setup(app)
79 app.add_directive('qrefflask', QuickReferenceFlaskDirective)
80
diff --git a/_exts/httpdomain/autohttp/tornado.py b/_exts/httpdomain/autohttp/tornado.py
new file mode 100644
index 0000000..9a514fe
--- /dev/null
+++ b/_exts/httpdomain/autohttp/tornado.py
@@ -0,0 +1,128 @@
1"""
2 sphinxcontrib.autohttp.tornado
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5 The sphinx.ext.autodoc-style HTTP API reference builder (from Tornado)
6 for sphinxcontrib.httpdomain.
7
8 :copyright: Copyright 2013 by Rodrigo Machado
9 :license: BSD, see LICENSE for details.
10
11"""
12
13import inspect
14import re
15import six
16
17from docutils import nodes
18from docutils.parsers.rst import directives
19from docutils.statemachine import ViewList
20
21from sphinx.util import force_decode
22from sphinx.util.compat import Directive
23from sphinx.util.nodes import nested_parse_with_titles
24from sphinx.util.docstrings import prepare_docstring
25from sphinx.pycode import ModuleAnalyzer
26
27from sphinxcontrib import httpdomain
28from sphinxcontrib.autohttp.common import http_directive, import_object
29
30
31def translate_tornado_rule(app, rule):
32 buf = six.StringIO()
33 for name, filter, conf in app.router.parse_rule(rule):
34 if filter:
35 buf.write('(')
36 buf.write(name)
37 if filter != app.router.default_filter or conf:
38 buf.write(':')
39 buf.write(filter)
40 if conf:
41 buf.write(':')
42 buf.write(conf)
43 buf.write(')')
44 else:
45 buf.write(name)
46 return buf.getvalue()
47
48
49def get_routes(app):
50 for spec in app.handlers[0][1]:
51 handler = spec.handler_class
52 doc_methods = list(handler.SUPPORTED_METHODS)
53 if 'HEAD' in doc_methods:
54 doc_methods.remove('HEAD')
55 if 'OPTIONS' in doc_methods:
56 doc_methods.remove('OPTIONS')
57
58 for method in doc_methods:
59 maybe_method = getattr(handler, method.lower(), None)
60 if (inspect.isfunction(maybe_method) or
61 inspect.ismethod(maybe_method)):
62 yield method.lower(), spec.regex.pattern, handler
63
64
65def normalize_path(path):
66 if path.endswith('$'):
67 path = path[:-1]
68 return path
69
70
71class AutoTornadoDirective(Directive):
72
73 has_content = True
74 required_arguments = 1
75 option_spec = {'endpoints': directives.unchanged,
76 'undoc-endpoints': directives.unchanged,
77 'include-empty-docstring': directives.unchanged}
78
79 @property
80 def endpoints(self):
81 endpoints = self.options.get('endpoints', None)
82 if not endpoints:
83 return None
84 return frozenset(re.split(r'\s*,\s*', endpoints))
85
86 @property
87 def undoc_endpoints(self):
88 undoc_endpoints = self.options.get('undoc-endpoints', None)
89 if not undoc_endpoints:
90 return frozenset()
91 return frozenset(re.split(r'\s*,\s*', undoc_endpoints))
92
93 def make_rst(self):
94 app = import_object(self.arguments[0])
95 for method, path, handler in get_routes(app):
96 class_name = handler.__name__
97 method_name = getattr(handler, method).__name__
98 endpoint = '.'.join((class_name, method_name))
99
100 if self.endpoints and endpoint not in self.endpoints:
101 continue
102 if endpoint in self.undoc_endpoints:
103 continue
104
105 docstring = getattr(handler, method).__doc__ or ''
106 #if not isinstance(docstring, unicode):
107 # analyzer = ModuleAnalyzer.for_module(view.__module__)
108 # docstring = force_decode(docstring, analyzer.encoding)
109 if not docstring and 'include-empty-docstring' not in self.options:
110 continue
111 docstring = prepare_docstring(docstring)
112 for line in http_directive(method, normalize_path(path), docstring):
113 yield line
114
115 def run(self):
116 node = nodes.section()
117 node.document = self.state.document
118 result = ViewList()
119 for line in self.make_rst():
120 result.append(line, '<autotornado>')
121 nested_parse_with_titles(self.state, result, node)
122 return node.children
123
124
125def setup(app):
126 if 'http' not in app.domains:
127 httpdomain.setup(app)
128 app.add_directive('autotornado', AutoTornadoDirective)
diff --git a/_exts/httpdomain/httpdomain.py b/_exts/httpdomain/httpdomain.py
new file mode 100644
index 0000000..b31142b
--- /dev/null
+++ b/_exts/httpdomain/httpdomain.py
@@ -0,0 +1,773 @@
1"""
2 sphinxcontrib.httpdomain
3 ~~~~~~~~~~~~~~~~~~~~~~~~
4
5 The HTTP domain for documenting RESTful HTTP APIs.
6
7 :copyright: Copyright 2011 by Hong Minhee
8 :license: BSD, see LICENSE for details.
9
10"""
11
12import re
13
14from docutils import nodes
15
16from pygments.lexer import RegexLexer, bygroups
17from pygments.lexers import get_lexer_by_name
18from pygments.token import Literal, Text, Operator, Keyword, Name, Number
19from pygments.util import ClassNotFound
20
21from sphinx import addnodes
22from sphinx.roles import XRefRole
23from sphinx.domains import Domain, ObjType, Index
24from sphinx.directives import ObjectDescription, directives
25from sphinx.util.nodes import make_refnode
26from sphinx.util.docfields import GroupedField, TypedField
27
28# The env.get_doctree() lookup results in a pickle.load() call which is
29# expensive enough to dominate the runtime entirely when the number of endpoints
30# and references is large enough. The doctrees are generated during the read-
31# phase and we can cache their lookup during the write-phase significantly
32# improving performance.
33# Currently sphinxcontrib-httpdomain does not declare to support parallel read
34# support (parallel_read_safe is the default False) so we can simply use a
35# module global to hold the cache.
36_doctree_cache = {}
37
38
39class DocRef(object):
40 """Represents a reference to an abstract specification."""
41
42 def __init__(self, base_url, anchor, section):
43 self.base_url = base_url
44 self.anchor = anchor
45 self.section = section
46
47 def __repr__(self):
48 """Returns the URL onto related specification section for the related
49 object."""
50 return '{0}#{1}{2}'.format(self.base_url, self.anchor, self.section)
51
52
53class RFC2616Ref(DocRef):
54 """Represents a reference to RFC2616.
55 In 2014, RFC2616 was replaced by multiple RFCs (7230-7237)."""
56
57 def __init__(self, section):
58 url = 'http://www.w3.org/Protocols/rfc2616/rfc2616-sec{0:d}.html'
59 url = url.format(int(section))
60 super(RFC2616Ref, self).__init__(url, 'sec', section)
61
62
63class IETFRef(DocRef):
64 """Represents a reference to the specific IETF RFC."""
65
66 def __init__(self, rfc, section):
67 url = 'https://tools.ietf.org/html/rfc{0:d}'.format(rfc)
68 super(IETFRef, self).__init__(url, 'section-', section)
69
70
71class EventSourceRef(DocRef):
72
73 def __init__(self, section):
74 url = 'http://www.w3.org/TR/eventsource/'
75 super(EventSourceRef, self).__init__(url, section, '')
76
77
78class CORSRef(DocRef):
79 """Represents a reference to W3 Cross-Origin Resource Sharing recommendation."""
80
81 def __init__(self, name, type):
82 url = 'http://www.w3.org/TR/cors/'
83 super(CORSRef, self).__init__(url, name, '-' + type)
84
85
86#: Mapping from lowercase HTTP method name to :class:`DocRef` object which
87#: maintains the URL which points to the section of the RFC which defines that
88#: HTTP method.
89METHOD_REFS = {
90 'patch': IETFRef(5789, 2),
91 'options': IETFRef(7231, '4.3.7'),
92 'get': IETFRef(7231, '4.3.1'),
93 'head': IETFRef(7231, '4.3.2'),
94 'post': IETFRef(7231, '4.3.3'),
95 'put': IETFRef(7231, '4.3.4'),
96 'delete': IETFRef(7231, '4.3.5'),
97 'trace': IETFRef(7231, '4.3.8'),
98 'connect': IETFRef(7231, '4.3.6'),
99 'copy': IETFRef(2518, 8.8),
100 'any': ''
101}
102
103
104#: Mapping from HTTP header name to :class:`DocRef` object which
105#: maintains the URL which points to the related section of the RFC.
106HEADER_REFS = {
107 'Accept': IETFRef(7231, '5.3.2'),
108 'Accept-Charset': IETFRef(7231, '5.3.3'),
109 'Accept-Encoding': IETFRef(7231, '5.3.4'),
110 'Accept-Language': IETFRef(7231, '5.3.5'),
111 'Accept-Ranges': IETFRef(7233, 2.3),
112 'Age': IETFRef(7234, 5.1),
113 'Allow': IETFRef(7231, '7.4.1'),
114 'Authorization': IETFRef(7235, 4.2),
115 'Cache-Control': IETFRef(7234, 5.2),
116 'Connection': IETFRef(7230, 6.1),
117 'Content-Encoding': IETFRef(7231, '3.1.2.2'),
118 'Content-Language': IETFRef(7231, '3.1.3.2'),
119 'Content-Length': IETFRef(7230, '3.3.2'),
120 'Content-Location': IETFRef(7231, '3.1.4.2'),
121 'Content-MD5': RFC2616Ref(14.15), # removed
122 'Content-Range': IETFRef(7233, 4.2),
123 'Content-Type': IETFRef(7231, '3.1.1.5'),
124 'Cookie': IETFRef(2109, '4.3.4'), # also RFC6265 section 5.4
125 'Date': IETFRef(7231, '7.1.1.2'),
126 'Destination': IETFRef(2518, 9.3),
127 'ETag': IETFRef(7232, 2.3),
128 'Expect': IETFRef(7231, '5.1.1'),
129 'Expires': IETFRef(7234, 5.3),
130 'From': IETFRef(7231, '5.5.2'),
131 'Host': IETFRef(7230, 5.4),
132 'If-Match': IETFRef(7232, 3.1),
133 'If-Modified-Since': IETFRef(7232, 3.3),
134 'If-None-Match': IETFRef(7232, 3.2),
135 'If-Range': IETFRef(7233, 3.2),
136 'If-Unmodified-Since': IETFRef(7232, 3.4),
137 'Last-Event-ID': EventSourceRef('last-event-id'),
138 'Last-Modified': IETFRef(7232, 2.2),
139 'Link': IETFRef(5988, '5'),
140 'Location': IETFRef(7231, '7.1.2'),
141 'Max-Forwards': IETFRef(7231, '5.1.2'),
142 'Pragma': IETFRef(7234, 5.4),
143 'Proxy-Authenticate': IETFRef(7235, 4.3),
144 'Proxy-Authorization': IETFRef(7235, 4.4),
145 'Range': IETFRef(7233, 3.1),
146 'Referer': IETFRef(7231, '5.5.2'),
147 'Retry-After': IETFRef(7231, '7.1.3'),
148 'Server': IETFRef(7231, '7.4.2'),
149 'Set-Cookie': IETFRef(2109, '4.2.2'),
150 'TE': IETFRef(7230, 4.3),
151 'Trailer': IETFRef(7230, 4.4),
152 'Transfer-Encoding': IETFRef(7230, '3.3.1'),
153 'Upgrade': IETFRef(7230, 6.7),
154 'User-Agent': IETFRef(7231, '5.5.3'),
155 'Vary': IETFRef(7231, '7.1.4'),
156 'Via': IETFRef(7230, '5.7.1'),
157 'Warning': IETFRef(7234, 5.5),
158 'WWW-Authenticate': IETFRef(7235, 4.1),
159 'Access-Control-Allow-Origin': CORSRef('access-control-allow-origin',
160 'response-header'),
161 'Access-Control-Allow-Credentials': CORSRef('access-control-allow-credentials',
162 'response-header'),
163 'Access-Control-Expose-Headers': CORSRef('access-control-expose-headers',
164 'response-header'),
165 'Access-Control-Max-Age': CORSRef('access-control-max-age',
166 'response-header'),
167 'Access-Control-Allow-Methods': CORSRef('access-control-allow-methods',
168 'response-header'),
169 'Access-Control-Allow-Headers': CORSRef('access-control-allow-headers',
170 'response-header'),
171 'Origin': CORSRef('origin', 'request-header'),
172 'Access-Control-Request-Method': CORSRef('access-control-request-method',
173 'response-header'),
174 'Access-Control-Request-Headers': CORSRef('access-control-request-headers',
175 'response-header'),
176}
177
178
179HTTP_STATUS_CODES = {
180 100: 'Continue',
181 101: 'Switching Protocols',
182 102: 'Processing',
183 200: 'OK',
184 201: 'Created',
185 202: 'Accepted',
186 203: 'Non Authoritative Information',
187 204: 'No Content',
188 205: 'Reset Content',
189 206: 'Partial Content',
190 207: 'Multi Status',
191 226: 'IM Used', # see RFC 3229
192 300: 'Multiple Choices',
193 301: 'Moved Permanently',
194 302: 'Found',
195 303: 'See Other',
196 304: 'Not Modified',
197 305: 'Use Proxy',
198 307: 'Temporary Redirect',
199 308: 'Permanent Redirect',
200 400: 'Bad Request',
201 401: 'Unauthorized',
202 402: 'Payment Required', # unused
203 403: 'Forbidden',
204 404: 'Not Found',
205 405: 'Method Not Allowed',
206 406: 'Not Acceptable',
207 407: 'Proxy Authentication Required',
208 408: 'Request Timeout',
209 409: 'Conflict',
210 410: 'Gone',
211 411: 'Length Required',
212 412: 'Precondition Failed',
213 413: 'Request Entity Too Large',
214 414: 'Request URI Too Long',
215 415: 'Unsupported Media Type',
216 416: 'Requested Range Not Satisfiable',
217 417: 'Expectation Failed',
218 418: "I'm a teapot", # see RFC 2324
219 422: 'Unprocessable Entity',
220 423: 'Locked',
221 424: 'Failed Dependency',
222 425: 'Too Early', # RFC 8470
223 426: 'Upgrade Required',
224 429: 'Too Many Requests',
225 449: 'Retry With', # proprietary MS extension
226 451: 'Unavailable For Legal Reasons',
227 500: 'Internal Server Error',
228 501: 'Not Implemented',
229 502: 'Bad Gateway',
230 503: 'Service Unavailable',
231 504: 'Gateway Timeout',
232 505: 'HTTP Version Not Supported',
233 507: 'Insufficient Storage',
234 510: 'Not Extended'
235}
236
237WEBDAV_STATUS_CODES = [207, 422, 423, 424, 507]
238
239http_sig_param_re = re.compile(r'\((?:(?P<type>[^:)]+):)?(?P<name>[\w_]+)\)',
240 re.VERBOSE)
241
242
243def sort_by_method(entries):
244 def cmp(item):
245 order = ['HEAD', 'GET', 'POST', 'PUT', 'DELETE', 'PATCH',
246 'OPTIONS', 'TRACE', 'CONNECT', 'COPY', 'ANY']
247 method = item[0].split(' ', 1)[0]
248 if method in order:
249 return order.index(method)
250 return 100
251 return sorted(entries, key=cmp)
252
253
254def http_resource_anchor(method, path):
255 path = re.sub(r'[{}]', '', re.sub(r'[<>:/]', '-', path))
256 return method.lower() + '-' + path
257
258
259class HTTPResource(ObjectDescription):
260
261 doc_field_types = [
262 TypedField('parameter', label='Parameters',
263 names=('param', 'parameter', 'arg', 'argument'),
264 typerolename='obj', typenames=('paramtype', 'type')),
265 TypedField('jsonparameter', label='JSON Parameters',
266 names=('jsonparameter', 'jsonparam', 'json'),
267 typerolename='obj', typenames=('jsonparamtype', 'jsontype')),
268 TypedField('requestjsonobject', label='Request JSON Object',
269 names=('reqjsonobj', 'reqjson', '<jsonobj', '<json'),
270 typerolename='obj', typenames=('reqjsonobj', '<jsonobj')),
271 TypedField('requestjsonarray', label='Request JSON Array of Objects',
272 names=('reqjsonarr', '<jsonarr'),
273 typerolename='obj',
274 typenames=('reqjsonarrtype', '<jsonarrtype')),
275 TypedField('responsejsonobject', label='Response JSON Object',
276 names=('resjsonobj', 'resjson', '>jsonobj', '>json'),
277 typerolename='obj', typenames=('resjsonobj', '>jsonobj')),
278 TypedField('responsejsonarray', label='Response JSON Array of Objects',
279 names=('resjsonarr', '>jsonarr'),
280 typerolename='obj',
281 typenames=('resjsonarrtype', '>jsonarrtype')),
282 TypedField('queryparameter', label='Query Parameters',
283 names=('queryparameter', 'queryparam', 'qparam', 'query'),
284 typerolename='obj',
285 typenames=('queryparamtype', 'querytype', 'qtype')),
286 GroupedField('formparameter', label='Form Parameters',
287 names=('formparameter', 'formparam', 'fparam', 'form')),
288 GroupedField('requestheader', label='Request Headers',
289 rolename='header',
290 names=('<header', 'reqheader', 'requestheader')),
291 GroupedField('responseheader', label='Response Headers',
292 rolename='header',
293 names=('>header', 'resheader', 'responseheader')),
294 GroupedField('statuscode', label='Status Codes',
295 rolename='statuscode',
296 names=('statuscode', 'status', 'code'))
297 ]
298
299 option_spec = {
300 'deprecated': directives.flag,
301 'noindex': directives.flag,
302 'synopsis': lambda x: x,
303 }
304
305 method = NotImplemented
306
307 def handle_signature(self, sig, signode):
308 method = self.method.upper() + ' '
309 signode += addnodes.desc_name(method, method)
310 offset = 0
311 path = None
312 for match in http_sig_param_re.finditer(sig):
313 path = sig[offset:match.start()]
314 signode += addnodes.desc_name(path, path)
315 params = addnodes.desc_parameterlist()
316 typ = match.group('type')
317 if typ:
318 typ += ': '
319 params += addnodes.desc_annotation(typ, typ)
320 name = match.group('name')
321 params += addnodes.desc_parameter(name, name)
322 signode += params
323 offset = match.end()
324 if offset < len(sig):
325 path = sig[offset:len(sig)]
326 signode += addnodes.desc_name(path, path)
327 assert path is not None, 'no matches for sig: %s' % sig
328 fullname = self.method.upper() + ' ' + path
329 signode['method'] = self.method
330 signode['path'] = sig
331 signode['fullname'] = fullname
332 return (fullname, self.method, sig)
333
334 def needs_arglist(self):
335 return False
336
337 def add_target_and_index(self, name_cls, sig, signode):
338 signode['ids'].append(http_resource_anchor(*name_cls[1:]))
339 if 'noindex' not in self.options:
340 self.env.domaindata['http'][self.method][sig] = (
341 self.env.docname,
342 self.options.get('synopsis', ''),
343 'deprecated' in self.options)
344
345 def get_index_text(self, modname, name):
346 return ''
347
348
349class HTTPOptions(HTTPResource):
350
351 method = 'options'
352
353
354class HTTPHead(HTTPResource):
355
356 method = 'head'
357
358
359class HTTPPatch(HTTPResource):
360
361 method = 'patch'
362
363
364class HTTPPost(HTTPResource):
365
366 method = 'post'
367
368
369class HTTPGet(HTTPResource):
370
371 method = 'get'
372
373
374class HTTPPut(HTTPResource):
375
376 method = 'put'
377
378
379class HTTPDelete(HTTPResource):
380
381 method = 'delete'
382
383
384class HTTPTrace(HTTPResource):
385
386 method = 'trace'
387
388
389class HTTPConnect(HTTPResource):
390
391 method = 'connect'
392
393
394class HTTPCopy(HTTPResource):
395
396 method = 'copy'
397
398
399class HTTPAny(HTTPResource):
400
401 method = 'any'
402
403
404class HTTPXRefRole(XRefRole):
405
406 def __init__(self, method, **kwargs):
407 XRefRole.__init__(self, **kwargs)
408 self.method = method
409
410 def process_link(self, env, refnode, has_explicit_title, title, target):
411 if not has_explicit_title:
412 title = self.method.upper() + ' ' + title
413 return title, target
414
415
416class HTTPXRefMethodRole(XRefRole):
417
418 def result_nodes(self, document, env, node, is_ref):
419 method = node[0][0].lower()
420 rawsource = node[0].rawsource
421 config = env.domains['http'].env.config
422 if method not in METHOD_REFS:
423 if not config['http_strict_mode']:
424 return [nodes.emphasis(method, method)], []
425 reporter = document.reporter
426 msg = reporter.error('%s is not valid HTTP method' % method,
427 line=node.line)
428 prb = nodes.problematic(method, method)
429 return [prb], [msg]
430 url = str(METHOD_REFS[method])
431 if not url:
432 return [nodes.emphasis(method, method)], []
433 node = nodes.reference(rawsource, method.upper(), refuri=url)
434 return [node], []
435
436
437class HTTPXRefStatusRole(XRefRole):
438
439 def result_nodes(self, document, env, node, is_ref):
440 def get_code_status(text):
441 if text.isdigit():
442 code = int(text)
443 return code, HTTP_STATUS_CODES.get(code)
444 else:
445 try:
446 code, status = re.split(r'\s', text.strip(), 1)
447 code = int(code)
448 except ValueError:
449 return None, None
450 known_status = HTTP_STATUS_CODES.get(code)
451 if known_status is None:
452 return code, None
453 elif known_status.lower() != status.lower():
454 return code, None
455 else:
456 return code, status
457
458 def report_unknown_code():
459 if not config['http_strict_mode']:
460 return [nodes.emphasis(text, text)], []
461 reporter = document.reporter
462 msg = reporter.error('%d is unknown HTTP status code' % code,
463 line=node.line)
464 prb = nodes.problematic(text, text)
465 return [prb], [msg]
466
467 def report_invalid_code():
468 if not config['http_strict_mode']:
469 return [nodes.emphasis(text, text)], []
470 reporter = document.reporter
471 msg = reporter.error(
472 'HTTP status code must be an integer (e.g. `200`) or '
473 'start with an integer (e.g. `200 OK`); %r is invalid' %
474 text,
475 line=node.line
476 )
477 prb = nodes.problematic(text, text)
478 return [prb], [msg]
479
480 text = node[0][0]
481 rawsource = node[0].rawsource
482 config = env.domains['http'].env.config
483
484 code, status = get_code_status(text)
485 if code is None:
486 return report_invalid_code()
487 elif status is None:
488 return report_unknown_code()
489 elif code == 226:
490 url = 'http://www.ietf.org/rfc/rfc3229.txt'
491 elif code == 418:
492 url = 'http://www.ietf.org/rfc/rfc2324.txt'
493 elif code == 429:
494 url = 'http://tools.ietf.org/html/rfc6585#section-4'
495 elif code == 449:
496 url = 'http://msdn.microsoft.com/en-us/library/dd891478(v=prot.10).aspx'
497 elif code == 451:
498 url = 'http://www.ietf.org/rfc/rfc7725.txt'
499 elif code in WEBDAV_STATUS_CODES:
500 url = 'http://tools.ietf.org/html/rfc4918#section-11.%d' % (WEBDAV_STATUS_CODES.index(code) + 1)
501 elif code in HTTP_STATUS_CODES:
502 url = 'http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html' \
503 '#sec10.' + ('%d.%d' % (code // 100, 1 + code % 100))
504 else:
505 url = ''
506 node = nodes.reference(rawsource, '%d %s' % (code, status), refuri=url)
507 return [node], []
508
509
510class HTTPXRefHeaderRole(XRefRole):
511
512 def result_nodes(self, document, env, node, is_ref):
513 header = node[0][0]
514 rawsource = node[0].rawsource
515 if header not in HEADER_REFS:
516 _header = '-'.join(map(lambda i: i.title(), header.split('-')))
517 if _header not in HEADER_REFS:
518 return [nodes.emphasis(header, header)], []
519 url = str(HEADER_REFS[header])
520 node = nodes.reference(rawsource, header, refuri=url)
521 return [node], []
522
523
524class HTTPIndex(Index):
525
526 name = 'routingtable'
527 localname = 'HTTP Routing Table'
528 shortname = 'routing table'
529
530 def __init__(self, *args, **kwargs):
531 super(HTTPIndex, self).__init__(*args, **kwargs)
532
533 self.ignore = [
534 [l for l in x.split('/') if l]
535 for x in self.domain.env.config['http_index_ignore_prefixes']]
536 self.ignore.sort(reverse=True)
537
538 # During HTML generation these values pick from class,
539 # not from instance so we have a little hack the system
540 cls = self.__class__
541 cls.shortname = self.domain.env.config['http_index_shortname']
542 cls.localname = self.domain.env.config['http_index_localname']
543
544 def grouping_prefix(self, path):
545 letters = [x for x in path.split('/') if x]
546 for prefix in self.ignore:
547 if letters[:len(prefix)] == prefix:
548 return '/' + '/'.join(letters[:len(prefix) + 1])
549 return '/%s' % (letters[0] if letters else '',)
550
551 def generate(self, docnames=None):
552 content = {}
553 items = ((method, path, info)
554 for method, routes in self.domain.routes.items()
555 for path, info in routes.items())
556 items = sorted(items, key=lambda item: item[1])
557 for method, path, info in items:
558 entries = content.setdefault(self.grouping_prefix(path), [])
559 entries.append([
560 method.upper() + ' ' + path, 0, info[0],
561 http_resource_anchor(method, path),
562 '', 'Deprecated' if info[2] else '', info[1]
563 ])
564 items = sorted(
565 (path, sort_by_method(entries))
566 for path, entries in content.items()
567 )
568 return (items, True)
569
570
571class HTTPDomain(Domain):
572 """HTTP domain."""
573
574 name = 'http'
575 label = 'HTTP'
576
577 object_types = {
578 'options': ObjType('options', 'options', 'obj'),
579 'head': ObjType('head', 'head', 'obj'),
580 'post': ObjType('post', 'post', 'obj'),
581 'get': ObjType('get', 'get', 'obj'),
582 'put': ObjType('put', 'put', 'obj'),
583 'patch': ObjType('patch', 'patch', 'obj'),
584 'delete': ObjType('delete', 'delete', 'obj'),
585 'trace': ObjType('trace', 'trace', 'obj'),
586 'connect': ObjType('connect', 'connect', 'obj'),
587 'copy': ObjType('copy', 'copy', 'obj'),
588 'any': ObjType('any', 'any', 'obj')
589 }
590
591 directives = {
592 'options': HTTPOptions,
593 'head': HTTPHead,
594 'post': HTTPPost,
595 'get': HTTPGet,
596 'put': HTTPPut,
597 'patch': HTTPPatch,
598 'delete': HTTPDelete,
599 'trace': HTTPTrace,
600 'connect': HTTPConnect,
601 'copy': HTTPCopy,
602 'any': HTTPAny
603 }
604
605 roles = {
606 'options': HTTPXRefRole('options'),
607 'head': HTTPXRefRole('head'),
608 'post': HTTPXRefRole('post'),
609 'get': HTTPXRefRole('get'),
610 'put': HTTPXRefRole('put'),
611 'patch': HTTPXRefRole('patch'),
612 'delete': HTTPXRefRole('delete'),
613 'trace': HTTPXRefRole('trace'),
614 'connect': HTTPXRefRole('connect'),
615 'copy': HTTPXRefRole('copy'),
616 'any': HTTPXRefRole('any'),
617 'statuscode': HTTPXRefStatusRole(),
618 'method': HTTPXRefMethodRole(),
619 'header': HTTPXRefHeaderRole()
620 }
621
622 initial_data = {
623 'options': {}, # path: (docname, synopsis)
624 'head': {},
625 'post': {},
626 'get': {},
627 'put': {},
628 'patch': {},
629 'delete': {},
630 'trace': {},
631 'connect': {},
632 'copy': {},
633 'any': {}
634 }
635
636 indices = []
637
638 @property
639 def routes(self):
640 return dict((key, self.data[key]) for key in self.object_types)
641
642 def clear_doc(self, docname):
643 for typ, routes in self.routes.items():
644 for path, info in list(routes.items()):
645 if info[0] == docname:
646 del routes[path]
647
648 def resolve_xref(self, env, fromdocname, builder, typ, target,
649 node, contnode):
650 try:
651 info = self.data[str(typ)][target]
652 except KeyError:
653 text = contnode.rawsource
654 role = self.roles.get(typ)
655 if role is None:
656 return None
657
658 if fromdocname not in _doctree_cache:
659 _doctree_cache[fromdocname] = env.get_doctree(fromdocname)
660 doctree = _doctree_cache[fromdocname]
661
662 resnode = role.result_nodes(doctree, env, node, None)[0][0]
663 if isinstance(resnode, addnodes.pending_xref):
664 text = node[0][0]
665 reporter = doctree.reporter
666 reporter.warning('Cannot resolve reference to %r' % text,
667 line=node.line)
668 return None
669 return resnode
670 else:
671 anchor = http_resource_anchor(typ, target)
672 title = typ.upper() + ' ' + target
673 return make_refnode(builder, fromdocname, info[0], anchor,
674 contnode, title)
675
676 def resolve_any_xref(self, env, fromdocname, builder, target, node, contnode):
677 """Resolve the pending_xref *node* with the given *target*.
678
679 The reference comes from an "any" or similar role, which means that Sphinx
680 don't know the type.
681
682 For now sphinxcontrib-httpdomain doesn't resolve any xref nodes.
683
684 :return:
685 list of tuples ``('domain:role', newnode)``, where ``'domain:role'``
686 is the name of a role that could have created the same reference,
687 """
688 return []
689
690 def get_objects(self):
691 for method, routes in self.routes.items():
692 for path, info in routes.items():
693 anchor = http_resource_anchor(method, path)
694 yield (path, path, method, info[0], anchor, 1)
695
696
697class HTTPLexer(RegexLexer):
698 """Lexer for HTTP sessions."""
699
700 name = 'HTTP'
701 aliases = ['http']
702
703 flags = re.DOTALL
704
705 def header_callback(self, match):
706 if match.group(1).lower() == 'content-type':
707 content_type = match.group(5).strip()
708 if ';' in content_type:
709 content_type = content_type[:content_type.find(';')].strip()
710 self.content_type = content_type
711 yield match.start(1), Name.Attribute, match.group(1)
712 yield match.start(2), Text, match.group(2)
713 yield match.start(3), Operator, match.group(3)
714 yield match.start(4), Text, match.group(4)
715 yield match.start(5), Literal, match.group(5)
716 yield match.start(6), Text, match.group(6)
717
718 def continuous_header_callback(self, match):
719 yield match.start(1), Text, match.group(1)
720 yield match.start(2), Literal, match.group(2)
721 yield match.start(3), Text, match.group(3)
722
723 def content_callback(self, match):
724 content_type = getattr(self, 'content_type', None)
725 content = match.group()
726 offset = match.start()
727 if content_type:
728 from pygments.lexers import get_lexer_for_mimetype
729 try:
730 lexer = get_lexer_for_mimetype(content_type)
731 except ClassNotFound:
732 pass
733 else:
734 for idx, token, value in lexer.get_tokens_unprocessed(content):
735 yield offset + idx, token, value
736 return
737 yield offset, Text, content
738
739 tokens = {
740 'root': [
741 (r'(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE|COPY)( +)([^ ]+)( +)'
742 r'(HTTPS?)(/)(1\.[01])(\r?\n|$)',
743 bygroups(Name.Function, Text, Name.Namespace, Text,
744 Keyword.Reserved, Operator, Number, Text),
745 'headers'),
746 (r'(HTTPS?)(/)(1\.[01])( +)(\d{3})( +)([^\r\n]+)(\r?\n|$)',
747 bygroups(Keyword.Reserved, Operator, Number, Text, Number,
748 Text, Name.Exception, Text),
749 'headers'),
750 ],
751 'headers': [
752 (r'([^\s:]+)( *)(:)( *)([^\r\n]+)(\r?\n|$)', header_callback),
753 (r'([\t ]+)([^\r\n]+)(\r?\n|$)', continuous_header_callback),
754 (r'\r?\n', Text, 'content')
755 ],
756 'content': [
757 (r'.+', content_callback)
758 ]
759 }
760
761
762def setup(app):
763 app.add_domain(HTTPDomain)
764
765 try:
766 get_lexer_by_name('http')
767 except ClassNotFound:
768 app.add_lexer('http', HTTPLexer())
769 app.add_config_value('http_index_ignore_prefixes', [], None)
770 app.add_config_value('http_index_shortname', 'routing table', True)
771 app.add_config_value('http_index_localname', 'HTTP Routing Table', True)
772 app.add_config_value('http_strict_mode', True, None)
773 app.add_config_value('http_headers_ignore_prefixes', ['X-'], None)
diff --git a/_exts/typescriptdomain.py b/_exts/typescriptdomain.py
new file mode 100644
index 0000000..50ffdc0
--- /dev/null
+++ b/_exts/typescriptdomain.py
@@ -0,0 +1,587 @@
1"""
2TypeScript domain.
3
4:copyright: Copyright 2019 by Taler Systems SA
5:license: LGPLv3+
6:author: Florian Dold
7"""
8
9import re
10
11from pathlib import Path
12
13from docutils import nodes
14from typing import List, Optional, Iterable, Dict, Tuple
15from typing import cast
16
17from pygments.lexers import get_lexer_by_name
18from pygments.filter import Filter
19from pygments.token import Literal, Text, Operator, Keyword, Name, Number
20from pygments.token import Comment, Token, _TokenType
21from pygments.token import *
22from pygments.lexer import RegexLexer, bygroups, include
23from pygments.formatters import HtmlFormatter
24
25from docutils import nodes
26from docutils.nodes import Element, Node
27
28from sphinx.roles import XRefRole
29from sphinx.domains import Domain, ObjType, Index
30from sphinx.directives import directives
31from sphinx.util.docutils import SphinxDirective
32from sphinx.util.nodes import make_refnode
33from sphinx.util import logging
34from sphinx.highlighting import PygmentsBridge
35from sphinx.builders.html import StandaloneHTMLBuilder
36from sphinx.pygments_styles import SphinxStyle
37
38logger = logging.getLogger(__name__)
39
40
41class TypeScriptDefinition(SphinxDirective):
42 """
43 Directive for a code block with special highlighting or line numbering
44 settings.
45 """
46
47 has_content = True
48 required_arguments = 1
49 optional_arguments = 0
50 final_argument_whitespace = False
51 option_spec = {
52 "force": directives.flag,
53 "linenos": directives.flag,
54 "dedent": int,
55 "lineno-start": int,
56 "emphasize-lines": directives.unchanged_required,
57 "caption": directives.unchanged_required,
58 "class": directives.class_option,
59 }
60
61 def run(self) -> List[Node]:
62 document = self.state.document
63 code = "\n".join(self.content)
64 location = self.state_machine.get_source_and_line(self.lineno)
65
66 linespec = self.options.get("emphasize-lines")
67 if linespec:
68 try:
69 nlines = len(self.content)
70 hl_lines = parselinenos(linespec, nlines)
71 if any(i >= nlines for i in hl_lines):
72 logger.warning(
73 __("line number spec is out of range(1-%d): %r")
74 % (nlines, self.options["emphasize-lines"]),
75 location=location,
76 )
77
78 hl_lines = [x + 1 for x in hl_lines if x < nlines]
79 except ValueError as err:
80 return [document.reporter.warning(err, line=self.lineno)]
81 else:
82 hl_lines = None
83
84 if "dedent" in self.options:
85 location = self.state_machine.get_source_and_line(self.lineno)
86 lines = code.split("\n")
87 lines = dedent_lines(lines, self.options["dedent"], location=location)
88 code = "\n".join(lines)
89
90 literal = nodes.literal_block(code, code) # type: Element
91 if "linenos" in self.options or "lineno-start" in self.options:
92 literal["linenos"] = True
93 literal["classes"] += self.options.get("class", [])
94 literal["force"] = "force" in self.options
95 literal["language"] = "tsref"
96 extra_args = literal["highlight_args"] = {}
97 if hl_lines is not None:
98 extra_args["hl_lines"] = hl_lines
99 if "lineno-start" in self.options:
100 extra_args["linenostart"] = self.options["lineno-start"]
101 self.set_source_info(literal)
102
103 caption = self.options.get("caption")
104 if caption:
105 try:
106 literal = container_wrapper(self, literal, caption)
107 except ValueError as exc:
108 return [document.reporter.warning(exc, line=self.lineno)]
109
110 tsid = "tsref-type-" + self.arguments[0]
111 literal["ids"].append(tsid)
112
113 tsname = self.arguments[0]
114 ts = self.env.get_domain("ts")
115 ts.add_object("type", tsname, self.env.docname, tsid)
116
117 return [literal]
118
119
120class TypeScriptDomain(Domain):
121 """TypeScript domain."""
122
123 name = "ts"
124 label = "TypeScript"
125
126 directives = {
127 "def": TypeScriptDefinition,
128 }
129
130 roles = {
131 "type": XRefRole(
132 lowercase=False, warn_dangling=True, innernodeclass=nodes.inline
133 ),
134 }
135
136 dangling_warnings = {
137 "type": "undefined TypeScript type: %(target)s",
138 }
139
140 def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode):
141 try:
142 info = self.objects[(str(typ), str(target))]
143 except KeyError:
144 logger.warn("type {}/{} not found".format(typ, target))
145 return None
146 else:
147 anchor = "tsref-type-{}".format(str(target))
148 title = typ.upper() + " " + target
149 return make_refnode(builder, fromdocname, info[0], anchor, contnode, title)
150
151 def resolve_any_xref(self, env, fromdocname, builder, target, node, contnode):
152 """Resolve the pending_xref *node* with the given *target*.
153
154 The reference comes from an "any" or similar role, which means that Sphinx
155 don't know the type.
156
157 For now sphinxcontrib-httpdomain doesn't resolve any xref nodes.
158
159 :return:
160 list of tuples ``('domain:role', newnode)``, where ``'domain:role'``
161 is the name of a role that could have created the same reference,
162 """
163 ret = []
164 try:
165 info = self.objects[("type", str(target))]
166 except KeyError:
167 pass
168 else:
169 anchor = "tsref-type-{}".format(str(target))
170 title = "TYPE" + " " + target
171 node = make_refnode(builder, fromdocname, info[0], anchor, contnode, title)
172 ret.append(("ts:type", node))
173 return ret
174
175 @property
176 def objects(self) -> Dict[Tuple[str, str], Tuple[str, str]]:
177 return self.data.setdefault(
178 "objects", {}
179 ) # (objtype, name) -> docname, labelid
180
181 def add_object(self, objtype: str, name: str, docname: str, labelid: str) -> None:
182 self.objects[objtype, name] = (docname, labelid)
183
184
185class BetterTypeScriptLexer(RegexLexer):
186 """
187 For `TypeScript <https://www.typescriptlang.org/>`_ source code.
188 """
189
190 name = "TypeScript"
191 aliases = ["ts"]
192 filenames = ["*.ts"]
193 mimetypes = ["text/x-typescript"]
194
195 flags = re.DOTALL
196 tokens = {
197 "commentsandwhitespace": [
198 (r"\s+", Text),
199 (r"<!--", Comment),
200 (r"//.*?\n", Comment.Single),
201 (r"/\*.*?\*/", Comment.Multiline),
202 ],
203 "slashstartsregex": [
204 include("commentsandwhitespace"),
205 (
206 r"/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/" r"([gim]+\b|\B)",
207 String.Regex,
208 "#pop",
209 ),
210 (r"(?=/)", Text, ("#pop", "badregex")),
211 (r"", Text, "#pop"),
212 ],
213 "badregex": [(r"\n", Text, "#pop")],
214 "typeexp": [
215 (r"[a-zA-Z0-9_?.$]+", Keyword.Type),
216 (r"\s+", Text),
217 (r"[|]", Text),
218 (r"\n", Text, "#pop"),
219 (r";", Text, "#pop"),
220 (r"", Text, "#pop"),
221 ],
222 "root": [
223 (r"^(?=\s|/|<!--)", Text, "slashstartsregex"),
224 include("commentsandwhitespace"),
225 (
226 r"\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|"
227 r"(<<|>>>?|==?|!=?|[-<>+*%&\|\^/])=?",
228 Operator,
229 "slashstartsregex",
230 ),
231 (r"[{(\[;,]", Punctuation, "slashstartsregex"),
232 (r"[})\].]", Punctuation),
233 (
234 r"(for|in|while|do|break|return|continue|switch|case|default|if|else|"
235 r"throw|try|catch|finally|new|delete|typeof|instanceof|void|"
236 r"this)\b",
237 Keyword,
238 "slashstartsregex",
239 ),
240 (
241 r"(var|let|const|with|function)\b",
242 Keyword.Declaration,
243 "slashstartsregex",
244 ),
245 (
246 r"(abstract|boolean|byte|char|class|const|debugger|double|enum|export|"
247 r"extends|final|float|goto|implements|import|int|interface|long|native|"
248 r"package|private|protected|public|short|static|super|synchronized|throws|"
249 r"transient|volatile)\b",
250 Keyword.Reserved,
251 ),
252 (r"(true|false|null|NaN|Infinity|undefined)\b", Keyword.Constant),
253 (
254 r"(Array|Boolean|Date|Error|Function|Math|netscape|"
255 r"Number|Object|Packages|RegExp|String|sun|decodeURI|"
256 r"decodeURIComponent|encodeURI|encodeURIComponent|"
257 r"Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|"
258 r"window)\b",
259 Name.Builtin,
260 ),
261 # Match stuff like: module name {...}
262 (
263 r"\b(module)(\s*)(\s*[a-zA-Z0-9_?.$][\w?.$]*)(\s*)",
264 bygroups(Keyword.Reserved, Text, Name.Other, Text),
265 "slashstartsregex",
266 ),
267 # Match variable type keywords
268 (r"\b(string|bool|number)\b", Keyword.Type),
269 # Match stuff like: constructor
270 (r"\b(constructor|declare|interface|as|AS)\b", Keyword.Reserved),
271 # Match stuff like: super(argument, list)
272 (
273 r"(super)(\s*)\(([a-zA-Z0-9,_?.$\s]+\s*)\)",
274 bygroups(Keyword.Reserved, Text),
275 "slashstartsregex",
276 ),
277 # Match stuff like: function() {...}
278 (r"([a-zA-Z_?.$][\w?.$]*)\(\) \{", Name.Other, "slashstartsregex"),
279 # Match stuff like: (function: return type)
280 (
281 r"([a-zA-Z0-9_?.$][\w?.$]*)(\s*:\s*)",
282 bygroups(Name.Other, Text),
283 "typeexp",
284 ),
285 # Match stuff like: type Foo = Bar | Baz
286 (
287 r"\b(type)(\s*)([a-zA-Z0-9_?.$]+)(\s*)(=)(\s*)",
288 bygroups(Keyword.Reserved, Text, Name.Other, Text, Operator, Text),
289 "typeexp",
290 ),
291 (r"[$a-zA-Z_][a-zA-Z0-9_]*", Name.Other),
292 (r"[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?", Number.Float),
293 (r"0x[0-9a-fA-F]+", Number.Hex),
294 (r"[0-9]+", Number.Integer),
295 (r'"(\\\\|\\"|[^"])*"', String.Double),
296 (r"'(\\\\|\\'|[^'])*'", String.Single),
297 ],
298 }
299
300
301# Map from token id to props.
302# Properties can't be added to tokens
303# since they derive from Python's tuple.
304token_props = {}
305
306
307class LinkFilter(Filter):
308 def __init__(self, app, **options):
309 self.app = app
310 Filter.__init__(self, **options)
311
312 def _filter_one_literal(self, ttype, value):
313 last = 0
314 for m in re.finditer(literal_reg, value):
315 pre = value[last : m.start()]
316 if pre:
317 yield ttype, pre
318 t = copy_token(ttype)
319 tok_setprop(t, "is_literal", True)
320 yield t, m.group(1)
321 last = m.end()
322 post = value[last:]
323 if post:
324 yield ttype, post
325
326 def filter(self, lexer, stream):
327 for ttype, value in stream:
328 if ttype in Token.Keyword.Type:
329 t = copy_token(ttype)
330 tok_setprop(t, "xref", value.strip())
331 tok_setprop(t, "is_identifier", True)
332 yield t, value
333 elif ttype in Token.Comment:
334 last = 0
335 for m in re.finditer(link_reg, value):
336 pre = value[last : m.start()]
337 if pre:
338 yield from self._filter_one_literal(ttype, pre)
339 t = copy_token(ttype)
340 x1, x2 = m.groups()
341 x0 = m.group(0)
342 if x2 is None:
343 caption = x1.strip()
344 xref = x1.strip()
345 else:
346 caption = x1.strip()
347 xref = x2.strip()
348 tok_setprop(t, "xref", xref)
349 tok_setprop(t, "caption", caption)
350 if x0.endswith("_"):
351 tok_setprop(t, "trailing_underscore", True)
352 yield t, m.group(1)
353 last = m.end()
354 post = value[last:]
355 if post:
356 yield from self._filter_one_literal(ttype, post)
357 else:
358 yield ttype, value
359
360
361_escape_html_table = {
362 ord("&"): u"&amp;",
363 ord("<"): u"&lt;",
364 ord(">"): u"&gt;",
365 ord('"'): u"&quot;",
366 ord("'"): u"&#39;",
367}
368
369
370class LinkingHtmlFormatter(HtmlFormatter):
371 def __init__(self, **kwargs):
372 super(LinkingHtmlFormatter, self).__init__(**kwargs)
373 self._builder = kwargs["_builder"]
374 self._bridge = kwargs["_bridge"]
375
376 def _get_value(self, value, tok):
377 xref = tok_getprop(tok, "xref")
378 caption = tok_getprop(tok, "caption")
379
380 if tok_getprop(tok, "is_literal"):
381 return '<span style="font-weight: bolder">%s</span>' % (value,)
382
383 if tok_getprop(tok, "trailing_underscore"):
384 logger.warn(
385 "{}:{}: code block contains xref to '{}' with unsupported trailing underscore".format(
386 self._bridge.path, self._bridge.line, xref
387 )
388 )
389
390 if tok_getprop(tok, "is_identifier"):
391 if xref.startswith('"'):
392 return value
393 if re.match("^[0-9]+$", xref) is not None:
394 return value
395 if xref in (
396 "number",
397 "object",
398 "string",
399 "boolean",
400 "any",
401 "true",
402 "false",
403 "null",
404 "undefined",
405 "Array",
406 "unknown",
407 ):
408 return value
409
410 if self._bridge.docname is None:
411 return value
412 if xref is None:
413 return value
414 content = caption if caption is not None else value
415 ts = self._builder.env.get_domain("ts")
416 r1 = ts.objects.get(("type", xref), None)
417 if r1 is not None:
418 rel_uri = (
419 self._builder.get_relative_uri(self._bridge.docname, r1[0])
420 + "#"
421 + r1[1]
422 )
423 return (
424 '<a style="color:inherit;text-decoration:underline" href="%s">%s</a>'
425 % (rel_uri, content)
426 )
427
428 std = self._builder.env.get_domain("std")
429 r2 = std.labels.get(xref.lower(), None)
430 if r2 is not None:
431 rel_uri = (
432 self._builder.get_relative_uri(self._bridge.docname, r2[0])
433 + "#"
434 + r2[1]
435 )
436 return (
437 '<a style="color:inherit;text-decoration:underline" href="%s">%s</a>'
438 % (rel_uri, content)
439 )
440 r3 = std.anonlabels.get(xref.lower(), None)
441 if r3 is not None:
442 rel_uri = (
443 self._builder.get_relative_uri(self._bridge.docname, r3[0])
444 + "#"
445 + r3[1]
446 )
447 return (
448 '<a style="color:inherit;text-decoration:underline" href="%s">%s</a>'
449 % (rel_uri, content)
450 )
451
452 logger.warn(
453 "{}:{}: code block contains unresolved xref '{}'".format(
454 self._bridge.path, self._bridge.line, xref
455 )
456 )
457
458 return value
459
460 def _fmt(self, value, tok):
461 cls = self._get_css_class(tok)
462 value = self._get_value(value, tok)
463 if cls is None or cls == "":
464 return value
465 return '<span class="%s">%s</span>' % (cls, value)
466
467 def _format_lines(self, tokensource):
468 """
469 Just format the tokens, without any wrapping tags.
470 Yield individual lines.
471 """
472 lsep = self.lineseparator
473 escape_table = _escape_html_table
474
475 line = ""
476 for ttype, value in tokensource:
477 link = get_annotation(ttype, "link")
478
479 parts = value.translate(escape_table).split("\n")
480
481 if len(parts) == 0:
482 # empty token, usually should not happen
483 pass
484 elif len(parts) == 1:
485 # no newline before or after token
486 line += self._fmt(parts[0], ttype)
487 else:
488 line += self._fmt(parts[0], ttype)
489 yield 1, line + lsep
490 for part in parts[1:-1]:
491 yield 1, self._fmt(part, ttype) + lsep
492 line = self._fmt(parts[-1], ttype)
493
494 if line:
495 yield 1, line + lsep
496
497
498class MyPygmentsBridge(PygmentsBridge):
499 def __init__(self, builder, trim_doctest_flags):
500 self.dest = "html"
501 self.trim_doctest_flags = trim_doctest_flags
502 self.formatter_args = {
503 "style": SphinxStyle,
504 "_builder": builder,
505 "_bridge": self,
506 }
507 self.formatter = LinkingHtmlFormatter
508 self.builder = builder
509 self.path = None
510 self.line = None
511 self.docname = None
512
513 def highlight_block(
514 self, source, lang, opts=None, force=False, location=None, **kwargs
515 ):
516 if isinstance(location, tuple):
517 docname, line = location
518 self.line = line
519 self.path = self.builder.env.doc2path(docname)
520 self.docname = docname
521 elif isinstance(location, Element):
522 self.line = location.line
523 self.path = location.source
524 self.docname = self.builder.env.path2doc(self.path)
525 return super().highlight_block(source, lang, opts, force, location, **kwargs)
526
527
528class MyHtmlBuilder(StandaloneHTMLBuilder):
529 name = "html-linked"
530
531 def init_highlighter(self):
532 if self.config.pygments_style is not None:
533 style = self.config.pygments_style
534 elif self.theme:
535 style = self.theme.get_confstr("theme", "pygments_style", "none")
536 else:
537 style = "sphinx"
538 self.highlighter = MyPygmentsBridge(self, self.config.trim_doctest_flags)
539 self.dark_highlighter = None
540
541
542def get_annotation(tok, key):
543 if not hasattr(tok, "kv"):
544 return None
545 return tok.kv.get(key)
546
547
548def copy_token(tok):
549 new_tok = _TokenType(tok)
550 # This part is very fragile against API changes ...
551 new_tok.subtypes = set(tok.subtypes)
552 new_tok.parent = tok.parent
553 return new_tok
554
555
556def tok_setprop(tok, key, value):
557 tokid = id(tok)
558 e = token_props.get(tokid)
559 if e is None:
560 e = token_props[tokid] = (tok, {})
561 _, kv = e
562 kv[key] = value
563
564
565def tok_getprop(tok, key):
566 tokid = id(tok)
567 e = token_props.get(tokid)
568 if e is None:
569 return None
570 _, kv = e
571 return kv.get(key)
572
573
574link_reg = re.compile(r"(?<!`)`([^`<]+)\s*(?:<([^>]+)>)?\s*`_?")
575literal_reg = re.compile(r"``([^`]+)``")
576
577
578def setup(app):
579
580 class TsrefLexer(BetterTypeScriptLexer):
581 def __init__(self, **options):
582 super().__init__(**options)
583 self.add_filter(LinkFilter(app))
584
585 app.add_lexer("tsref", TsrefLexer)
586 app.add_domain(TypeScriptDomain)
587 app.add_builder(MyHtmlBuilder)
diff --git a/_static/css/custom.css b/_static/css/custom.css
new file mode 100644
index 0000000..05db767
--- /dev/null
+++ b/_static/css/custom.css
@@ -0,0 +1,3 @@
1div.wy-side-nav-search {
2 background: transparent !important;
3}
diff --git a/about.rst b/about.rst
new file mode 100644
index 0000000..5f581a8
--- /dev/null
+++ b/about.rst
@@ -0,0 +1,52 @@
1About GANA
2==========
3
4The GNUnet Assigned Numbers Authority (GANA) contains various registries
5we maintain, for GNUnet other projects that need names and numbers for
6use in network protocols. If you need to open a new registry, please
7feel free to contact us at gana@gnunet.org.
8
9The registry sources can be found here: https://git.gnunet.org/gana.git
10
11History
12-------
13
14Barry Leiba `wrote on April 4th 2020 <https://datatracker.ietf.org/doc/conflict-review-dold-payto/ballot/>`_ that “Neither IANA nor participants
15in the IETF will have any necessary expertise to evaluate registration
16requests in the sort of registry described, and no one will be well
17served by the creation of such a registry at IANA. It would be far
18better to have a registration process be described in this document
19involving experts from the industry as reviewers and maintenance of the
20registrations by an industry organization, rather than by IANA.”
21
22So here we are. As IETF/IANA “lack the necessary expertise to operate a
23registry” for names and numbers used in network protocols, the GNUnet
24project is happy to step up.
25
26License
27-------
28
29The GANA database is licensed under the GPL. See ``COPYING`` in the Git
30repository.
31
32Design
33------
34
35Each registry must have a unique name and all associated information
36lives in a directory under that unique name in the Git repository.
37
38Each registry must include at least the following files:
39
40- ``README[.*]``: document describing the purpose of the registry in
41 English
42- ``POLICY[.*]``: registration policy, explaining required fields and
43 the procedure for adding, updating and deleting entries
44- ``registry.rec``: GNU recutils data file with all of the current
45 entries in the registry
46- ``Makefile``: GNU make makefile with a ``make check`` target to run
47 the validation logic. Ideally, the registry.rec should be written
48 such that the ``check`` target is simply invoking
49 ``recfix --check registry.rec``. Additional targets to convert
50 ``data.rec`` to various formats may be defined. In particular, see
51 ``format.sh`` in the root directory of the Git repository (try
52 ``--help``).
diff --git a/conf.py b/conf.py
new file mode 100644
index 0000000..8b8ef69
--- /dev/null
+++ b/conf.py
@@ -0,0 +1,120 @@
1# Configuration file for the Sphinx documentation builder.
2#
3# This file only contains a selection of the most common options. For a full
4# list see the documentation:
5# https://www.sphinx-doc.org/en/master/usage/configuration.html
6
7# -- Path setup --------------------------------------------------------------
8
9# If extensions (or modules to document with autodoc) are in another directory,
10# add these directories to sys.path here. If the directory is relative to the
11# documentation root, use os.path.abspath to make it absolute, like shown here.
12#
13# import os
14# import sys
15# sys.path.insert(0, os.path.abspath('.'))
16
17
18# -- Project information -----------------------------------------------------
19import sys
20import os
21
22project = 'GANA'
23copyright = '2024, GNUnet Project'
24author = 'GNUnet Project'
25
26sys.path.append(os.path.abspath("_exts"))
27
28# -- General configuration ---------------------------------------------------
29
30# Add any Sphinx extension module names here, as strings. They can be
31# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32# ones.
33extensions = [
34 'httpdomain.httpdomain',
35 'typescriptdomain',
36 'sphinx.ext.todo',
37 #'sphinx_book_theme',
38 #'breathe'
39]
40
41#breathe_projects = {
42# "gnunet": "../gnunet/doc/doxygen/xml/",
43#}
44
45#breathe_default_project = "gnunet"
46
47# Add any paths that contain templates here, relative to this directory.
48templates_path = ['_templates']
49
50# List of patterns, relative to source directory, that match files and
51# directories to ignore when looking for source files.
52# This pattern also affects html_static_path and html_extra_path.
53exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
54
55
56# -- Options for HTML output -------------------------------------------------
57
58# The theme to use for HTML and HTML Help pages. See the documentation for
59# a list of builtin themes.
60#
61html_theme = 'sphinx_rtd_theme'
62
63html_sidebars = {
64 #"**": ["navbar-logo.html", "sbt-sidebar-nav.html", "search-field.html"]
65 "**": ["search-field.html", "sbt-sidebar-nav.html"]
66}
67
68html_theme_options = {
69 #'logo_only': True,
70 #'display_version': False,
71 #'prev_next_buttons_location': 'bottom',
72 #'style_external_links': False,
73 #'vcs_pageview_mode': '',
74 #'style_nav_header_background': 'transparent', # Possibly problematic with our CSP
75 # Toc options
76 #'collapse_navigation': True,
77 #'sticky_navigation': True,
78 #'navigation_depth': 4,
79 #'includehidden': True,
80 #'titles_only': False
81 #"navbar_start": ["navbar-logo"],
82 #"header_links_before_dropdown": 8,
83 #"article_header_start": ["breadcrumbs.html"],
84 #"navbar_center": ["navbar-nav"],
85 #"navbar_end": [],
86 #"navbar_persistent": [],
87}
88
89# Add any paths that contain custom static files (such as style sheets) here,
90# relative to this directory. They are copied after the builtin static files,
91# so a file named "default.css" will overwrite the builtin "default.css".
92html_static_path = ['_static']
93
94# These paths are either relative to html_static_path
95# or fully qualified paths (eg. https://...)
96#html_css_files = [
97# 'css/custom.css',
98#]
99
100html_logo = "images/gnunet-blue.png"
101
102# Display to-do items in docs
103todo_include_todos = True
104
105primary_domain = "c"
106
107highlight_language = "c"
108
109rst_prolog = f"""
110.. role:: c(code)
111 :language: c
112
113.. role:: bolditalic
114 :class: bolditalic
115"""
116
117rst_epilog = """
118"""
119
120
diff --git a/dot-alt/Makefile b/dot-alt/Makefile
new file mode 100644
index 0000000..cff05b7
--- /dev/null
+++ b/dot-alt/Makefile
@@ -0,0 +1,22 @@
1FILES=dot_alt.rst
2all: check $(FILES)
3
4check:
5 recfix --check registry.rec
6
7distclean:
8
9 rm -f *.tmp
10clean:
11 rm -f $(FILES) *.tmp
12
13dot_alt.rst.tmp: registry.rec rst.template
14 ../format.sh rst.template < registry.rec > $@
15
16rst.header.tmp:
17 cat README POLICY rst.header.template > $@
18
19dot_alt.rst: rst.header.tmp dot_alt.rst.tmp
20 cat rst.header.tmp dot_alt.rst.tmp > $@
21
22.PHONY: check
diff --git a/dot-alt/POLICY b/dot-alt/POLICY
new file mode 100644
index 0000000..f586333
--- /dev/null
+++ b/dot-alt/POLICY
@@ -0,0 +1,13 @@
1Policy
2^^^^^^
3
4The "Label" must be unique in the entire registry. The value must be a
5case insensitive `LDH label <https://www.rfc-editor.org/rfc/rfc5890#section-2.3.1>`__
6following the restrictions on DNS names.
7
8Adding records can be done on a first-come first-served basis after GANA
9committer review.
10
11The current contact(s) for review are reachable at
12alt-registry@gnunet.org.
13
diff --git a/dot-alt/README b/dot-alt/README
new file mode 100644
index 0000000..828eca6
--- /dev/null
+++ b/dot-alt/README
@@ -0,0 +1,8 @@
1.alt Subdomains
2---------------
3
4This registry is for the `.alt Top-Level-Domains (TLDs) of the Domain Name System (RFC 9476) <https://www.rfc-editor.org/rfc/rfc9476.html>`__.
5
6This registry is used to ensure that names of alternative name systems
7do not conflict with DNS names or with each other.
8
diff --git a/dot-alt/registry.rec b/dot-alt/registry.rec
new file mode 100644
index 0000000..715f491
--- /dev/null
+++ b/dot-alt/registry.rec
@@ -0,0 +1,36 @@
1# -*- mode: rec -*-
2#
3# Registry for ".ALT" Top-Level-Domain
4#
5
6%rec: AltTld
7%key: Label
8%typedef: Label_t regexp /^[abcdefghijklmnopqrstuvwxyz0123456789][abcdefghijklmnopqrstuvwxyz0123456789-]*$/
9%type: Label Label_t
10%unique: Label
11%mandatory: Label
12%mandatory: Description
13%allowed: Contact
14%allowed: References
15%allowed: UnicodeLabel
16%sort: Name Contact References
17
18Label: gns
19UnicodeLabel: gns
20Contact: Martin Schanzenbach <schanzen@gnunet.org>
21References: RFC 9498
22Description: The .alt subdomain for GNS
23
24Label: i2p
25UnicodeLabel: i2p
26Contact: zzz <zzz AT i2pmail DOT org>
27References: https://geti2p.net/en/docs/naming
28Description: I2P is a P2P network implementing its own name resolution mechanism
29
30# Unreserved unicode example
31Label: xn--fsq
32UnicodeLabel: 例
33Contact: Martin Schanzenbach <schanzen@gnunet.org>
34References: None
35Description: Unreserved unicode example
36
diff --git a/dot-alt/rst.header.template b/dot-alt/rst.header.template
new file mode 100644
index 0000000..b37550e
--- /dev/null
+++ b/dot-alt/rst.header.template
@@ -0,0 +1,11 @@
1Entries
2^^^^^^^
3
4.. list-table:: .alt Subdomains
5 :widths: 10 20 10 60
6 :header-rows: 1
7
8 * - Label
9 - Contact
10 - References
11 - Description
diff --git a/dot-alt/rst.template b/dot-alt/rst.template
new file mode 100644
index 0000000..9c0fdbc
--- /dev/null
+++ b/dot-alt/rst.template
@@ -0,0 +1,4 @@
1 * - {{Label}}
2 - {{Contact}}
3 - {{References}}
4 - {{Description}}
diff --git a/format.sh b/format.sh
index 1cdee4f..a8f2265 100755
--- a/format.sh
+++ b/format.sh
@@ -12,7 +12,8 @@
12## 12##
13me=$(basename $0) 13me=$(basename $0)
14 14
15version='1.3' 15version='1.4'
16# 1.4 -- create $TMPDIR if it does not exist
16# 1.3 -- add support for optional arg SELEXP 17# 1.3 -- add support for optional arg SELEXP
17# 1.2 -- add check for required arg TEMPLATE 18# 1.2 -- add check for required arg TEMPLATE
18# 1.1 -- add --help/--version support 19# 1.1 -- add --help/--version support
diff --git a/gns-protocol-numbers/.gitignore b/gns-protocol-numbers/.gitignore
new file mode 100644
index 0000000..0a437d0
--- /dev/null
+++ b/gns-protocol-numbers/.gitignore
@@ -0,0 +1 @@
gnu-name-system-record-types.h
diff --git a/gns-protocol-numbers/Makefile b/gns-protocol-numbers/Makefile
new file mode 100644
index 0000000..a491d11
--- /dev/null
+++ b/gns-protocol-numbers/Makefile
@@ -0,0 +1,28 @@
1FILES=gnu_name_system_protocols.h gnu_name_system_protocols.rst
2all: check $(FILES)
3
4check:
5 recfix --check registry.rec
6
7distclean:
8 rm -f *.tmp
9clean:
10 rm -f $(FILES) *.tmp
11
12gnu_name_system_protocols.h.tmp: registry.rec h.template
13 ../format.sh h.template < registry.rec > $@
14
15gnu_name_system_protocols.h: h.header gnu_name_system_protocols.h.tmp h.footer
16 cat h.header gnu_name_system_protocols.h.tmp h.footer > $@
17
18gnu_name_system_protocols.rst.tmp: registry.rec rst.template
19 ../format.sh rst.template < registry.rec > $@
20
21rst.header.tmp:
22 cat README POLICY rst.header.template > $@
23
24gnu_name_system_protocols.rst: rst.header.tmp gnu_name_system_protocols.rst.tmp rst.footer
25 cat rst.header.tmp gnu_name_system_protocols.rst.tmp rst.footer > $@
26
27
28.PHONY: check clean distclean
diff --git a/gns-protocol-numbers/POLICY b/gns-protocol-numbers/POLICY
new file mode 100644
index 0000000..3972d5d
--- /dev/null
+++ b/gns-protocol-numbers/POLICY
@@ -0,0 +1,20 @@
1Policy
2^^^^^^
3
4Each registry entry should contain three values: the port "Number" of the
5protocol, which must be above 255,
6the "Name" of the protocol, and a "Reference" with links
7to further information about the record type.
8
9The "Name" must be unique in the entire registry. The value must be a
10case insensitive ASCII string and is restricted to alphanumeric
11characters.
12
13Adding protocols is possible after expert review, using a
14first-come-first-served policy for unique "Name" allocation.
15Experts are responsible to ensure that the chosen "Name" is
16appropriate for the record type.
17
18The current contact(s) for expert review are reachable at
19gns-registry@gnunet.org.
20
diff --git a/gns-protocol-numbers/README b/gns-protocol-numbers/README
new file mode 100644
index 0000000..e34ad25
--- /dev/null
+++ b/gns-protocol-numbers/README
@@ -0,0 +1,8 @@
1GNS Protocol Numbers
2--------------------
3
4This registry is for protocol number mappings for GNS names that are BOXed.
5
6Some "_"-labels map to protocol numbers, but others do not.
7For common "_"-labels, we provide a number mapping in this registry.
8
diff --git a/gns-protocol-numbers/h.footer b/gns-protocol-numbers/h.footer
new file mode 100644
index 0000000..15aade3
--- /dev/null
+++ b/gns-protocol-numbers/h.footer
@@ -0,0 +1,42 @@
1 {
2 .name = NULL,
3 .number = 0
4 }
5};
6
7uint16_t
8GNUNET_GNS_protocol_name_to_number (const char *name)
9{
10 int i = 0;
11 while (NULL != GNUNET_GNS_Protocols[i].name)
12 {
13 if (0 == strcmp (name, GNUNET_GNS_Protocols[i].name))
14 return GNUNET_GNS_Protocols[i].number;
15 i++;
16 }
17 return 0;
18}
19
20
21const char*
22GNUNET_GNS_protocol_number_to_name (uint16_t number)
23{
24 int i = 0;
25 while (NULL != GNUNET_GNS_Protocols[i].name)
26 {
27 if (number == GNUNET_GNS_Protocols[i].number)
28 return GNUNET_GNS_Protocols[i].name;
29 i++;
30 }
31 return NULL;
32}
33
34
35#if 0 /* keep Emacsens' auto-indent happy */
36{
37#endif
38#ifdef __cplusplus
39}
40#endif
41
42#endif
diff --git a/gns-protocol-numbers/h.header b/gns-protocol-numbers/h.header
new file mode 100644
index 0000000..54c4b00
--- /dev/null
+++ b/gns-protocol-numbers/h.header
@@ -0,0 +1,46 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012-2023 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20#ifndef GNUNET_GNS_PROTOCOLS_H
21#define GNUNET_GNS_PROTOCOLS_H
22
23/**
24 * WARNING:
25 * This header is generated!
26 * In order to add GNS service ports, you must register
27 * them in GANA, and then use the header generation script
28 * to create an update of this file. You may then replace this
29 * file with the update.
30 */
31
32#ifdef __cplusplus
33extern "C" {
34#if 0 /* keep Emacsens' auto-indent happy */
35}
36#endif
37#endif
38
39struct GNUNET_GNS_Protocol
40{
41 const char *name;
42
43 uint16_t number;
44};
45
46struct GNUNET_GNS_Protocol GNUNET_GNS_Protocols[] = {
diff --git a/gns-protocol-numbers/h.template b/gns-protocol-numbers/h.template
new file mode 100644
index 0000000..08cdb3b
--- /dev/null
+++ b/gns-protocol-numbers/h.template
@@ -0,0 +1,8 @@
1 /**
2 * {{Comment}}
3 */
4 {
5 .name = "{{Name}}",
6 .number = {{Number}}
7 },
8
diff --git a/gns-protocol-numbers/registry.rec b/gns-protocol-numbers/registry.rec
new file mode 100644
index 0000000..96770ff
--- /dev/null
+++ b/gns-protocol-numbers/registry.rec
@@ -0,0 +1,22 @@
1# -*- mode: rec -*-
2#
3# Registry for GNS protocols
4#
5
6%rec: GnsProtocol
7%key: Number
8%type: Number int
9%mandatory: Number
10%typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]*$/
11%type: Name Name_t
12%unique: Name
13%mandatory: Name
14%mandatory: Comment
15%allowed: Contact
16%allowed: References
17%sort: Number Name Contact References
18
19Number: 49152
20Name: trust
21Comment: LIGHTest trust policy scheme
22References: TODO
diff --git a/gns-protocol-numbers/rst.footer b/gns-protocol-numbers/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gns-protocol-numbers/rst.footer
diff --git a/gns-protocol-numbers/rst.header.template b/gns-protocol-numbers/rst.header.template
new file mode 100644
index 0000000..11b34a1
--- /dev/null
+++ b/gns-protocol-numbers/rst.header.template
@@ -0,0 +1,11 @@
1Entries
2^^^^^^^
3
4.. list-table:: GNS Protocol Numbers
5 :widths: auto
6 :header-rows: 1
7
8 * - Name
9 - Number
10 - References
11 - Comment
diff --git a/gns-protocol-numbers/rst.template b/gns-protocol-numbers/rst.template
new file mode 100644
index 0000000..11468c9
--- /dev/null
+++ b/gns-protocol-numbers/rst.template
@@ -0,0 +1,4 @@
1 * - {{Name}}
2 - {{Number}}
3 - {{References}}
4 - {{Comment}}
diff --git a/gns-service-port-numbers/.gitignore b/gns-service-port-numbers/.gitignore
new file mode 100644
index 0000000..0a437d0
--- /dev/null
+++ b/gns-service-port-numbers/.gitignore
@@ -0,0 +1 @@
gnu-name-system-record-types.h
diff --git a/gns-service-port-numbers/Makefile b/gns-service-port-numbers/Makefile
new file mode 100644
index 0000000..be25889
--- /dev/null
+++ b/gns-service-port-numbers/Makefile
@@ -0,0 +1,28 @@
1FILES=gnu_name_system_service_ports.h gnu_name_system_service_ports.rst
2all: check $(FILES)
3
4check:
5 recfix --check registry.rec
6
7distclean:
8 rm -f *.tmp
9clean:
10 rm -f $(FILES) *.tmp
11
12gnu_name_system_service_ports.h.tmp: registry.rec h.template
13 ../format.sh h.template < registry.rec > $@
14
15gnu_name_system_service_ports.h: h.header gnu_name_system_service_ports.h.tmp h.footer
16 cat h.header gnu_name_system_service_ports.h.tmp h.footer > $@
17
18gnu_name_system_service_ports.rst.tmp: registry.rec rst.template
19 ../format.sh rst.template < registry.rec > $@
20
21rst.header.tmp:
22 cat README POLICY rst.header.template > $@
23
24gnu_name_system_service_ports.rst: rst.header.tmp gnu_name_system_service_ports.rst.tmp rst.footer
25 cat rst.header.tmp gnu_name_system_service_ports.rst.tmp rst.footer > $@
26
27
28.PHONY: check clean distclean
diff --git a/gns-service-port-numbers/POLICY b/gns-service-port-numbers/POLICY
new file mode 100644
index 0000000..3dbb6dc
--- /dev/null
+++ b/gns-service-port-numbers/POLICY
@@ -0,0 +1,20 @@
1Policy
2^^^^^^
3
4Each registry entry should contain three values: the port "Number" of the
5service, which must be above 49151 (private/dynamic port range),
6the "Name" of the service, and a "Reference" with links
7to further information about the record type.
8
9The "Name" must be unique in the entire registry. The value must be a
10case insensitive ASCII string and is restricted to alphanumeric
11characters.
12
13Adding records is possible after expert review, using a
14first-come-first-served policy for unique "Name" allocation.
15Experts are responsible to ensure that the chosen "Name" is
16appropriate for the record type.
17
18The current contact(s) for expert review are reachable at
19gns-registry@gnunet.org.
20
diff --git a/gns-service-port-numbers/README b/gns-service-port-numbers/README
new file mode 100644
index 0000000..0babc89
--- /dev/null
+++ b/gns-service-port-numbers/README
@@ -0,0 +1,8 @@
1GNS Service Ports
2-----------------
3
4This registry is for service-to-port mappings for GNS names that are BOXed.
5
6Some "_"-labels map to service ports (RFC 6335), but others do not.
7For common "_"-labels, we provide a number mapping in this registry.
8
diff --git a/gns-service-port-numbers/h.footer b/gns-service-port-numbers/h.footer
new file mode 100644
index 0000000..e2f02f9
--- /dev/null
+++ b/gns-service-port-numbers/h.footer
@@ -0,0 +1,42 @@
1 {
2 .name = NULL,
3 .port = 0
4 }
5};
6
7uint16_t
8GNUNET_GNS_service_port_name_to_number (const char *name)
9{
10 int i = 0;
11 while (NULL != GNUNET_GNS_ServicePorts[i].name)
12 {
13 if (0 == strcmp (name, GNUNET_GNS_ServicePorts[i].name))
14 return GNUNET_GNS_ServicePorts[i].port;
15 i++;
16 }
17 return 0;
18}
19
20
21const char*
22GNUNET_GNS_service_port_number_to_name (uint16_t port)
23{
24 int i = 0;
25 while (NULL != GNUNET_GNS_ServicePorts[i].name)
26 {
27 if (port == GNUNET_GNS_ServicePorts[i].port)
28 return GNUNET_GNS_ServicePorts[i].name;
29 i++;
30 }
31 return NULL;
32}
33
34
35#if 0 /* keep Emacsens' auto-indent happy */
36{
37#endif
38#ifdef __cplusplus
39}
40#endif
41
42#endif
diff --git a/gns-service-port-numbers/h.header b/gns-service-port-numbers/h.header
new file mode 100644
index 0000000..6cedfe8
--- /dev/null
+++ b/gns-service-port-numbers/h.header
@@ -0,0 +1,46 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012-2023 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20#ifndef GNUNET_GNS_SERVICE_PORTS_H
21#define GNUNET_GNS_SERVICE_PORTS_H
22
23/**
24 * WARNING:
25 * This header is generated!
26 * In order to add GNS service ports, you must register
27 * them in GANA, and then use the header generation script
28 * to create an update of this file. You may then replace this
29 * file with the update.
30 */
31
32#ifdef __cplusplus
33extern "C" {
34#if 0 /* keep Emacsens' auto-indent happy */
35}
36#endif
37#endif
38
39struct GNUNET_GNS_ServicePort
40{
41 const char *name;
42
43 uint16_t port;
44};
45
46struct GNUNET_GNS_ServicePort GNUNET_GNS_ServicePorts[] = {
diff --git a/gns-service-port-numbers/h.template b/gns-service-port-numbers/h.template
new file mode 100644
index 0000000..a7c0a60
--- /dev/null
+++ b/gns-service-port-numbers/h.template
@@ -0,0 +1,8 @@
1 /**
2 * {{Comment}}
3 */
4 {
5 .name = "{{Name}}",
6 .port = {{Number}}
7 },
8
diff --git a/gns-service-port-numbers/registry.rec b/gns-service-port-numbers/registry.rec
new file mode 100644
index 0000000..9a5725e
--- /dev/null
+++ b/gns-service-port-numbers/registry.rec
@@ -0,0 +1,27 @@
1# -*- mode: rec -*-
2#
3# Registry for GNS service ports
4#
5
6%rec: GnsServicePort
7%key: Number
8%type: Number int
9%mandatory: Number
10%typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]*$/
11%type: Name Name_t
12%unique: Name
13%mandatory: Name
14%mandatory: Comment
15%allowed: Contact
16%allowed: References
17%sort: Number Name Contact References
18
19Number: 49152
20Name: scheme
21Comment: Used by Trust Scheme Authorities to publish information about Trust Schemes (LIGHTest)
22References: TODO
23
24Number: 49153
25Name: translation
26Comment: Used Trust Translation Authorities to publish information about Trust Translations (LIGHTest)
27References: TODO \ No newline at end of file
diff --git a/gns-service-port-numbers/rst.footer b/gns-service-port-numbers/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gns-service-port-numbers/rst.footer
diff --git a/gns-service-port-numbers/rst.header.template b/gns-service-port-numbers/rst.header.template
new file mode 100644
index 0000000..9da49e7
--- /dev/null
+++ b/gns-service-port-numbers/rst.header.template
@@ -0,0 +1,11 @@
1Entries
2^^^^^^^
3
4.. list-table:: GNS Service Ports
5 :widths: auto
6 :header-rows: 1
7
8 * - Name
9 - Number
10 - References
11 - Comment
diff --git a/gns-service-port-numbers/rst.template b/gns-service-port-numbers/rst.template
new file mode 100644
index 0000000..11468c9
--- /dev/null
+++ b/gns-service-port-numbers/rst.template
@@ -0,0 +1,4 @@
1 * - {{Name}}
2 - {{Number}}
3 - {{References}}
4 - {{Comment}}
diff --git a/gnu-name-system-default-tlds/.gitignore b/gnu-name-system-default-tlds/.gitignore
new file mode 100644
index 0000000..179d990
--- /dev/null
+++ b/gnu-name-system-default-tlds/.gitignore
@@ -0,0 +1 @@
tlds.conf
diff --git a/gnu-name-system-default-tlds/Makefile b/gnu-name-system-default-tlds/Makefile
index 9523cd2..01ad7d3 100644
--- a/gnu-name-system-default-tlds/Makefile
+++ b/gnu-name-system-default-tlds/Makefile
@@ -1,4 +1,4 @@
1FILES=tlds.conf 1FILES=tlds.conf tlds.rst
2all: check $(FILES) 2all: check $(FILES)
3 3
4check: 4check:
@@ -16,4 +16,14 @@ tlds.conf.tmp: registry.rec tlds.template
16tlds.conf: tlds.header tlds.conf.tmp 16tlds.conf: tlds.header tlds.conf.tmp
17 cat tlds.header tlds.conf.tmp > $@ 17 cat tlds.header tlds.conf.tmp > $@
18 18
19tlds.rst.tmp: registry.rec rst.template
20 ../format.sh rst.template < registry.rec > $@
21
22rst.header.tmp:
23 cat README POLICY rst.header.template > $@
24
25tlds.rst: rst.header.tmp tlds.rst.tmp
26 cat rst.header.tmp tlds.rst.tmp > $@
27
28
19.PHONY: check clean distclean 29.PHONY: check clean distclean
diff --git a/gnu-name-system-default-tlds/POLICY b/gnu-name-system-default-tlds/POLICY
index f27599c..a7a863c 100644
--- a/gnu-name-system-default-tlds/POLICY
+++ b/gnu-name-system-default-tlds/POLICY
@@ -1,3 +1,6 @@
1Policy
2^^^^^^
3
1Each registry entry should contain three values: the "Key" of the 4Each registry entry should contain three values: the "Key" of the
2authoritative zone of a TLD, the "Name" of the TLDS, an optional 5authoritative zone of a TLD, the "Name" of the TLDS, an optional
3"Contact", and a "Reference" with links to further information about the 6"Contact", and a "Reference" with links to further information about the
@@ -11,3 +14,4 @@ GNUnet who will define appropriate bribes on a case-by-case basis.
11 14
12The current contact(s) for expert review are reachable at 15The current contact(s) for expert review are reachable at
13gns-registry@gnunet.org. 16gns-registry@gnunet.org.
17
diff --git a/gnu-name-system-default-tlds/README b/gnu-name-system-default-tlds/README
index b2a9d4f..cff7486 100644
--- a/gnu-name-system-default-tlds/README
+++ b/gnu-name-system-default-tlds/README
@@ -1,4 +1,8 @@
1GNS Default Top-Level-Domains
2-----------------------------
3
1This registry is the default Top-Level-Domains (TLDs) for the GNU Name System. 4This registry is the default Top-Level-Domains (TLDs) for the GNU Name System.
2 5
3This registry is used to ensure that GNS resolvers ship with a default 6This registry is used to ensure that GNS resolvers ship with a default
4configuration of TLDs in order to ease transition and enable instant use. 7configuration of TLDs in order to ease transition and enable instant use.
8
diff --git a/gnu-name-system-default-tlds/registry.rec b/gnu-name-system-default-tlds/registry.rec
index f784878..665d159 100644
--- a/gnu-name-system-default-tlds/registry.rec
+++ b/gnu-name-system-default-tlds/registry.rec
@@ -5,7 +5,7 @@
5 5
6%rec: GnsTld 6%rec: GnsTld
7%key: Name 7%key: Name
8%typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]*$/ 8%typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-]*$/
9%type: Name Name_t 9%type: Name Name_t
10%typedef: Key_t regexp /^[ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789][ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*$/ 10%typedef: Key_t regexp /^[ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789][ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*$/
11%type: Key Key_t 11%type: Key Key_t
@@ -17,6 +17,10 @@
17%allowed: References 17%allowed: References
18%sort: Name Contact References 18%sort: Name Contact References
19 19
20Name: pin 20Name: pin.gns.alt
21Key: 000G001MF6DVMZZ4Y8XRZQDXM1PB3D3VGEK29ZHXBA57EPSNW1QBPKT8J0 21Key: 000G0522TTKQESZ9KPRT2K0RA9ZC8YMD52D2XYVYVGPDCNPMWHH9QXXF4W
22Comment: The FCFS authority managed by GNUnet e.V. 22Comment: The FCFS authority managed by GNUnet e.V.
23
24Name: gnunet.gns.alt
25Key: 000G0522TTKQESZ9KPRT2K0RA9ZC8YMD52D2XYVYVGPDCNPMWHH9QXXF4W
26Comment: The authoritative zone of the GNUnet project
diff --git a/gnu-name-system-default-tlds/rst.footer b/gnu-name-system-default-tlds/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnu-name-system-default-tlds/rst.footer
diff --git a/gnu-name-system-default-tlds/rst.header.template b/gnu-name-system-default-tlds/rst.header.template
new file mode 100644
index 0000000..960a85e
--- /dev/null
+++ b/gnu-name-system-default-tlds/rst.header.template
@@ -0,0 +1,10 @@
1Entries
2^^^^^^^
3
4.. list-table:: GNS Default TLDs
5 :widths: auto
6 :header-rows: 1
7
8 * - Name
9 - Zone Key
10 - Comment
diff --git a/gnu-name-system-default-tlds/rst.template b/gnu-name-system-default-tlds/rst.template
new file mode 100644
index 0000000..1adeac0
--- /dev/null
+++ b/gnu-name-system-default-tlds/rst.template
@@ -0,0 +1,3 @@
1 * - {{Name}}
2 - {{Key}}
3 - {{Comment}}
diff --git a/gnu-name-system-record-flags/.gitignore b/gnu-name-system-record-flags/.gitignore
new file mode 100644
index 0000000..0a437d0
--- /dev/null
+++ b/gnu-name-system-record-flags/.gitignore
@@ -0,0 +1 @@
gnu-name-system-record-types.h
diff --git a/gnu-name-system-record-flags/Makefile b/gnu-name-system-record-flags/Makefile
new file mode 100644
index 0000000..9166ba5
--- /dev/null
+++ b/gnu-name-system-record-flags/Makefile
@@ -0,0 +1,28 @@
1FILES=gnu_name_system_record_flags.h gnu_name_system_record_flags.rst
2all: check $(FILES)
3
4check:
5 recfix --check registry.rec
6
7distclean:
8 rm -f *.tmp
9clean:
10 rm -f $(FILES) *.tmp
11
12gnu_name_system_record_flags.h.tmp: registry.rec h.template
13 ../format.sh h.template < registry.rec > $@
14
15gnu_name_system_record_flags.h: h.header gnu_name_system_record_flags.h.tmp h.footer
16 cat h.header gnu_name_system_record_flags.h.tmp h.footer > $@
17
18gnu_name_system_record_flags.rst.tmp: registry.rec rst.template
19 ../format.sh rst.template < registry.rec > $@
20
21rst.header.tmp:
22 cat README POLICY rst.header.template > $@
23
24gnu_name_system_record_flags.rst: rst.header.tmp gnu_name_system_record_flags.rst.tmp rst.footer
25 cat rst.header.tmp gnu_name_system_record_flags.rst.tmp rst.footer > $@
26
27
28.PHONY: check clean distclean
diff --git a/gnu-name-system-record-flags/POLICY b/gnu-name-system-record-flags/POLICY
new file mode 100644
index 0000000..f9607ee
--- /dev/null
+++ b/gnu-name-system-record-flags/POLICY
@@ -0,0 +1,20 @@
1Policy
2^^^^^^
3
4Each registry entry should contain three values: the "Number" of the
5record flags, which must be between 0 and 15,
6the "Name" of the record flag, and a "Reference" with links
7to further information about the record flag.
8
9The "Name" must be unique in the entire registry. The value must be a
10case insensitive ASCII string and is restricted to alphanumeric
11characters.
12
13Adding flags is possible after expert review, using a
14first-come-first-served policy for unique "Name" allocation.
15Experts are responsible to ensure that the chosen "Name" is
16appropriate for the record flag.
17
18The current contact(s) for expert review are reachable at
19gns-registry@gnunet.org.
20
diff --git a/gnu-name-system-record-flags/README b/gnu-name-system-record-flags/README
new file mode 100644
index 0000000..6cb5f1b
--- /dev/null
+++ b/gnu-name-system-record-flags/README
@@ -0,0 +1,13 @@
1GNS Record Flags
2----------------
3
4This registry is for GNU Name System Record Flags.
5
6GNU Name System Record flags uniquely identify the different kinds
7of key-value pairs that can be used as flags of a GNU Name System record.
8
9This registry is used to ensure that the names and numeric values
10used to identify record flags are uniquely defined and to
11allow GNS resolvers implementors to find out details about the
12respective semantics and human-readable syntax.
13
diff --git a/gnu-name-system-record-flags/h.footer b/gnu-name-system-record-flags/h.footer
new file mode 100644
index 0000000..7b5140e
--- /dev/null
+++ b/gnu-name-system-record-flags/h.footer
@@ -0,0 +1,11 @@
1
2};
3
4#if 0 /* keep Emacsens' auto-indent happy */
5{
6#endif
7#ifdef __cplusplus
8}
9#endif
10
11#endif
diff --git a/gnu-name-system-record-flags/h.header b/gnu-name-system-record-flags/h.header
new file mode 100644
index 0000000..c641893
--- /dev/null
+++ b/gnu-name-system-record-flags/h.header
@@ -0,0 +1,49 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012-2022 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20#ifndef GNU_NAME_SYSTEM_RECORD_FLAGS_H
21#define GNU_NAME_SYSTEM_RECORD_FLAGS_H
22
23/**
24 * WARNING:
25 * This header is generated!
26 * In order to add GNS record flags, you must register
27 * them in GANA, and then use the header generation script
28 * to create an update of this file. You may then replace this
29 * file with the update.
30 */
31
32/**
33 * Flags that can be set for a record.
34 * The numbers in the registry correspond to the bit index as specified in
35 * LSD0001 Chapter "Resource Records".
36 * Each enum member represents the 16-bit integer value of the flags field if
37 * only that particular flag was set.
38 * The value can be used to efficiently compare the bitmask setting for the
39 * record flag in C.
40 * WARNING: The values are in host byte order! In order to correctly check
41 * against the flags field a record, the respective fields must
42 * also be converted to HBO (or the enum value to NBO).
43 */
44enum GNUNET_GNSRECORD_Flags
45{
46 /**
47 * Entry for no flags / cleared flags.
48 */
49 GNUNET_GNSRECORD_RF_NONE = 0,
diff --git a/gnu-name-system-record-flags/h.template b/gnu-name-system-record-flags/h.template
new file mode 100644
index 0000000..d90329b
--- /dev/null
+++ b/gnu-name-system-record-flags/h.template
@@ -0,0 +1,6 @@
1
2
3 /**
4 * {{Comment}}
5 */
6 GNUNET_GNSRECORD_RF_{{Name}} = 1 << (15 - {{Number}}),
diff --git a/gnu-name-system-record-flags/registry.rec b/gnu-name-system-record-flags/registry.rec
new file mode 100644
index 0000000..22aa750
--- /dev/null
+++ b/gnu-name-system-record-flags/registry.rec
@@ -0,0 +1,43 @@
1# -*- mode: rec -*-
2#
3# Registry for GNU Name System record flags
4#
5
6%rec: RecordType
7%key: Number
8%typedef: FlagRange_t range 0 15
9%type: Number FlagRange_t
10%mandatory: Number
11%typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]*$/
12%type: Name Name_t
13%unique: Name
14%mandatory: Name
15%mandatory: Comment
16%allowed: Contact
17%allowed: References
18%sort: Number Name Contact References
19
20Number: 15
21Name: CRITICAL
22Comment: This record is critical. If it cannot be processed (for example because the record type is unknown) resolution MUST fail
23References: https://lsd.gnunet.org/lsd0001
24
25Number: 14
26Name: SHADOW
27Comment: This record should not be used unless all (other) records in the set with an absolute expiration time have expired.
28References: https://lsd.gnunet.org/lsd0001
29
30Number: 13
31Name: SUPPLEMENTAL
32Comment: This is a supplemental record.
33References: https://lsd.gnunet.org/lsd0001
34
35Number: 1
36Name: RELATIVE_EXPIRATION
37Comment: This expiration time of the record is a relative time (not an absolute time). Used in GNUnet implementation.
38References: https://git.gnunet.org/gnunet.git
39
40Number: 0
41Name: PRIVATE
42Comment: This is a private record of this peer and it should thus not be published.
43References: https://git.gnunet.org/gnunet.git
diff --git a/gnu-name-system-record-flags/rst.footer b/gnu-name-system-record-flags/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnu-name-system-record-flags/rst.footer
diff --git a/gnu-name-system-record-flags/rst.header.template b/gnu-name-system-record-flags/rst.header.template
new file mode 100644
index 0000000..76d353f
--- /dev/null
+++ b/gnu-name-system-record-flags/rst.header.template
@@ -0,0 +1,11 @@
1Entries
2^^^^^^^
3
4.. list-table:: GNS Record Flags
5 :widths: auto
6 :header-rows: 1
7
8 * - Name
9 - Number
10 - References
11 - Comment
diff --git a/gnu-name-system-record-flags/rst.template b/gnu-name-system-record-flags/rst.template
new file mode 100644
index 0000000..11468c9
--- /dev/null
+++ b/gnu-name-system-record-flags/rst.template
@@ -0,0 +1,4 @@
1 * - {{Name}}
2 - {{Number}}
3 - {{References}}
4 - {{Comment}}
diff --git a/gnu-name-system-record-types/Makefile b/gnu-name-system-record-types/Makefile
index bda8cdf..79c7b2d 100644
--- a/gnu-name-system-record-types/Makefile
+++ b/gnu-name-system-record-types/Makefile
@@ -1,4 +1,4 @@
1FILES=gnu_name_system_record_types.h 1FILES=gnu_name_system_record_types.h gnu_name_system_record_types.rst
2all: check $(FILES) 2all: check $(FILES)
3 3
4check: 4check:
@@ -15,4 +15,14 @@ gnu_name_system_record_types.h.tmp: registry.rec h.template
15gnu_name_system_record_types.h: h.header gnu_name_system_record_types.h.tmp h.footer 15gnu_name_system_record_types.h: h.header gnu_name_system_record_types.h.tmp h.footer
16 cat h.header gnu_name_system_record_types.h.tmp h.footer > $@ 16 cat h.header gnu_name_system_record_types.h.tmp h.footer > $@
17 17
18gnu_name_system_record_types.rst.tmp: registry.rec rst.template
19 ../format.sh rst.template < registry.rec > $@
20
21rst.header.tmp:
22 cat README POLICY rst.header.template > $@
23
24gnu_name_system_record_types.rst: rst.header.tmp gnu_name_system_record_types.rst.tmp rst.footer
25 cat rst.header.tmp gnu_name_system_record_types.rst.tmp rst.footer > $@
26
27
18.PHONY: check clean distclean 28.PHONY: check clean distclean
diff --git a/gnu-name-system-record-types/POLICY b/gnu-name-system-record-types/POLICY
index 89edf47..4e0e2d2 100644
--- a/gnu-name-system-record-types/POLICY
+++ b/gnu-name-system-record-types/POLICY
@@ -1,3 +1,6 @@
1Policy
2^^^^^^
3
1Each registry entry should contain three values: the "Number" of the 4Each registry entry should contain three values: the "Number" of the
2record type, which must be above 65535 (to avoid conflicts with legacy 5record type, which must be above 65535 (to avoid conflicts with legacy
3DNS record types), the "Name" of the record type, and a "Reference" with links 6DNS record types), the "Name" of the record type, and a "Reference" with links
@@ -12,5 +15,8 @@ first-come-first-served policy for unique "Name" allocation.
12Experts are responsible to ensure that the chosen "Name" is 15Experts are responsible to ensure that the chosen "Name" is
13appropriate for the record type. 16appropriate for the record type.
14 17
18Numbers above 0xFFFF0000 non-exclusively indicate record types for private use.
19
15The current contact(s) for expert review are reachable at 20The current contact(s) for expert review are reachable at
16gns-registry@gnunet.org. 21gns-registry@gnunet.org.
22
diff --git a/gnu-name-system-record-types/README b/gnu-name-system-record-types/README
index c67e01d..94db280 100644
--- a/gnu-name-system-record-types/README
+++ b/gnu-name-system-record-types/README
@@ -1,3 +1,6 @@
1GNS Record Types
2----------------
3
1This registry is for GNU Name System Record Types. 4This registry is for GNU Name System Record Types.
2 5
3GNU Name System Record types uniquely identify the different kinds 6GNU Name System Record types uniquely identify the different kinds
@@ -7,3 +10,4 @@ This registry is used to ensure that the names and numeric values
7used to identify record types are uniquely defined and to 10used to identify record types are uniquely defined and to
8allow GNS resolvers implementors to find out details about the 11allow GNS resolvers implementors to find out details about the
9respective semantics and human-readable syntax. 12respective semantics and human-readable syntax.
13
diff --git a/gnu-name-system-record-types/registry.rec b/gnu-name-system-record-types/registry.rec
index 8fc0c77..ee53077 100644
--- a/gnu-name-system-record-types/registry.rec
+++ b/gnu-name-system-record-types/registry.rec
@@ -18,33 +18,33 @@
18 18
19Number: 65536 19Number: 65536
20Name: PKEY 20Name: PKEY
21Comment: GNS zone transfer 21Comment: GNS zone delegation (PKEY)
22References: LSD0001 22References: RFC 9498
23 23
24Number: 65537 24Number: 65537
25Name: NICK 25Name: NICK
26Comment: GNS nick names 26Comment: GNS zone nickname
27References: LSD0001 27References: RFC 9498
28 28
29Number: 65538 29Number: 65538
30Name: LEHO 30Name: LEHO
31Comment: legacy hostnames 31Comment: GNS legacy hostname
32References: LSD0001 32References: RFC 9498
33 33
34Number: 65539 34Number: 65539
35Name: VPN 35Name: VPN
36Comment: VPN resolution 36Comment: VPN resolution
37References: LSD0001 37References:
38 38
39Number: 65540 39Number: 65540
40Name: GNS2DNS 40Name: GNS2DNS
41Comment: Delegation to DNS 41Comment: Delegation to DNS
42References: LSD0001 42References: RFC 9498
43 43
44Number: 65541 44Number: 65541
45Name: BOX 45Name: BOX
46Comment: Boxed records (see TLSA/SRV handling in GNS) 46Comment: Box record
47References: LSD0001 47References: RFC 9498
48 48
49Number: 65542 49Number: 65542
50Name: PLACE 50Name: PLACE
@@ -66,6 +66,12 @@ Name: RECLAIM_TICKET
66Comment: local ticket reference 66Comment: local ticket reference
67Contact: schanzen@gnunet.org 67Contact: schanzen@gnunet.org
68 68
69Number: 65547
70Name: SBOX
71Comment: SBox record
72Contact: sebastian.nadler@tum.de
73References: LSD 0008
74
69Number: 65548 75Number: 65548
70Name: DELEGATE 76Name: DELEGATE
71Comment: For ABD policies 77Comment: For ABD policies
@@ -83,8 +89,8 @@ Contact: schanzen@gnunet.org
83 89
84Number: 65551 90Number: 65551
85Name: REDIRECT 91Name: REDIRECT
86Comment: Resolver redirects 92Comment: Redirection record
87Contact: LSD0001 93Contact: RFC 9498
88 94
89Number: 65552 95Number: 65552
90Name: RECLAIM_OIDC_CLIENT 96Name: RECLAIM_OIDC_CLIENT
@@ -109,7 +115,7 @@ Contact: schanzen@gnunet.org
109 115
110Number: 65556 116Number: 65556
111Name: EDKEY 117Name: EDKEY
112Comment: Record type for EDKEY zone delegations. 118Comment: GNS zone delegation (EDKEY)
113 119
114Number: 65557 120Number: 65557
115Name: ERIS_READ_CAPABILITY 121Name: ERIS_READ_CAPABILITY
@@ -130,3 +136,14 @@ Number: 65560
130Name: MESSENGER_ROOM_DETAILS 136Name: MESSENGER_ROOM_DETAILS
131Comment: Record type to store details about a messenger room 137Comment: Record type to store details about a messenger room
132Contact: thejackimonster@gmail.com 138Contact: thejackimonster@gmail.com
139
140Number: 65561
141Name: DID_DOCUMENT
142Comment: Record type to store DID Documents
143Contact: schanzen@gnunet.orgNumber: 65561
144
145# Private range started from 0xFFFF0000
146Number: 4294901760
147Name: GNS_REGISTRAR_METADATA
148Comment: Private metadata for a delegation registration
149Contact: schanzen@gnunet.org
diff --git a/gnu-name-system-record-types/rst.footer b/gnu-name-system-record-types/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnu-name-system-record-types/rst.footer
diff --git a/gnu-name-system-record-types/rst.header.template b/gnu-name-system-record-types/rst.header.template
new file mode 100644
index 0000000..9ec6044
--- /dev/null
+++ b/gnu-name-system-record-types/rst.header.template
@@ -0,0 +1,11 @@
1Entries
2^^^^^^^
3
4.. list-table:: GNS Record Types
5 :widths: auto
6 :header-rows: 1
7
8 * - Name
9 - Number
10 - References
11 - Comment
diff --git a/gnu-name-system-record-types/rst.template b/gnu-name-system-record-types/rst.template
new file mode 100644
index 0000000..11468c9
--- /dev/null
+++ b/gnu-name-system-record-types/rst.template
@@ -0,0 +1,4 @@
1 * - {{Name}}
2 - {{Number}}
3 - {{References}}
4 - {{Comment}}
diff --git a/gnu-taler-db-events/Makefile b/gnu-taler-db-events/Makefile
index 194ba50..58fc0e8 100644
--- a/gnu-taler-db-events/Makefile
+++ b/gnu-taler-db-events/Makefile
@@ -1,4 +1,4 @@
1FILES=taler_dbevents.h 1FILES=taler_dbevents.h taler_dbevents.rst
2 2
3all: check $(FILES) 3all: check $(FILES)
4 4
@@ -17,4 +17,10 @@ taler_dbevents.h.tmp: registry.rec h.template
17taler_dbevents.h: h.header taler_dbevents.h.tmp h.footer 17taler_dbevents.h: h.header taler_dbevents.h.tmp h.footer
18 cat $^ > $@ 18 cat $^ > $@
19 19
20taler_dbevents.rst.tmp: registry.rec rst.template
21 ../format.sh rst.template < registry.rec > $@
22
23taler_dbevents.rst: rst.header taler_dbevents.rst.tmp rst.footer
24 cat rst.header taler_dbevents.rst.tmp rst.footer > $@
25
20.PHONY: check clean distclean 26.PHONY: check clean distclean
diff --git a/gnu-taler-db-events/registry.rec b/gnu-taler-db-events/registry.rec
index b36fb49..4f668bf 100644
--- a/gnu-taler-db-events/registry.rec
+++ b/gnu-taler-db-events/registry.rec
@@ -48,6 +48,15 @@ Value: 1006
48Name: EXCHANGE_PURSE_DEPOSITED 48Name: EXCHANGE_PURSE_DEPOSITED
49Description: Event triggered when coins are deposited into a purse. 49Description: Event triggered when coins are deposited into a purse.
50 50
51Value: 1007
52Name: EXCHANGE_DEPOSIT_STATUS_CHANGED
53Description: Event triggered when the tracking status for a deposit has changed.
54
55Value: 1008
56Name: EXCHANGE_PURSE_REFUNDED
57Description: Event triggered when any purse was refunded.
58
59
51# 1100-1199: For Taler Merchant 60# 1100-1199: For Taler Merchant
52 61
53Value: 1100 62Value: 1100
@@ -74,9 +83,66 @@ Value: 1105
74Name: MERCHANT_ORDERS_CHANGE 83Name: MERCHANT_ORDERS_CHANGE
75Description: Event triggered when the set of orders or their state changes. 84Description: Event triggered when the set of orders or their state changes.
76 85
86Value: 1106
87Name: MERCHANT_WEBHOOK_PENDING
88Description: Event triggered when a new pending webhook is ready to be run.
89
90Value: 1107
91Name: MERCHANT_REWARD_PICKUP
92Description: Event triggered when a reward is being picked up.
93
94Value: 1108
95Name: MERCHANT_WIRE_TRANSFER_CONFIRMED
96Description: Event triggered when a wire transfer is confirmed. Triggers interaction with the exchange to download details about which payments were aggregated.
97
98Value: 1109
99Name: MERCHANT_ACCOUNTS_CHANGED
100Description: Event triggered when the set of accounts has changed. Triggers restart of taler-merchant-wirewatch.
101
102Value: 1110
103Name: MERCHANT_EXCHANGE_KEYS
104Description: Event triggered when we downloaded "/keys" from an exchange and stored it in the database. Extra argument must be the exchange base URL.
105
106Value: 1111
107Name: MERCHANT_NEW_WIRE_DEADLINE
108Description: Event triggered upon successful (batch) deposit. Notifies taler-merchant-depositcheck about a potentially relevant wire deadline to wake up for. Argument is a 64-bit absolute time in network byte order.
109
110
111# 1200+: For auditor
112Value: 1200
113Name: EXCHANGE_AUDITOR_NEW_DEPOSIT_CONFIRMATION
114Description: Event triggered when there is a new deposit confirmation available.
115
116
77 117
78# 2000-2099: For Anastasis 118# 2000-2099: For Anastasis
79 119
80Value: 2000 120Value: 2000
81Name: ANASTASIS_AUTH_IBAN_TRANSFER 121Name: ANASTASIS_AUTH_IBAN_TRANSFER
82Description: A wire transfer from the target account with the correct wire transfer subject was received. 122Description: A wire transfer from the target account with the correct wire transfer subject was received.
123
124# 3000-3099: For Libeufin
125
126Value: 3000
127Name: LIBEUFIN_TALER_INCOMING
128Description: A wire transfer with a valid reserve public key was received.
129
130# This event signals that a payment was persisted in the database,
131# and it carries the direction in its payload. Note: the direction
132# is expressed the CaMt way: CRDT or DBIT.
133Value: 3001
134Name: LIBEUFIN_REGIO_TX
135Description: A new transactions internal to Sandbox was made.
136
137# In the context of regional currencies, this event triggers the
138# wire transfer from "admin" to the exchange, in order to start a
139# Taler withdrawal.
140Value: 3002
141Name: LIBEUFIN_SANDBOX_FIAT_INCOMING
142Description: A new fiat transaction can trigger actions in Sandbox.
143
144# A fiat payment was ingested for a particular bank account. The
145# payload communicates the direction: CRDT or DBIT.
146Value: 3003
147Name: LIBEUFIN_NEXUS_TX
148Description: A new transaction was successfully ingested by Nexus.
diff --git a/gnu-taler-db-events/rst.footer b/gnu-taler-db-events/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnu-taler-db-events/rst.footer
diff --git a/gnu-taler-db-events/rst.header b/gnu-taler-db-events/rst.header
new file mode 100644
index 0000000..cd944ce
--- /dev/null
+++ b/gnu-taler-db-events/rst.header
@@ -0,0 +1,13 @@
1Taler DB Events
2---------------
3
4Entries
5^^^^^^^
6
7.. list-table:: Taler DB Events
8 :widths: auto
9 :header-rows: 1
10
11 * - Name
12 - Value
13 - Description
diff --git a/gnu-taler-db-events/rst.template b/gnu-taler-db-events/rst.template
new file mode 100644
index 0000000..e47c564
--- /dev/null
+++ b/gnu-taler-db-events/rst.template
@@ -0,0 +1,3 @@
1 * - {{Name}}
2 - {{Value}}
3 - {{Description}}
diff --git a/gnu-taler-error-codes/.gitignore b/gnu-taler-error-codes/.gitignore
index 2eed484..ded8f45 100644
--- a/gnu-taler-error-codes/.gitignore
+++ b/gnu-taler-error-codes/.gitignore
@@ -4,3 +4,4 @@
4*.tmp 4*.tmp
5*.ts 5*.ts
6taler_error_codes.py 6taler_error_codes.py
7*.go
diff --git a/gnu-taler-error-codes/Makefile b/gnu-taler-error-codes/Makefile
index b7885f5..9e59810 100644
--- a/gnu-taler-error-codes/Makefile
+++ b/gnu-taler-error-codes/Makefile
@@ -2,7 +2,9 @@ FILES=taler_error_codes.h \
2 taler_error_codes.c \ 2 taler_error_codes.c \
3 taler_error_codes.ts \ 3 taler_error_codes.ts \
4 taler_error_codes.py \ 4 taler_error_codes.py \
5 taler_error_codes.kt 5 taler_error_codes.kt \
6 taler_error_codes.go \
7 taler_error_codes.rst
6 8
7all: check $(FILES) 9all: check $(FILES)
8 10
@@ -23,7 +25,7 @@ prep:
23# if nothing changed, we use 'diff' to make sure that 'recsel' 25# if nothing changed, we use 'diff' to make sure that 'recsel'
24# actually changed the result. 26# actually changed the result.
25combined.tmp: registry.rec prep 27combined.tmp: registry.rec prep
26 recsel -t TalerErrorCode -j HttpStatus -p Description,Name,Value,HttpStatus,HttpStatus.Value,HttpStatus.Identifier ../http-status-codes/registry.rec registry.rec > combined.xtmp 28 recsel --sort=Value -t TalerErrorCode -j HttpStatus -p Description,Name,Value,HttpStatus,HttpStatus.Value,HttpStatus.Identifier ../http-status-codes/registry.rec registry.rec > combined.xtmp
27 if ! diff $@ combined.xtmp > /dev/null; then mv combined.xtmp $@; else rm combined.xtmp; fi 29 if ! diff $@ combined.xtmp > /dev/null; then mv combined.xtmp $@; else rm combined.xtmp; fi
28 30
29combined-escaped.tmp: combined.tmp 31combined-escaped.tmp: combined.tmp
@@ -36,7 +38,7 @@ taler_error_codes.h.tmp: combined.tmp h.template
36 ../format.sh h.template < combined.tmp > $@ 38 ../format.sh h.template < combined.tmp > $@
37 39
38taler_error_codes.h: h.header taler_error_codes.h.tmp h.footer 40taler_error_codes.h: h.header taler_error_codes.h.tmp h.footer
39 cat $^ > $@ 41 cat $^ | sed -e "s/= 0000/= 0/" -e "s/= 000/= /" -e "s/= 00/= /" > $@
40 42
41taler_error_codes.c.tmp: combined-escaped.tmp c.template 43taler_error_codes.c.tmp: combined-escaped.tmp c.template
42 ../format.sh c.template < combined-escaped.tmp > $@ 44 ../format.sh c.template < combined-escaped.tmp > $@
@@ -51,7 +53,7 @@ taler_error_codes.ts.tmp: combined.tmp ts.template
51 ../format.sh ts.template < combined.tmp > $@ 53 ../format.sh ts.template < combined.tmp > $@
52 54
53taler_error_codes.ts: ts.header taler_error_codes.ts.tmp ts.footer 55taler_error_codes.ts: ts.header taler_error_codes.ts.tmp ts.footer
54 cat $^ > $@ 56 cat $^ | sed -e "s/= 0000/= 0/" -e "s/= 000/= /" -e "s/= 00/= /" > $@
55 57
56taler_error_codes.kt.tmp: combined.tmp kt.template 58taler_error_codes.kt.tmp: combined.tmp kt.template
57 ../format.sh kt.template < combined.tmp > $@ 59 ../format.sh kt.template < combined.tmp > $@
@@ -62,8 +64,19 @@ taler_error_codes.kt: kt.header taler_error_codes.kt.tmp kt.footer
62taler_error_codes.py.tmp: combined.tmp py.template 64taler_error_codes.py.tmp: combined.tmp py.template
63 ../format.sh py.template < combined.tmp > $@ 65 ../format.sh py.template < combined.tmp > $@
64 66
65taler_error_codes.py: py.header taler_error_codes.py.tmp 67taler_error_codes.py: py.header taler_error_codes.py.tmp
66 cat $^ > $@ 68 cat $^ > $@
67 69
70taler_error_codes.go.tmp: combined.tmp go.template
71 ../format.sh go.template < combined.tmp > $@
72
73taler_error_codes.go: go.header taler_error_codes.go.tmp go.footer
74 cat $^ > $@
75
76taler_error_codes.rst.tmp: combined.tmp rst.template
77 ../format.sh rst.template < combined.tmp > $@
78
79taler_error_codes.rst: rst.header taler_error_codes.rst.tmp rst.footer
80 cat $^ > $@
68 81
69.PHONY: check clean distclean prep 82.PHONY: check clean distclean prep
diff --git a/gnu-taler-error-codes/go.footer b/gnu-taler-error-codes/go.footer
new file mode 100644
index 0000000..bea8cd1
--- /dev/null
+++ b/gnu-taler-error-codes/go.footer
@@ -0,0 +1 @@
)
diff --git a/gnu-taler-error-codes/go.header b/gnu-taler-error-codes/go.header
new file mode 100644
index 0000000..e6aefe3
--- /dev/null
+++ b/gnu-taler-error-codes/go.header
@@ -0,0 +1,26 @@
1/*
2 This file is part of GNU Taler
3 Copyright (C) 2012-2022 Taler Systems SA
4
5 GNU Taler is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Lesser General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNU Taler is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: LGPL3.0-or-later
19
20 Note: the LGPL does not apply to all components of GNU Taler,
21 but it does apply to this file.
22 */
23
24package gana
25
26const (
diff --git a/gnu-taler-error-codes/go.template b/gnu-taler-error-codes/go.template
new file mode 100644
index 0000000..1566025
--- /dev/null
+++ b/gnu-taler-error-codes/go.template
@@ -0,0 +1,8 @@
1
2
3 /**
4 * {{Description}}
5 * Returned with an HTTP status code of #MHD_HTTP_{{HttpStatus_Identifier}} ({{HttpStatus_Value}}).
6 * (A value of 0 indicates that the error is generated client-side).
7 */
8 {{Name}} = {{Value}}
diff --git a/gnu-taler-error-codes/kt.template b/gnu-taler-error-codes/kt.template
index 9934b7e..9470655 100644
--- a/gnu-taler-error-codes/kt.template
+++ b/gnu-taler-error-codes/kt.template
@@ -5,4 +5,4 @@
5 * Returned with an HTTP status code of #MHD_HTTP_{{HttpStatus_Identifier}} ({{HttpStatus_Value}}). 5 * Returned with an HTTP status code of #MHD_HTTP_{{HttpStatus_Identifier}} ({{HttpStatus_Value}}).
6 * (A value of 0 indicates that the error is generated client-side). 6 * (A value of 0 indicates that the error is generated client-side).
7 */ 7 */
8 TALER_EC_{{Name}}({{Value}}), 8 {{Name}}({{Value}}),
diff --git a/gnu-taler-error-codes/registry.rec b/gnu-taler-error-codes/registry.rec
index b94a3b0..b9be57d 100644
--- a/gnu-taler-error-codes/registry.rec
+++ b/gnu-taler-error-codes/registry.rec
@@ -4,7 +4,9 @@
4# 4#
5%rec: TalerErrorCode 5%rec: TalerErrorCode
6%key: Value 6%key: Value
7%singular: Value
7%typedef: ValueRange_t range 0 9999 8%typedef: ValueRange_t range 0 9999
9%typedef: ValueRange_t regexp /^[0123456789][0123456789][0123456789][0123456789]$/
8%constraint: ( Value < 100 ) || ( Value > 999 ) 10%constraint: ( Value < 100 ) || ( Value > 999 )
9%type: Value ValueRange_t 11%type: Value ValueRange_t
10%mandatory: Value 12%mandatory: Value
@@ -15,6 +17,7 @@
15%type: Name Name_t 17%type: Name Name_t
16%unique: Name 18%unique: Name
17%mandatory: Name 19%mandatory: Name
20%singular: Name
18# A status of 0 means not an HTTP status (i.e. created client-side) 21# A status of 0 means not an HTTP status (i.e. created client-side)
19%type: HttpStatus rec HttpStatusCode 22%type: HttpStatus rec HttpStatusCode
20%mandatory: HttpStatus 23%mandatory: HttpStatus
@@ -22,200 +25,248 @@
22 25
23# 0 - 99: Reserved for GENERIC error codes 26# 0 - 99: Reserved for GENERIC error codes
24 27
25Value: 0 28Value: 0000
26Name: NONE 29Name: NONE
27Description: Special code to indicate success (no error). 30Description: Special code to indicate success (no error).
28HttpStatus: 0 31HttpStatus: 0
29 32
30# We could not get the error code. 33# We could not get the error code.
31 34Value: 0001
32Value: 1
33Name: INVALID 35Name: INVALID
34Description: A non-integer error code was returned in the JSON response. 36Description: An error response did not include an error code in the format expected by the client. Most likely, the server does not speak the GNU Taler protocol. Check the URL and/or the network connection to the server.
35HttpStatus: 0 37HttpStatus: 0
36 38
37Value: 2 39Value: 0002
38Name: GENERIC_CLIENT_INTERNAL_ERROR 40Name: GENERIC_CLIENT_INTERNAL_ERROR
39Description: An internal failure happened on the client side. 41Description: An internal failure happened on the client side. Details should be in the local logs. Check if you are using the latest available version or file a report with the developers.
40HttpStatus: 0 42HttpStatus: 0
41 43
42# Fundamental problems detected client-side (10-19) 44# Fundamental problems detected client-side (10-19)
43 45
44Value: 10 46Value: 0010
45Name: GENERIC_INVALID_RESPONSE 47Name: GENERIC_INVALID_RESPONSE
46Description: The response we got from the server was not even in JSON format. 48Description: The response we got from the server was not in the expected format. Most likely, the server does not speak the GNU Taler protocol. Check the URL and/or the network connection to the server.
47HttpStatus: 0 49HttpStatus: 0
48 50
49Value: 11 51Value: 0011
50Name: GENERIC_TIMEOUT 52Name: GENERIC_TIMEOUT
51Description: An operation timed out. 53Description: The operation timed out. Trying again might help. Check the network connection.
52HttpStatus: 0 54HttpStatus: 0
53 55
54Value: 12 56Value: 0012
55Name: GENERIC_VERSION_MALFORMED 57Name: GENERIC_VERSION_MALFORMED
56Description: The version string given does not follow the expected CURRENT:REVISION:AGE Format. 58Description: The protocol version given by the server does not follow the required format. Most likely, the server does not speak the GNU Taler protocol. Check the URL and/or the network connection to the server.
57HttpStatus: 0 59HttpStatus: 0
58 60
59Value: 13 61Value: 0013
60Name: GENERIC_REPLY_MALFORMED 62Name: GENERIC_REPLY_MALFORMED
61Description: The service responded with a reply that was in JSON but did not satsify the protocol. Note that invalid cryptographic signatures should have signature-specific error codes. 63Description: The service responded with a reply that was in the right data format, but the content did not satisfy the protocol. Please file a bug report.
62HttpStatus: 0 64HttpStatus: 0
63 65
64Value: 14 66Value: 0014
65Name: GENERIC_CONFIGURATION_INVALID 67Name: GENERIC_CONFIGURATION_INVALID
66Description: There is an error in the client-side configuration, for example the base URL specified is malformed. 68Description: There is an error in the client-side configuration, for example an option is set to an invalid value. Check the logs and fix the local configuration.
67HttpStatus: 0 69HttpStatus: 0
68 70
69Value: 15 71Value: 0015
70Name: GENERIC_UNEXPECTED_REQUEST_ERROR 72Name: GENERIC_UNEXPECTED_REQUEST_ERROR
71Description: The client made a request to a service, but received an error response it does not know how to handle. 73Description: The client made a request to a service, but received an error response it does not know how to handle. Please file a bug report.
72HttpStatus: 0 74HttpStatus: 0
73 75
76Value: 0016
77Name: GENERIC_TOKEN_PERMISSION_INSUFFICIENT
78Description: The token used by the client to authorize the request does not grant the required permissions for the request. Check the requirements and obtain a suitable authorization token to proceed.
79HttpStatus: 403
80
74# Fundamental client-side protocol problems (20-29) 81# Fundamental client-side protocol problems (20-29)
75# (fundamental: cannot be helped, client is very broken) 82# (fundamental: cannot be helped, client is very broken)
76 83
77Value: 20 84Value: 0020
78Name: GENERIC_METHOD_INVALID 85Name: GENERIC_METHOD_INVALID
79Description: The HTTP method used is invalid for this endpoint. 86Description: The HTTP method used is invalid for this endpoint. This is likely a bug in the client implementation. Check if you are using the latest available version and/or file a report with the developers.
80HttpStatus: 405 87HttpStatus: 405
81 88
82Value: 21 89Value: 0021
83Name: GENERIC_ENDPOINT_UNKNOWN 90Name: GENERIC_ENDPOINT_UNKNOWN
84Description: There is no endpoint defined for the URL provided by the client. 91Description: There is no endpoint defined for the URL provided by the client. Check if you used the correct URL and/or file a report with the developers of the client software.
85HttpStatus: 404 92HttpStatus: 404
86 93
87Value: 22 94Value: 0022
88Name: GENERIC_JSON_INVALID 95Name: GENERIC_JSON_INVALID
89Description: The JSON in the client's request was malformed (generic parse error). 96Description: The JSON in the client's request was malformed. This is likely a bug in the client implementation. Check if you are using the latest available version and/or file a report with the developers.
90HttpStatus: 400 97HttpStatus: 400
91 98
92Value: 23 99Value: 0023
93Name: GENERIC_HTTP_HEADERS_MALFORMED 100Name: GENERIC_HTTP_HEADERS_MALFORMED
94Description: Some of the HTTP headers provided by the client caused the server to not be able to handle the request. 101Description: Some of the HTTP headers provided by the client were malformed and caused the server to not be able to handle the request. This is likely a bug in the client implementation. Check if you are using the latest available version and/or file a report with the developers.
95HttpStatus: 400 102HttpStatus: 400
96 103
97Value: 24 104Value: 0024
98Name: GENERIC_PAYTO_URI_MALFORMED 105Name: GENERIC_PAYTO_URI_MALFORMED
99Description: The payto:// URI provided by the client is malformed. 106Description: The payto:// URI provided by the client is malformed. Check that you are using the correct syntax as of RFC 8905 and/or that you entered the bank account number correctly.
100HttpStatus: 400 107HttpStatus: 400
101 108
102Value: 25 109Value: 0025
103Name: GENERIC_PARAMETER_MISSING 110Name: GENERIC_PARAMETER_MISSING
104Description: A required parameter in the request was missing. 111Description: A required parameter in the request was missing. This is likely a bug in the client implementation. Check if you are using the latest available version and/or file a report with the developers.
105HttpStatus: 400 112HttpStatus: 400
106 113
107Value: 26 114Value: 0026
108Name: GENERIC_PARAMETER_MALFORMED 115Name: GENERIC_PARAMETER_MALFORMED
109Description: A parameter in the request was malformed. 116Description: A parameter in the request was malformed. This is likely a bug in the client implementation. Check if you are using the latest available version and/or file a report with the developers.
110HttpStatus: 400 117HttpStatus: 400
111 118
119Value: 0027
120Name: GENERIC_RESERVE_PUB_MALFORMED
121Description: The reserve public key was malformed.
122HttpStatus: 400
123FIXME: Fold with 26?
124
125Value: 0028
126Name: GENERIC_COMPRESSION_INVALID
127Description: The body in the request could not be decompressed by the server. This is likely a bug in the client implementation. Check if you are using the latest available version and/or file a report with the developers.
128HttpStatus: 400
112 129
113# Circumstantial client-side protocol problems (30-39) 130# Circumstantial client-side protocol problems (30-39)
114# (Circumstantial == may work with another server, but not this one) 131# (Circumstantial == may work with another server, but not this one)
115 132
116Value: 30 133Value: 0030
117Name: GENERIC_CURRENCY_MISMATCH 134Name: GENERIC_CURRENCY_MISMATCH
118Description: The currencies involved in the operation do not match. 135Description: The currency involved in the operation is not acceptable for this server. Check your configuration and make sure the currency specified for a given service provider is one of the currencies supported by that provider.
119HttpStatus: 400 136HttpStatus: 400
120 137
121Value: 31 138Value: 0031
122Name: GENERIC_URI_TOO_LONG 139Name: GENERIC_URI_TOO_LONG
123Description: The URI is longer than the longest URI the HTTP server is willing to parse. 140Description: The URI is longer than the longest URI the HTTP server is willing to parse. If you believe this was a legitimate request, contact the server administrators and/or the software developers to increase the limit.
124HttpStatus: 414 141HttpStatus: 414
125 142
126Value: 32 143Value: 0032
127Name: GENERIC_UPLOAD_EXCEEDS_LIMIT 144Name: GENERIC_UPLOAD_EXCEEDS_LIMIT
128Description: The body is too large to be permissible for the endpoint. 145Description: The body is too large to be permissible for the endpoint. If you believe this was a legitimate request, contact the server administrators and/or the software developers to increase the limit.
129HttpStatus: 413 146HttpStatus: 413
130 147
131 148
132# 40-49: available for future use 149# 40-49: access control issues
150Value: 0040
151Name: GENERIC_UNAUTHORIZED
152Description: The service refused the request due to lack of proper authorization.
153HttpStatus: 401
154
155Value: 0041
156Name: GENERIC_TOKEN_UNKNOWN
157Description: The service refused the request as the given authorization token is unknown.
158HttpStatus: 401
133 159
160Value: 0042
161Name: GENERIC_TOKEN_EXPIRED
162Description: The service refused the request as the given authorization token expired.
163HttpStatus: 401
134 164
165Value: 0043
166Name: GENERIC_TOKEN_MALFORMED
167Description: The service refused the request as the given authorization token is malformed.
168HttpStatus: 401
169
170Value: 0044
171Name: GENERIC_FORBIDDEN
172Description: The service refused the request due to lack of proper rights on the resource.
173HttpStatus: 403
135 174
136# Server-side database problems (50-59) 175# Server-side database problems (50-59)
137 176
138Value: 50 177Value: 0050
139Name: GENERIC_DB_SETUP_FAILED 178Name: GENERIC_DB_SETUP_FAILED
140Description: The service failed initialize its connection to the database. 179Description: The service failed initialize its connection to the database. The system administrator should check that the service has permissions to access the database and that the database is running.
141HttpStatus: 500 180HttpStatus: 500
142 181
143Value: 51 182Value: 0051
144Name: GENERIC_DB_START_FAILED 183Name: GENERIC_DB_START_FAILED
145Description: The service encountered an error event to just start the database transaction. 184Description: The service encountered an error event to just start the database transaction. The system administrator should check that the database is running.
146HttpStatus: 500 185HttpStatus: 500
147 186
148Value: 52 187Value: 0052
149Name: GENERIC_DB_STORE_FAILED 188Name: GENERIC_DB_STORE_FAILED
150Description: The service failed to store information in its database. 189Description: The service failed to store information in its database. The system administrator should check that the database is running and review the service logs.
151HttpStatus: 500 190HttpStatus: 500
152 191
153Value: 53 192Value: 0053
154Name: GENERIC_DB_FETCH_FAILED 193Name: GENERIC_DB_FETCH_FAILED
155Description: The service failed to fetch information from its database. 194Description: The service failed to fetch information from its database. The system administrator should check that the database is running and review the service logs.
156HttpStatus: 500 195HttpStatus: 500
157 196
158Value: 54 197Value: 0054
159Name: GENERIC_DB_COMMIT_FAILED 198Name: GENERIC_DB_COMMIT_FAILED
160Description: The service encountered an error event to commit the database transaction (hard, unrecoverable error). 199Description: The service encountered an unrecoverable error trying to commit a transaction to the database. The system administrator should check that the database is running and review the service logs.
161HttpStatus: 500 200HttpStatus: 500
162 201
163Value: 55 202Value: 0055
164Name: GENERIC_DB_SOFT_FAILURE 203Name: GENERIC_DB_SOFT_FAILURE
165Description: The service encountered an error event to commit the database transaction, even after repeatedly retrying it there was always a conflicting transaction. (This indicates a repeated serialization error; should only happen if some client maliciously tries to create conflicting concurrent transactions.) 204Description: The service encountered an error event to commit the database transaction, even after repeatedly retrying it there was always a conflicting transaction. This indicates a repeated serialization error; it should only happen if some client maliciously tries to create conflicting concurrent transactions. It could also be a sign of a missing index. Check if you are using the latest available version and/or file a report with the developers.
166HttpStatus: 500 205HttpStatus: 500
167 206
168Value: 56 207Value: 0056
169Name: GENERIC_DB_INVARIANT_FAILURE 208Name: GENERIC_DB_INVARIANT_FAILURE
170Description: The service's database is inconsistent and violates service-internal invariants. 209Description: The service's database is inconsistent and violates service-internal invariants. Check if you are using the latest available version and/or file a report with the developers.
171HttpStatus: 500 210HttpStatus: 500
172 211
173 212
174# Server-side computational problems (60-69) 213# Server-side computational problems (60-69)
175 214
176Value: 60 215Value: 0060
177Name: GENERIC_INTERNAL_INVARIANT_FAILURE 216Name: GENERIC_INTERNAL_INVARIANT_FAILURE
178Description: The HTTP server experienced an internal invariant failure (bug). 217Description: The HTTP server experienced an internal invariant failure (bug). Check if you are using the latest available version and/or file a report with the developers.
179HttpStatus: 500 218HttpStatus: 500
180 219
181Value: 61 220Value: 0061
182Name: GENERIC_FAILED_COMPUTE_JSON_HASH 221Name: GENERIC_FAILED_COMPUTE_JSON_HASH
183Description: The service could not compute a cryptographic hash over some JSON value. 222Description: The service could not compute a cryptographic hash over some JSON value. Check if you are using the latest available version and/or file a report with the developers.
184HttpStatus: 500 223HttpStatus: 500
185 224
186Value: 62 225Value: 0062
187Name: GENERIC_FAILED_COMPUTE_AMOUNT 226Name: GENERIC_FAILED_COMPUTE_AMOUNT
188Description: The service could not compute an amount. 227Description: The service could not compute an amount. Check if you are using the latest available version and/or file a report with the developers.
189HttpStatus: 500 228HttpStatus: 500
190 229
191 230
192# Server-side resource problems (70-79) 231# Server-side resource problems (70-79)
193 232
194Value: 70 233Value: 0070
195Name: GENERIC_PARSER_OUT_OF_MEMORY 234Name: GENERIC_PARSER_OUT_OF_MEMORY
196Description: The HTTP server had insufficient memory to parse the request. 235Description: The HTTP server had insufficient memory to parse the request. Restarting services periodically can help, especially if Postgres is using excessive amounts of memory. Check with the system administrator to investigate.
197HttpStatus: 500 236HttpStatus: 500
198 237
199Value: 71 238Value: 0071
200Name: GENERIC_ALLOCATION_FAILURE 239Name: GENERIC_ALLOCATION_FAILURE
201Description: The HTTP server failed to allocate memory. 240Description: The HTTP server failed to allocate memory. Restarting services periodically can help, especially if Postgres is using excessive amounts of memory. Check with the system administrator to investigate.
202HttpStatus: 500 241HttpStatus: 500
203 242
204Value: 72 243Value: 0072
205Name: GENERIC_JSON_ALLOCATION_FAILURE 244Name: GENERIC_JSON_ALLOCATION_FAILURE
206Description: The HTTP server failed to allocate memory for building JSON reply. 245Description: The HTTP server failed to allocate memory for building JSON reply. Restarting services periodically can help, especially if Postgres is using excessive amounts of memory. Check with the system administrator to investigate.
207HttpStatus: 500 246HttpStatus: 500
208 247
209Value: 73 248Value: 0073
210Name: GENERIC_CURL_ALLOCATION_FAILURE 249Name: GENERIC_CURL_ALLOCATION_FAILURE
211Description: The HTTP server failed to allocate memory for making a CURL request. 250Description: The HTTP server failed to allocate memory for making a CURL request. Restarting services periodically can help, especially if Postgres is using excessive amounts of memory. Check with the system administrator to investigate.
251HttpStatus: 500
252
253Value: 0074
254Name: GENERIC_FAILED_TO_LOAD_TEMPLATE
255Description: The backend could not locate a required template to generate an HTML reply. The system administrator should check if the resource files are installed in the correct location and are readable to the service.
212HttpStatus: 500 256HttpStatus: 500
213 257
214# 80-99: available for future use 258Value: 0075
259Name: GENERIC_FAILED_TO_EXPAND_TEMPLATE
260Description: The backend could not expand the template to generate an HTML reply. The system administrator should investigate the logs and check if the templates are well-formed.
261HttpStatus: 500
262
263
215 264
265# 0080-0099: available for future use
216 266
217 267
218# 100 - 999: VERBOTEN due to confusion with HTTP status codes (at least 100-599). 268
269# 0100 - 0999: VERBOTEN due to confusion with HTTP status codes (at least 100-599).
219 270
220# 1000 - 1999: Reserved for exchange 271# 1000 - 1999: Reserved for exchange
221# 1000 - 1099: Reserved for EXCHANGE_GENERIC 272# 1000 - 1099: Reserved for EXCHANGE_GENERIC
@@ -316,9 +367,9 @@ Description: The number of denominations specified in the request exceeds the li
316HttpStatus: 400 367HttpStatus: 400
317 368
318Value: 1019 369Value: 1019
319Name: EXCHANGE_GENERIC_RESERVE_PUB_MALFORMED 370Name: EXCHANGE_GENERIC_COIN_UNKNOWN
320Description: The reserve public key was malformed. 371Description: The coin is not known to the exchange (yet).
321HttpStatus: 400 372HttpStatus: 404
322 373
323Value: 1020 374Value: 1020
324Name: EXCHANGE_GENERIC_CLOCK_SKEW 375Name: EXCHANGE_GENERIC_CLOCK_SKEW
@@ -355,6 +406,61 @@ Name: EXCHANGE_GENERIC_PURSE_EXPIRED
355Description: The purse has expired. 406Description: The purse has expired.
356HttpStatus: 410 407HttpStatus: 410
357 408
409Value: 1027
410Name: EXCHANGE_GENERIC_RESERVE_UNKNOWN
411Description: The exchange has no information about the "reserve_pub" that was given.
412HttpStatus: 404
413
414Value: 1028
415Name: EXCHANGE_GENERIC_KYC_REQUIRED
416Description: The exchange is not allowed to proceed with the operation until the client has satisfied a KYC check.
417HttpStatus: 451
418
419Value: 1029
420Name: EXCHANGE_PURSE_DEPOSIT_COIN_CONFLICTING_ATTEST_VS_AGE_COMMITMENT
421Description: Inconsistency between provided age commitment and attest: either none or both must be provided
422HttpStatus: 400
423
424Value: 1030
425Name: EXCHANGE_PURSE_DEPOSIT_COIN_AGE_ATTESTATION_FAILURE
426Description: The provided attestation for the minimum age couldn't be verified by the exchange.
427HttpStatus: 400
428
429Value: 1031
430Name: EXCHANGE_GENERIC_PURSE_DELETED
431Description: The purse was deleted.
432HttpStatus: 410
433
434Value: 1032
435Name: EXCHANGE_GENERIC_AML_OFFICER_PUB_MALFORMED
436Description: The public key of the AML officer in the URL was malformed.
437HttpStatus: 400
438
439Value: 1033
440Name: EXCHANGE_GENERIC_AML_OFFICER_GET_SIGNATURE_INVALID
441Description: The signature affirming the GET request of the AML officer is invalid.
442HttpStatus: 403
443
444Value: 1034
445Name: EXCHANGE_GENERIC_AML_OFFICER_ACCESS_DENIED
446Description: The specified AML officer does not have access at this time.
447HttpStatus: 403
448
449Value: 1035
450Name: EXCHANGE_GENERIC_AML_PENDING
451Description: The requested operation is denied pending the resolution of an anti-money laundering investigation by the exchange operator. This is a manual process, please wait and retry later.
452HttpStatus: 451
453
454Value: 1036
455Name: EXCHANGE_GENERIC_AML_FROZEN
456Description: The requested operation is denied as the account was frozen on suspicion of money laundering. Please contact the exchange operator.
457HttpStatus: 451
458
459Value: 1037
460Name: EXCHANGE_GENERIC_KYC_CONVERTER_FAILED
461Description: The exchange failed to start a KYC attribute conversion helper process. It is likely configured incorrectly.
462HttpStatus: 500
463
358 464
359Value: 1100 465Value: 1100
360Name: EXCHANGE_DEPOSITS_GET_NOT_FOUND 466Name: EXCHANGE_DEPOSITS_GET_NOT_FOUND
@@ -391,15 +497,20 @@ Name: EXCHANGE_DEPOSITS_GET_MERCHANT_SIGNATURE_INVALID
391Description: The signature of the merchant is invalid. 497Description: The signature of the merchant is invalid.
392HttpStatus: 403 498HttpStatus: 403
393 499
500Value: 1107
501Name: EXCHANGE_DEPOSITS_POLICY_NOT_ACCEPTED
502Description: The provided policy data was not accepted
503HttpStatus: 400
504
394Value: 1150 505Value: 1150
395Name: EXCHANGE_WITHDRAW_INSUFFICIENT_FUNDS 506Name: EXCHANGE_WITHDRAW_INSUFFICIENT_FUNDS
396Description: The given reserve does not have sufficient funds to admit the requested withdraw operation at this time. The response includes the current "balance" of the reserve as well as the transaction "history" that lead to this balance. 507Description: The given reserve does not have sufficient funds to admit the requested withdraw operation at this time. The response includes the current "balance" of the reserve as well as the transaction "history" that lead to this balance.
397HttpStatus: 409 508HttpStatus: 409
398 509
399Value: 1151 510Value: 1151
400Name: EXCHANGE_WITHDRAW_RESERVE_UNKNOWN 511Name: EXCHANGE_AGE_WITHDRAW_INSUFFICIENT_FUNDS
401Description: The exchange has no information about the "reserve_pub" that was given. 512Description: The given reserve does not have sufficient funds to admit the requested age-withdraw operation at this time. The response includes the current "balance" of the reserve as well as the transaction "history" that lead to this balance.
402HttpStatus: 404 513HttpStatus: 409
403 514
404Value: 1152 515Value: 1152
405Name: EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW 516Name: EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW
@@ -417,10 +528,15 @@ Description: The signature of the reserve is not valid.
417HttpStatus: 403 528HttpStatus: 403
418 529
419Value: 1155 530Value: 1155
420Name: EXCHANGE_WITHDRAW_HISTORY_ERROR_INSUFFICIENT_FUNDS 531Name: EXCHANGE_RESERVE_HISTORY_ERROR_INSUFFICIENT_FUNDS
421Description: When computing the reserve history, we ended up with a negative overall balance, which should be impossible. 532Description: When computing the reserve history, we ended up with a negative overall balance, which should be impossible.
422HttpStatus: 500 533HttpStatus: 500
423 534
535Value: 1156
536Name: EXCHANGE_GET_RESERVE_HISTORY_ERROR_INSUFFICIENT_BALANCE
537Description: The reserve did not have sufficient funds in it to pay for a full reserve history statement.
538HttpStatus: 409
539
424Value: 1158 540Value: 1158
425Name: EXCHANGE_WITHDRAW_DENOMINATION_KEY_LOST 541Name: EXCHANGE_WITHDRAW_DENOMINATION_KEY_LOST
426Description: Withdraw period of the coin to be withdrawn is in the past. 542Description: Withdraw period of the coin to be withdrawn is in the past.
@@ -434,8 +550,33 @@ HttpStatus: 0
434Value: 1160 550Value: 1160
435Name: EXCHANGE_WITHDRAW_NONCE_REUSE 551Name: EXCHANGE_WITHDRAW_NONCE_REUSE
436Description: The client re-used a withdraw nonce, which is not allowed. 552Description: The client re-used a withdraw nonce, which is not allowed.
553HttpStatus: 409
554
555Value: 1161
556Name: EXCHANGE_AGE_WITHDRAW_COMMITMENT_UNKNOWN
557Description: The client provided an unknown commitment for an age-withdraw request.
558HttpStatus: 400
559
560Value: 1162
561Name: EXCHANGE_AGE_WITHDRAW_AMOUNT_OVERFLOW
562Description: The total sum of amounts from the denominations did overflow.
563HttpStatus: 500
564
565Value: 1163
566Name: EXCHANGE_AGE_WITHDRAW_AMOUNT_INCORRECT
567Description: The total sum of value and fees from the denominations differs from the committed amount with fees.
437HttpStatus: 400 568HttpStatus: 400
438 569
570Value: 1164
571Name: EXCHANGE_AGE_WITHDRAW_REVEAL_INVALID_HASH
572Description: The original commitment differs from the calculated hash
573HttpStatus: 400
574
575Value: 1165
576Name: EXCHANGE_AGE_WITHDRAW_MAXIMUM_AGE_TOO_LARGE
577Description: The maximum age in the commitment is too large for the reserve
578HttpStatus: 409
579
439Value: 1175 580Value: 1175
440Name: EXCHANGE_WITHDRAW_BATCH_IDEMPOTENT_PLANCHET 581Name: EXCHANGE_WITHDRAW_BATCH_IDEMPOTENT_PLANCHET
441Description: The batch withdraw included a planchet that was already withdrawn. This is not allowed. 582Description: The batch withdraw included a planchet that was already withdrawn. This is not allowed.
@@ -487,18 +628,19 @@ Description: The deposited amount is smaller than the deposit fee, which would r
487HttpStatus: 400 628HttpStatus: 400
488 629
489 630
490Value: 1250 631Value: 1240
491Name: EXCHANGE_RESERVES_STATUS_UNKNOWN 632Name: EXCHANGE_EXTENSIONS_INVALID_FULFILLMENT
492Description: The reserve balance, status or history was requested for a reserve which is not known to the exchange. 633Description: The proof of policy fulfillment was invalid.
493HttpStatus: 404 634HttpStatus: 400
635
494 636
495Value: 1251 637Value: 1251
496Name: EXCHANGE_RESERVES_STATUS_BAD_SIGNATURE 638Name: EXCHANGE_COIN_HISTORY_BAD_SIGNATURE
497Description: The reserve status was requested with a bad signature. 639Description: The coin history was requested with a bad signature.
498HttpStatus: 403 640HttpStatus: 403
499 641
500Value: 1252 642Value: 1252
501Name: EXCHANGE_RESERVES_HISTORY_BAD_SIGNATURE 643Name: EXCHANGE_RESERVE_HISTORY_BAD_SIGNATURE
502Description: The reserve history was requested with a bad signature. 644Description: The reserve history was requested with a bad signature.
503HttpStatus: 403 645HttpStatus: 403
504 646
@@ -775,11 +917,25 @@ Name: EXCHANGE_RESERVES_PURSE_FEE_TOO_LOW
775Description: The purse fee specified for the request is lower than the purse fee charged by the exchange at this time. 917Description: The purse fee specified for the request is lower than the purse fee charged by the exchange at this time.
776HttpStatus: 400 918HttpStatus: 400
777 919
920Value: 1679
921Name: EXCHANGE_PURSE_DELETE_ALREADY_DECIDED
922Description: The payment request cannot be deleted anymore, as it either already completed or timed out.
923HttpStatus: 409
924
925Value: 1680
926Name: EXCHANGE_PURSE_DELETE_SIGNATURE_INVALID
927Description: The signature affirming the purse deletion is invalid.
928HttpStatus: 403
929
930Value: 1681
931Name: EXCHANGE_RESERVES_AGE_RESTRICTION_REQUIRED
932Description: Withdrawal from the reserve requires age restriction to be set.
933HttpStatus: 403
778 934
779Value: 1700 935Value: 1700
780Name: EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE 936Name: EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE
781Description: The exchange failed to talk to the process responsible for its private denomination keys. 937Description: The exchange failed to talk to the process responsible for its private denomination keys or the helpers had no denominations (properly) configured.
782HttpStatus: 500 938HttpStatus: 502
783 939
784Value: 1701 940Value: 1701
785Name: EXCHANGE_DENOMINATION_HELPER_BUG 941Name: EXCHANGE_DENOMINATION_HELPER_BUG
@@ -800,7 +956,7 @@ HttpStatus: 0
800Value: 1750 956Value: 1750
801Name: EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE 957Name: EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE
802Description: The exchange failed to talk to the process responsible for its private signing keys. 958Description: The exchange failed to talk to the process responsible for its private signing keys.
803HttpStatus: 500 959HttpStatus: 502
804 960
805Value: 1751 961Value: 1751
806Name: EXCHANGE_SIGNKEY_HELPER_BUG 962Name: EXCHANGE_SIGNKEY_HELPER_BUG
@@ -833,7 +989,30 @@ Name: EXCHANGE_RESERVES_RESERVE_MERGE_SIGNATURE_INVALID
833Description: The signature by the reserve affirming the merge is invalid. 989Description: The signature by the reserve affirming the merge is invalid.
834HttpStatus: 403 990HttpStatus: 403
835 991
992Value: 1785
993Name: EXCHANGE_RESERVES_OPEN_BAD_SIGNATURE
994Description: The signature by the reserve affirming the open operation is invalid.
995HttpStatus: 403
836 996
997Value: 1786
998Name: EXCHANGE_RESERVES_CLOSE_BAD_SIGNATURE
999Description: The signature by the reserve affirming the close operation is invalid.
1000HttpStatus: 403
1001
1002Value: 1787
1003Name: EXCHANGE_RESERVES_ATTEST_BAD_SIGNATURE
1004Description: The signature by the reserve affirming the attestion request is invalid.
1005HttpStatus: 403
1006
1007Value: 1788
1008Name: EXCHANGE_RESERVES_CLOSE_NO_TARGET_ACCOUNT
1009Description: The exchange does not know an origin account to which the remaining reserve balance could be wired to, and the wallet failed to provide one.
1010HttpStatus: 409
1011
1012Value: 1789
1013Name: EXCHANGE_RESERVES_OPEN_INSUFFICIENT_FUNDS
1014Description: The reserve balance is insufficient to pay for the open operation.
1015HttpStatus: 409
837 1016
838Value: 1800 1017Value: 1800
839Name: EXCHANGE_MANAGEMENT_AUDITOR_NOT_FOUND 1018Name: EXCHANGE_MANAGEMENT_AUDITOR_NOT_FOUND
@@ -925,6 +1104,44 @@ Name: EXCHANGE_MANAGEMENT_GLOBAL_FEE_SIGNATURE_INVALID
925Description: The signature affirming the fee structure is invalid. 1104Description: The signature affirming the fee structure is invalid.
926HttpStatus: 403 1105HttpStatus: 403
927 1106
1107Value: 1818
1108Name: EXCHANGE_MANAGEMENT_DRAIN_PROFITS_SIGNATURE_INVALID
1109Description: The signature affirming the profit drain is invalid.
1110HttpStatus: 403
1111
1112Value: 1825
1113Name: EXCHANGE_AML_DECISION_ADD_SIGNATURE_INVALID
1114Description: The signature affirming the AML decision is invalid.
1115HttpStatus: 403
1116
1117Value: 1826
1118Name: EXCHANGE_AML_DECISION_INVALID_OFFICER
1119Description: The AML officer specified is not allowed to make AML decisions right now.
1120HttpStatus: 403
1121
1122Value: 1827
1123Name: EXCHANGE_AML_DECISION_MORE_RECENT_PRESENT
1124Description: There is a more recent AML decision on file. The decision was rejected as timestamps of AML decisions must be monotonically increasing.
1125HttpStatus: 409
1126
1127Value: 1828
1128Name: EXCHANGE_AML_DECISION_UNKNOWN_CHECK
1129Description: There AML decision would impose an AML check of a type that is not provided by any KYC provider known to the exchange.
1130HttpStatus: 400
1131
1132Value: 1830
1133Name: EXCHANGE_MANAGEMENT_UPDATE_AML_OFFICER_SIGNATURE_INVALID
1134Description: The signature affirming the change in the AML officer status is invalid.
1135HttpStatus: 403
1136
1137Value: 1831
1138Name: EXCHANGE_MANAGEMENT_AML_OFFICERS_MORE_RECENT_PRESENT
1139Description: A more recent decision about the AML officer status is known to the exchange.
1140HttpStatus: 409
1141
1142
1143
1144
928Value: 1850 1145Value: 1850
929Name: EXCHANGE_PURSE_CREATE_CONFLICTING_META_DATA 1146Name: EXCHANGE_PURSE_CREATE_CONFLICTING_META_DATA
930Description: The purse was previously created with different meta data. 1147Description: The purse was previously created with different meta data.
@@ -953,12 +1170,12 @@ HttpStatus: 400
953Value: 1855 1170Value: 1855
954Name: EXCHANGE_PURSE_CREATE_SIGNATURE_INVALID 1171Name: EXCHANGE_PURSE_CREATE_SIGNATURE_INVALID
955Description: The purse signature over the purse meta data is invalid. 1172Description: The purse signature over the purse meta data is invalid.
956HttpStatus: 400 1173HttpStatus: 403
957 1174
958Value: 1856 1175Value: 1856
959Name: EXCHANGE_PURSE_ECONTRACT_SIGNATURE_INVALID 1176Name: EXCHANGE_PURSE_ECONTRACT_SIGNATURE_INVALID
960Description: The signature over the encrypted contract is invalid. 1177Description: The signature over the encrypted contract is invalid.
961HttpStatus: 400 1178HttpStatus: 403
962 1179
963Value: 1857 1180Value: 1857
964Name: EXCHANGE_PURSE_CREATE_EXCHANGE_SIGNATURE_INVALID 1181Name: EXCHANGE_PURSE_CREATE_EXCHANGE_SIGNATURE_INVALID
@@ -983,12 +1200,12 @@ HttpStatus: 400
983Value: 1876 1200Value: 1876
984Name: EXCHANGE_PURSE_MERGE_INVALID_MERGE_SIGNATURE 1201Name: EXCHANGE_PURSE_MERGE_INVALID_MERGE_SIGNATURE
985Description: The signature using the merge key is invalid. 1202Description: The signature using the merge key is invalid.
986HttpStatus: 400 1203HttpStatus: 403
987 1204
988Value: 1877 1205Value: 1877
989Name: EXCHANGE_PURSE_MERGE_INVALID_RESERVE_SIGNATURE 1206Name: EXCHANGE_PURSE_MERGE_INVALID_RESERVE_SIGNATURE
990Description: The signature using the reserve key is invalid. 1207Description: The signature using the reserve key is invalid.
991HttpStatus: 400 1208HttpStatus: 403
992 1209
993Value: 1878 1210Value: 1878
994Name: EXCHANGE_PURSE_NOT_FULL 1211Name: EXCHANGE_PURSE_NOT_FULL
@@ -1003,7 +1220,17 @@ HttpStatus: 0
1003Value: 1880 1220Value: 1880
1004Name: EXCHANGE_MERGE_PURSE_PARTNER_UNKNOWN 1221Name: EXCHANGE_MERGE_PURSE_PARTNER_UNKNOWN
1005Description: The exchange of the target account is not a partner of this exchange. 1222Description: The exchange of the target account is not a partner of this exchange.
1006HttpStatus: 400 1223HttpStatus: 404
1224
1225Value: 1890
1226Name: EXCHANGE_MANAGEMENT_ADD_PARTNER_SIGNATURE_INVALID
1227Description: The signature affirming the new partner is invalid.
1228HttpStatus: 403
1229
1230Value: 1891
1231Name: EXCHANGE_MANAGEMENT_ADD_PARTNER_DATA_CONFLICT
1232Description: Conflicting data for the partner already exists with the exchange.
1233HttpStatus: 409
1007 1234
1008 1235
1009Value: 1900 1236Value: 1900
@@ -1041,11 +1268,58 @@ Name: EXCHANGE_KYC_PROOF_BACKEND_AUTHORIZATION_FAILED
1041Description: The backend signaled an authorization failure. 1268Description: The backend signaled an authorization failure.
1042HttpStatus: 403 1269HttpStatus: 403
1043 1270
1271Value: 1929
1272Name: EXCHANGE_KYC_PROOF_REQUEST_UNKNOWN
1273Description: The exchange is unaware of having made an the authorization request.
1274HttpStatus: 404
1275
1044Value: 1930 1276Value: 1930
1045Name: EXCHANGE_KYC_CHECK_AUTHORIZATION_FAILED 1277Name: EXCHANGE_KYC_CHECK_AUTHORIZATION_FAILED
1046Description: The payto-URI hash did not match. Hence the request was denied. 1278Description: The payto-URI hash did not match. Hence the request was denied.
1047HttpStatus: 403 1279HttpStatus: 403
1048 1280
1281Value: 1931
1282Name: EXCHANGE_KYC_GENERIC_LOGIC_UNKNOWN
1283Description: The request used a logic specifier that is not known to the exchange.
1284HttpStatus: 404
1285
1286Value: 1932
1287Name: EXCHANGE_KYC_GENERIC_LOGIC_GONE
1288Description: The request requires a logic which is no longer configured at the exchange.
1289HttpStatus: 500
1290
1291Value: 1933
1292Name: EXCHANGE_KYC_GENERIC_LOGIC_BUG
1293Description: The logic plugin had a bug in its interaction with the KYC provider.
1294HttpStatus: 500
1295
1296Value: 1934
1297Name: EXCHANGE_KYC_GENERIC_PROVIDER_ACCESS_REFUSED
1298Description: The exchange could not process the request with its KYC provider because the provider refused access to the service. This indicates some configuration issue at the Taler exchange operator.
1299HttpStatus: 511
1300
1301Value: 1935
1302Name: EXCHANGE_KYC_GENERIC_PROVIDER_TIMEOUT
1303Description: There was a timeout in the interaction between the exchange and the KYC provider. The most likely cause is some networking problem. Trying again later might succeed.
1304HttpStatus: 504
1305
1306Value: 1936
1307Name: EXCHANGE_KYC_GENERIC_PROVIDER_UNEXPECTED_REPLY
1308Description: The KYC provider responded with a status that was completely unexpected by the KYC logic of the exchange.
1309HttpStatus: 502
1310
1311Value: 1937
1312Name: EXCHANGE_KYC_GENERIC_PROVIDER_RATE_LIMIT_EXCEEDED
1313Description: The rate limit of the exchange at the KYC provider has been exceeded. Trying much later might work.
1314HttpStatus: 503
1315
1316Value: 1938
1317Name: EXCHANGE_KYC_WEBHOOK_UNAUTHORIZED
1318Description: The request to the webhook lacked proper authorization or authentication data.
1319HttpStatus: 401
1320
1321
1322
1049Value: 1950 1323Value: 1950
1050Name: EXCHANGE_CONTRACTS_UNKNOWN 1324Name: EXCHANGE_CONTRACTS_UNKNOWN
1051Description: The exchange does not know a contract under the given contract public key. 1325Description: The exchange does not know a contract under the given contract public key.
@@ -1076,6 +1350,18 @@ Name: EXCHANGE_PURSE_DEPOSIT_COIN_SIGNATURE_INVALID
1076Description: A coin signature for a deposit into the purse is invalid. 1350Description: A coin signature for a deposit into the purse is invalid.
1077HttpStatus: 403 1351HttpStatus: 403
1078 1352
1353Value: 1976
1354Name: EXCHANGE_PURSE_DEPOSIT_DECIDED_ALREADY
1355Description: It is too late to deposit coins into the purse.
1356HttpStatus: 410
1357
1358
1359
1360Value: 1980
1361Name: EXCHANGE_TOTP_KEY_INVALID
1362Description: TOTP key is not valid.
1363HttpStatus: 0
1364
1079 1365
1080 1366
1081 1367
@@ -1093,19 +1379,9 @@ Description: The start and end-times in the wire fee structure leave a hole. Thi
1093HttpStatus: 0 1379HttpStatus: 0
1094 1380
1095Value: 2002 1381Value: 2002
1096Name: MERCHANT_GENERIC_RESERVE_PUB_MALFORMED 1382Name: MERCHANT_GENERIC_EXCHANGE_WIRE_REQUEST_FAILED
1097Description: The reserve key of given to a /reserves/ handler was malformed. 1383Description: The merchant was unable to obtain a valid answer to /wire from the exchange.
1098HttpStatus: 400 1384HttpStatus: 502
1099
1100Value: 2003
1101Name: MERCHANT_GENERIC_FAILED_TO_LOAD_TEMPLATE
1102Description: The backend could not locate a required template to generate an HTML reply.
1103HttpStatus: 406
1104
1105Value: 2004
1106Name: MERCHANT_GENERIC_FAILED_TO_EXPAND_TEMPLATE
1107Description: The backend could not expand the template to generate an HTML reply.
1108HttpStatus: 500
1109 1385
1110Value: 2005 1386Value: 2005
1111Name: MERCHANT_GENERIC_ORDER_UNKNOWN 1387Name: MERCHANT_GENERIC_ORDER_UNKNOWN
@@ -1118,8 +1394,8 @@ Description: The order provided to the backend could not be completed, because a
1118HttpStatus: 404 1394HttpStatus: 404
1119 1395
1120Value: 2007 1396Value: 2007
1121Name: MERCHANT_GENERIC_TIP_ID_UNKNOWN 1397Name: MERCHANT_GENERIC_REWARD_ID_UNKNOWN
1122Description: The tip ID is unknown. This could happen if the tip has expired. 1398Description: The reward ID is unknown. This could happen if the reward has expired.
1123HttpStatus: 404 1399HttpStatus: 404
1124 1400
1125Value: 2008 1401Value: 2008
@@ -1172,6 +1448,40 @@ Name: MERCHANT_GENERIC_TRANSFER_UNKNOWN
1172Description: The backend could not find the inbound wire transfer specified in the request. 1448Description: The backend could not find the inbound wire transfer specified in the request.
1173HttpStatus: 404 1449HttpStatus: 404
1174 1450
1451Value: 2018
1452Name: MERCHANT_GENERIC_TEMPLATE_UNKNOWN
1453Description: The backend could not find the template(id) because it is not exist.
1454HttpStatus: 404
1455
1456Value: 2019
1457Name: MERCHANT_GENERIC_WEBHOOK_UNKNOWN
1458Description: The backend could not find the webhook(id) because it is not exist.
1459HttpStatus: 404
1460
1461Value: 2020
1462Name: MERCHANT_GENERIC_PENDING_WEBHOOK_UNKNOWN
1463Description: The backend could not find the webhook(serial) because it is not exist.
1464HttpStatus: 404
1465
1466Value: 2021
1467Name: MERCHANT_GENERIC_OTP_DEVICE_UNKNOWN
1468Description: The backend could not find the OTP device(id) because it is not exist.
1469HttpStatus: 404
1470
1471Value: 2022
1472Name: MERCHANT_GENERIC_ACCOUNT_UNKNOWN
1473Description: The account is not known to the backend.
1474HttpStatus: 404
1475
1476Value: 2023
1477Name: MERCHANT_GENERIC_H_WIRE_MALFORMED
1478Description: The wire hash was malformed.
1479HttpStatus: 400
1480
1481Value: 2024
1482Name: MERCHANT_GENERIC_CURRENCY_MISMATCH
1483Description: The currency specified in the operation does not work with the current state of the given resource.
1484HttpStatus: 409
1175 1485
1176# 2100-2499: public API 1486# 2100-2499: public API
1177# 2100-2149: get orders endpoint 1487# 2100-2149: get orders endpoint
@@ -1181,7 +1491,6 @@ Name: MERCHANT_GET_ORDERS_EXCHANGE_TRACKING_FAILURE
1181Description: The exchange failed to provide a valid answer to the tracking request, thus those details are not in the response. 1491Description: The exchange failed to provide a valid answer to the tracking request, thus those details are not in the response.
1182HttpStatus: 200 1492HttpStatus: 200
1183 1493
1184
1185Value: 2103 1494Value: 2103
1186Name: MERCHANT_GET_ORDERS_ID_EXCHANGE_REQUEST_FAILURE 1495Name: MERCHANT_GET_ORDERS_ID_EXCHANGE_REQUEST_FAILURE
1187Description: The merchant backend failed to construct the request for tracking to the exchange, thus tracking details are not in the response. 1496Description: The merchant backend failed to construct the request for tracking to the exchange, thus tracking details are not in the response.
@@ -1232,12 +1541,12 @@ HttpStatus: 400
1232Value: 2155 1541Value: 2155
1233Name: MERCHANT_POST_ORDERS_ID_PAY_INSUFFICIENT_DUE_TO_FEES 1542Name: MERCHANT_POST_ORDERS_ID_PAY_INSUFFICIENT_DUE_TO_FEES
1234Description: After considering deposit and wire fees, the payment is insufficient to satisfy the required amount for the contract. The client should revisit the logic used to calculate fees it must cover. 1543Description: After considering deposit and wire fees, the payment is insufficient to satisfy the required amount for the contract. The client should revisit the logic used to calculate fees it must cover.
1235HttpStatus: 406 1544HttpStatus: 400
1236 1545
1237Value: 2156 1546Value: 2156
1238Name: MERCHANT_POST_ORDERS_ID_PAY_PAYMENT_INSUFFICIENT 1547Name: MERCHANT_POST_ORDERS_ID_PAY_PAYMENT_INSUFFICIENT
1239Description: Even if we do not consider deposit and wire fees, the payment is insufficient to satisfy the required amount for the contract. 1548Description: Even if we do not consider deposit and wire fees, the payment is insufficient to satisfy the required amount for the contract.
1240HttpStatus: 406 1549HttpStatus: 400
1241 1550
1242Value: 2157 1551Value: 2157
1243Name: MERCHANT_POST_ORDERS_ID_PAY_COIN_SIGNATURE_INVALID 1552Name: MERCHANT_POST_ORDERS_ID_PAY_COIN_SIGNATURE_INVALID
@@ -1254,6 +1563,11 @@ Name: MERCHANT_POST_ORDERS_ID_PAY_REFUND_DEADLINE_PAST_WIRE_TRANSFER_DEADLINE
1254Description: The refund deadline in the contract is after the transfer deadline. 1563Description: The refund deadline in the contract is after the transfer deadline.
1255HttpStatus: 500 1564HttpStatus: 500
1256 1565
1566Value: 2160
1567Name: MERCHANT_POST_ORDERS_ID_PAY_ALREADY_PAID
1568Description: The order was already paid (maybe by another wallet).
1569HttpStatus: 409
1570
1257Value: 2161 1571Value: 2161
1258Name: MERCHANT_POST_ORDERS_ID_PAY_OFFER_EXPIRED 1572Name: MERCHANT_POST_ORDERS_ID_PAY_OFFER_EXPIRED
1259Description: The payment is too late, the offer has expired. 1573Description: The payment is too late, the offer has expired.
@@ -1314,7 +1628,48 @@ Name: MERCHANT_POST_ORDERS_ID_PAY_AGE_VERIFICATION_FAILED
1314Description: The payment required a minimum age but one of the coins provided a minimum_age_sig that couldn't be verified with the given age_commitment for that particular minimum age. 1628Description: The payment required a minimum age but one of the coins provided a minimum_age_sig that couldn't be verified with the given age_commitment for that particular minimum age.
1315HttpStatus: 400 1629HttpStatus: 400
1316 1630
1317# 2200-2249: post orders ID paid endpoint 1631Value: 2174
1632Name: MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_HASH_MISSING
1633Description: The payment required no minimum age but one of the coins (of a denomination with support for age restriction) did not provide the required h_age_commitment.
1634HttpStatus: 400
1635
1636Value: 2175
1637Name: MERCHANT_POST_ORDERS_ID_PAY_WIRE_METHOD_UNSUPPORTED
1638Description: The exchange does not support the selected bank account of the merchant. Likely the merchant had stale data on the bank accounts of the exchange and thus selected an inappropriate exchange when making the offer.
1639HttpStatus: 409
1640
1641Value: 2176
1642Name: MERCHANT_POST_ORDERS_ID_PAY_CHOICE_INDEX_MISSING
1643Description: The payment requires the wallet to select a choice from the choices array and pass it in the 'choice_index' field of the request.
1644HttpStatus: 400
1645
1646Value: 2177
1647Name: MERCHANT_POST_ORDERS_ID_PAY_CHOICE_INDEX_OUT_OF_BOUNDS
1648Description: The 'choice_index' field is invalid.
1649HttpStatus: 400
1650
1651Value: 2178
1652Name: MERCHANT_POST_ORDERS_ID_PAY_INPUT_TOKENS_MISMATCH
1653Description: The provided 'tokens' array does not match with the required input tokens of the order.
1654HttpStatus: 400
1655
1656Value: 2179
1657Name: MERCHANT_POST_ORDERS_ID_PAY_TOKEN_ISSUE_SIG_INVALID
1658Description: Invalid token issue signature (blindly signed by merchant) for provided token.
1659HttpStatus: 400
1660
1661Value: 2180
1662Name: MERCHANT_POST_ORDERS_ID_PAY_TOKEN_USE_SIG_INVALID
1663Description: Invalid token use signature (EdDSA, signed by wallet) for provided token.
1664HttpStatus: 400
1665
1666Value: 2181
1667Name: MERCHANT_POST_ORDERS_ID_PAY_TOKEN_COUNT_MISMATCH
1668Description: The provided number of tokens does not match the required number.
1669HttpStatus: 400
1670
1671
1672# 2200-2224: post orders ID paid endpoint
1318 1673
1319Value: 2200 1674Value: 2200
1320Name: MERCHANT_POST_ORDERS_ID_PAID_CONTRACT_HASH_MISMATCH 1675Name: MERCHANT_POST_ORDERS_ID_PAID_CONTRACT_HASH_MISMATCH
@@ -1326,8 +1681,20 @@ Name: MERCHANT_POST_ORDERS_ID_PAID_COIN_SIGNATURE_INVALID
1326Description: The signature of the merchant is not valid for the given contract hash. 1681Description: The signature of the merchant is not valid for the given contract hash.
1327HttpStatus: 403 1682HttpStatus: 403
1328 1683
1329# 2250-2299: post orders ID abort endpoint 1684# 2225-2249: token families endpoints
1685
1686Value: 2225
1687Name: MERCHANT_POST_TOKEN_FAMILY_CONFLICT
1688Description: A token family with this ID but conflicting data exists.
1689HttpStatus: 409
1690
1691Value: 2226
1692Name: MERCHANT_PATCH_TOKEN_FAMILY_NOT_FOUND
1693Description: The backend is unaware of a token family with the given ID.
1694HttpStatus: 404
1695
1330 1696
1697# 2250-2256: post orders ID abort endpoint
1331 1698
1332Value: 2251 1699Value: 2251
1333Name: MERCHANT_POST_ORDERS_ID_ABORT_EXCHANGE_REFUND_FAILED 1700Name: MERCHANT_POST_ORDERS_ID_ABORT_EXCHANGE_REFUND_FAILED
@@ -1359,6 +1726,44 @@ Name: MERCHANT_POST_ORDERS_ID_ABORT_COINS_ARRAY_EMPTY
1359Description: The array of coins cannot be empty. 1726Description: The array of coins cannot be empty.
1360HttpStatus: 400 1727HttpStatus: 400
1361 1728
1729Value: 2258
1730Name: MERCHANT_EXCHANGE_TRANSFERS_AWAITING_KEYS
1731Description: We are waiting for the exchange to provide us with key material before checking the wire transfer.
1732HttpStatus: 202
1733
1734Value: 2259
1735Name: MERCHANT_EXCHANGE_TRANSFERS_AWAITING_LIST
1736Description: We are waiting for the exchange to provide us with the list of aggregated transactions.
1737HttpStatus: 202
1738
1739
1740Value: 2260
1741Name: MERCHANT_EXCHANGE_TRANSFERS_FATAL_NO_EXCHANGE
1742Description: The endpoint indicated in the wire transfer does not belong to a GNU Taler exchange.
1743HttpStatus: 200
1744
1745Value: 2261
1746Name: MERCHANT_EXCHANGE_TRANSFERS_FATAL_NOT_FOUND
1747Description: The exchange indicated in the wire transfer claims to know nothing about the wire transfer.
1748HttpStatus: 0
1749
1750Value: 2262
1751Name: MERCHANT_EXCHANGE_TRANSFERS_RATE_LIMITED
1752Description: The interaction with the exchange is delayed due to rate limiting.
1753HttpStatus: 202
1754
1755Value: 2263
1756Name: MERCHANT_EXCHANGE_TRANSFERS_TRANSIENT_FAILURE
1757Description: We experienced a transient failure in our interaction with the exchange.
1758HttpStatus: 202
1759
1760Value: 2264
1761Name: MERCHANT_EXCHANGE_TRANSFERS_HARD_FAILURE
1762Description: The response from the exchange was unacceptable and should be reviewed with an auditor.
1763HttpStatus: 200
1764
1765
1766
1362# 2300-2349: post orders ID claim endpoint 1767# 2300-2349: post orders ID claim endpoint
1363 1768
1364Value: 2300 1769Value: 2300
@@ -1383,38 +1788,38 @@ Name: MERCHANT_POST_ORDERS_ID_REFUND_SIGNATURE_FAILED
1383Description: The backend failed to sign the refund request. 1788Description: The backend failed to sign the refund request.
1384HttpStatus: 0 1789HttpStatus: 0
1385 1790
1386# 2400-2449: tip pickup endpoint 1791# 2400-2449: reward pickup endpoint
1387 1792
1388Value: 2400 1793Value: 2400
1389Name: MERCHANT_TIP_PICKUP_UNBLIND_FAILURE 1794Name: MERCHANT_REWARD_PICKUP_UNBLIND_FAILURE
1390Description: The client failed to unblind the signature returned by the merchant. 1795Description: The client failed to unblind the signature returned by the merchant.
1391HttpStatus: 0 1796HttpStatus: 0
1392 1797
1393 1798
1394 1799
1395Value: 2403 1800Value: 2403
1396Name: MERCHANT_TIP_PICKUP_EXCHANGE_ERROR 1801Name: MERCHANT_REWARD_PICKUP_EXCHANGE_ERROR
1397Description: The exchange returned a failure code for the withdraw operation. 1802Description: The exchange returned a failure code for the withdraw operation.
1398HttpStatus: 502 1803HttpStatus: 502
1399 1804
1400 1805
1401Value: 2404 1806Value: 2404
1402Name: MERCHANT_TIP_PICKUP_SUMMATION_FAILED 1807Name: MERCHANT_REWARD_PICKUP_SUMMATION_FAILED
1403Description: The merchant failed to add up the amounts to compute the pick up value. 1808Description: The merchant failed to add up the amounts to compute the pick up value.
1404HttpStatus: 500 1809HttpStatus: 500
1405 1810
1406Value: 2405 1811Value: 2405
1407Name: MERCHANT_TIP_PICKUP_HAS_EXPIRED 1812Name: MERCHANT_REWARD_PICKUP_HAS_EXPIRED
1408Description: The tip expired. 1813Description: The reward expired.
1409HttpStatus: 410 1814HttpStatus: 410
1410 1815
1411Value: 2406 1816Value: 2406
1412Name: MERCHANT_TIP_PICKUP_AMOUNT_EXCEEDS_TIP_REMAINING 1817Name: MERCHANT_REWARD_PICKUP_AMOUNT_EXCEEDS_REWARD_REMAINING
1413Description: The requested withdraw amount exceeds the amount remaining to be picked up. 1818Description: The requested withdraw amount exceeds the amount remaining to be picked up.
1414HttpStatus: 400 1819HttpStatus: 400
1415 1820
1416Value: 2407 1821Value: 2407
1417Name: MERCHANT_TIP_PICKUP_DENOMINATION_UNKNOWN 1822Name: MERCHANT_REWARD_PICKUP_DENOMINATION_UNKNOWN
1418Description: The merchant did not find the specified denomination key in the exchange's key set. 1823Description: The merchant did not find the specified denomination key in the exchange's key set.
1419HttpStatus: 409 1824HttpStatus: 409
1420 1825
@@ -1425,39 +1830,54 @@ HttpStatus: 409
1425 1830
1426Value: 2500 1831Value: 2500
1427Name: MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE 1832Name: MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE
1428Description: The backend lacks a wire transfer method configuration option for the given instance. Thus, this instance is unavailable (not findable for creating new orders). 1833Description: The merchant instance has no active bank accounts configured. However, at least one bank account must be available to create new orders.
1429HttpStatus: 404 1834HttpStatus: 404
1430 1835
1431Value: 2501 1836Value: 2501
1432Name: MERCHANT_PRIVATE_POST_ORDERS_NO_LOCALTIME 1837Name: MERCHANT_PRIVATE_POST_ORDERS_NO_LOCALTIME
1433Description: The proposal had no timestamp and the backend failed to obtain the local time. Likely to be an internal error. 1838Description: The proposal had no timestamp and the merchant backend failed to obtain the current local time.
1434HttpStatus: 500 1839HttpStatus: 500
1435 1840
1436Value: 2502 1841Value: 2502
1437Name: MERCHANT_PRIVATE_POST_ORDERS_PROPOSAL_PARSE_ERROR 1842Name: MERCHANT_PRIVATE_POST_ORDERS_PROPOSAL_PARSE_ERROR
1438Description: The order provided to the backend could not be parsed, some required fields were missing or ill-formed. 1843Description: The order provided to the backend could not be parsed; likely some required fields were missing or ill-formed.
1439HttpStatus: 400 1844HttpStatus: 400
1440 1845
1441Value: 2503 1846Value: 2503
1442Name: MERCHANT_PRIVATE_POST_ORDERS_ALREADY_EXISTS 1847Name: MERCHANT_PRIVATE_POST_ORDERS_ALREADY_EXISTS
1443Description: The backend encountered an error: the proposal already exists. 1848Description: A conflicting order (sharing the same order identifier) already exists at this merchant backend instance.
1444HttpStatus: 409 1849HttpStatus: 409
1445 1850
1446Value: 2504 1851Value: 2504
1447Name: MERCHANT_PRIVATE_POST_ORDERS_REFUND_AFTER_WIRE_DEADLINE 1852Name: MERCHANT_PRIVATE_POST_ORDERS_REFUND_AFTER_WIRE_DEADLINE
1448Description: The request is invalid: the wire deadline is before the refund deadline. 1853Description: The order creation request is invalid because the given wire deadline is before the refund deadline.
1449HttpStatus: 400 1854HttpStatus: 400
1450 1855
1451Value: 2505 1856Value: 2505
1452Name: MERCHANT_PRIVATE_POST_ORDERS_DELIVERY_DATE_IN_PAST 1857Name: MERCHANT_PRIVATE_POST_ORDERS_DELIVERY_DATE_IN_PAST
1453Description: The request is invalid: a delivery date was given, but it is in the past. 1858Description: The order creation request is invalid because the delivery date given is in the past.
1454HttpStatus: 400 1859HttpStatus: 400
1455 1860
1456Value: 2506 1861Value: 2506
1457Name: MERCHANT_PRIVATE_POST_ORDERS_WIRE_DEADLINE_IS_NEVER 1862Name: MERCHANT_PRIVATE_POST_ORDERS_WIRE_DEADLINE_IS_NEVER
1458Description: The request is invalid: the wire deadline for the order would be "never". 1863Description: The order creation request is invalid because a wire deadline of "never" is not allowed.
1864HttpStatus: 400
1865
1866Value: 2507
1867Name: MERCHANT_PRIVATE_POST_ORDERS_PAY_DEADLINE_IN_PAST
1868Description: The order creation request is invalid because the given payment deadline is in the past.
1459HttpStatus: 400 1869HttpStatus: 400
1460 1870
1871Value: 2508
1872Name: MERCHANT_PRIVATE_POST_ORDERS_REFUND_DEADLINE_IN_PAST
1873Description: The order creation request is invalid because the given refund deadline is in the past.
1874HttpStatus: 400
1875
1876Value: 2509
1877Name: MERCHANT_PRIVATE_POST_ORDERS_NO_EXCHANGES_FOR_WIRE_METHOD
1878Description: The backend does not trust any exchange that would allow funds to be wired to any bank account of this instance using the wire method specified with the order. Note that right now, we do not support the use of exchange bank accounts with mandatory currency conversion.
1879HttpStatus: 409
1880
1461Value: 2510 1881Value: 2510
1462Name: MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT 1882Name: MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT
1463Description: One of the paths to forget is malformed. 1883Description: One of the paths to forget is malformed.
@@ -1470,24 +1890,34 @@ HttpStatus: 409
1470 1890
1471Value: 2520 1891Value: 2520
1472Name: MERCHANT_PRIVATE_DELETE_ORDERS_AWAITING_PAYMENT 1892Name: MERCHANT_PRIVATE_DELETE_ORDERS_AWAITING_PAYMENT
1473Description: The order provided to the backend could not be deleted, our offer is still valid and awaiting payment. 1893Description: The order provided to the backend could not be deleted, our offer is still valid and awaiting payment. Deletion may work later after the offer has expired if it remains unpaid.
1894HttpStatus: 409
1895
1896Value: 2521
1897Name: MERCHANT_PRIVATE_DELETE_ORDERS_ALREADY_PAID
1898Description: The order provided to the backend could not be deleted as the order was already paid.
1474HttpStatus: 409 1899HttpStatus: 409
1475 1900
1476Value: 2530 1901Value: 2530
1477Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_INCONSISTENT_AMOUNT 1902Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_INCONSISTENT_AMOUNT
1478Description: The amount to be refunded is inconsistent: either is lower than the previous amount being awarded, or it is too big to be paid back. In this second case, the fault stays on the business dept. side. 1903Description: The amount to be refunded is inconsistent: either is lower than the previous amount being awarded, or it exceeds the original price paid by the customer.
1479HttpStatus: 409 1904HttpStatus: 409
1480 1905
1481Value: 2531 1906Value: 2531
1482Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_ORDER_UNPAID 1907Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_ORDER_UNPAID
1483Description: The frontend gave an unpaid order id to issue the refund to. 1908Description: Only paid orders can be refunded, and the frontend specified an unpaid order to issue a refund for.
1484HttpStatus: 409 1909HttpStatus: 409
1485 1910
1486Value: 2532 1911Value: 2532
1487Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_NOT_ALLOWED_BY_CONTRACT 1912Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_NOT_ALLOWED_BY_CONTRACT
1488Description: The refund delay was set to 0 and thus no refunds are allowed for this order. 1913Description: The refund delay was set to 0 and thus no refunds are ever allowed for this order.
1489HttpStatus: 403 1914HttpStatus: 403
1490 1915
1916Value: 2533
1917Name: MERCHANT_PRIVATE_POST_ORDERS_TOKEN_FAMILY_SLUG_UNKNOWN
1918Description: The token family slug provided in this order could not be found in the merchant database.
1919HttpStatus: 404
1920
1491 1921
1492 1922
1493# 2550-2599: transfer operations 1923# 2550-2599: transfer operations
@@ -1532,6 +1962,11 @@ Name: MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_SUBMISSION
1532Description: The backend was previously informed about a wire transfer with the same ID but a different amount. Multiple wire transfers with the same ID are not allowed. If the new amount is correct, the old transfer should first be deleted. 1962Description: The backend was previously informed about a wire transfer with the same ID but a different amount. Multiple wire transfers with the same ID are not allowed. If the new amount is correct, the old transfer should first be deleted.
1533HttpStatus: 409 1963HttpStatus: 409
1534 1964
1965Value: 2563
1966Name: MERCHANT_EXCHANGE_TRANSFERS_CONFLICTING_TRANSFERS
1967Description: The amount transferred differs between what was submitted and what the exchange claimed.
1968HttpStatus: 0
1969
1535 1970
1536# 2600-2649: instance operations 1971# 2600-2649: instance operations
1537 1972
@@ -1560,6 +1995,16 @@ Name: MERCHANT_PRIVATE_PATCH_INSTANCES_PURGE_REQUIRED
1560Description: The merchant backend cannot update an instance under the given identifier, the previous one was deleted but must be purged first. 1995Description: The merchant backend cannot update an instance under the given identifier, the previous one was deleted but must be purged first.
1561HttpStatus: 409 1996HttpStatus: 409
1562 1997
1998Value: 2626
1999Name: MERCHANT_PRIVATE_ACCOUNT_DELETE_UNKNOWN_ACCOUNT
2000Description: The bank account referenced in the requested operation was not found.
2001HttpStatus: 404
2002
2003Value: 2627
2004Name: MERCHANT_PRIVATE_ACCOUNT_EXISTS
2005Description: The bank account specified in the request already exists at the merchant.
2006HttpStatus: 409
2007
1563 2008
1564# 2650-2699: product operations 2009# 2650-2699: product operations
1565 2010
@@ -1605,31 +2050,36 @@ Name: MERCHANT_PRIVATE_POST_RESERVES_UNSUPPORTED_WIRE_METHOD
1605Description: The requested wire method is not supported by the exchange. 2050Description: The requested wire method is not supported by the exchange.
1606HttpStatus: 409 2051HttpStatus: 409
1607 2052
2053Value: 2701
2054Name: MERCHANT_PRIVATE_POST_RESERVES_REWARDS_NOT_ALLOWED
2055Description: The requested exchange does not allow rewards.
2056HttpStatus: 409
2057
1608Value: 2710 2058Value: 2710
1609Name: MERCHANT_PRIVATE_DELETE_RESERVES_NO_SUCH_RESERVE 2059Name: MERCHANT_PRIVATE_DELETE_RESERVES_NO_SUCH_RESERVE
1610Description: The reserve could not be deleted because it is unknown. 2060Description: The reserve could not be deleted because it is unknown.
1611HttpStatus: 404 2061HttpStatus: 404
1612 2062
1613# 2750-2799: tip authorization 2063# 2750-2799: reward authorization
1614 2064
1615Value: 2750 2065Value: 2750
1616Name: MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_RESERVE_EXPIRED 2066Name: MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_EXPIRED
1617Description: The reserve that was used to fund the tips has expired. 2067Description: The reserve that was used to fund the rewards has expired.
1618HttpStatus: 410 2068HttpStatus: 410
1619 2069
1620Value: 2751 2070Value: 2751
1621Name: MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_RESERVE_UNKNOWN 2071Name: MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_UNKNOWN
1622Description: The reserve that was used to fund the tips was not found in the DB. 2072Description: The reserve that was used to fund the rewards was not found in the DB.
1623HttpStatus: 503 2073HttpStatus: 503
1624 2074
1625Value: 2752 2075Value: 2752
1626Name: MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_INSUFFICIENT_FUNDS 2076Name: MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_INSUFFICIENT_FUNDS
1627Description: The backend knows the instance that was supposed to support the tip, and it was configured for tipping. However, the funds remaining are insufficient to cover the tip, and the merchant should top up the reserve. 2077Description: The backend knows the instance that was supposed to support the reward, and it was configured for rewardping. However, the funds remaining are insufficient to cover the reward, and the merchant should top up the reserve.
1628HttpStatus: 0 2078HttpStatus: 0
1629 2079
1630Value: 2753 2080Value: 2753
1631Name: MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_RESERVE_NOT_FOUND 2081Name: MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_NOT_FOUND
1632Description: The backend failed to find a reserve needed to authorize the tip. 2082Description: The backend failed to find a reserve needed to authorize the reward.
1633HttpStatus: 503 2083HttpStatus: 503
1634 2084
1635Value: 2800 2085Value: 2800
@@ -1637,6 +2087,53 @@ Name: MERCHANT_PRIVATE_GET_ORDERS_ID_AMOUNT_ARITHMETIC_FAILURE
1637Description: The merchant backend encountered a failure in computing the deposit total. 2087Description: The merchant backend encountered a failure in computing the deposit total.
1638HttpStatus: 200 2088HttpStatus: 200
1639 2089
2090# 2850-2899: template and OTP device operations
2091
2092Value: 2850
2093Name: MERCHANT_PRIVATE_POST_TEMPLATES_CONFLICT_TEMPLATE_EXISTS
2094Description: The template ID already exists.
2095HttpStatus: 409
2096
2097Value: 2851
2098Name: MERCHANT_PRIVATE_POST_OTP_DEVICES_CONFLICT_OTP_DEVICE_EXISTS
2099Description: The OTP device ID already exists.
2100HttpStatus: 409
2101
2102Value: 2860
2103Name: MERCHANT_POST_USING_TEMPLATES_AMOUNT_CONFLICT_TEMPLATES_CONTRACT_AMOUNT
2104Description: Amount given in the using template and in the template contract. There is a conflict.
2105HttpStatus: 409
2106
2107Value: 2861
2108Name: MERCHANT_POST_USING_TEMPLATES_SUMMARY_CONFLICT_TEMPLATES_CONTRACT_SUBJECT
2109Description: Subject given in the using template and in the template contract. There is a conflict.
2110HttpStatus: 409
2111
2112Value: 2862
2113Name: MERCHANT_POST_USING_TEMPLATES_NO_AMOUNT
2114Description: Amount not given in the using template and in the template contract. There is a conflict.
2115HttpStatus: 409
2116
2117Value: 2863
2118Name: MERCHANT_POST_USING_TEMPLATES_NO_SUMMARY
2119Description: Subject not given in the using template and in the template contract. There is a conflict.
2120HttpStatus: 409
2121
2122
2123
2124# 2900-2949: webhook operations
2125
2126Value: 2900
2127Name: MERCHANT_PRIVATE_POST_WEBHOOKS_CONFLICT_WEBHOOK_EXISTS
2128Description: The webhook ID elready exists.
2129HttpStatus: 409
2130
2131Value: 2910
2132Name: MERCHANT_PRIVATE_POST_PENDING_WEBHOOKS_CONFLICT_PENDING_WEBHOOK_EXISTS
2133Description: The webhook serial elready exists.
2134HttpStatus: 409
2135
2136
1640 2137
1641 2138
1642 2139
@@ -1653,6 +2150,16 @@ Name: AUDITOR_EXCHANGE_SIGNING_KEY_REVOKED
1653Description: The exchange key used for the signature on the deposit confirmation was revoked. 2150Description: The exchange key used for the signature on the deposit confirmation was revoked.
1654HttpStatus: 410 2151HttpStatus: 410
1655 2152
2153Value: 3102
2154Name: AUDITOR_RESOURCE_NOT_FOUND
2155Description: The requested resource could not be found.
2156HttpStatus: 404
2157
2158Value: 3103
2159Name: AUDITOR_URI_MISSING_PATH_COMPONENT
2160Description: The URI is missing a path component.
2161HttpStatus: 400
2162
1656 2163
1657# 5000 - 5999: Reserved for bank 2164# 5000 - 5999: Reserved for bank
1658# 5000 - 5099: Reserved for BANK_GENERIC 2165# 5000 - 5099: Reserved for BANK_GENERIC
@@ -1660,57 +2167,52 @@ HttpStatus: 410
1660Value: 5101 2167Value: 5101
1661Name: BANK_SAME_ACCOUNT 2168Name: BANK_SAME_ACCOUNT
1662Description: Wire transfer attempted with credit and debit party being the same bank account. 2169Description: Wire transfer attempted with credit and debit party being the same bank account.
1663HttpStatus: 0 2170HttpStatus: 400
1664 2171
1665Value: 5102 2172Value: 5102
1666Name: BANK_UNALLOWED_DEBIT 2173Name: BANK_UNALLOWED_DEBIT
1667Description: Wire transfer impossible, due to financial limitation of the party that attempted the payment. 2174Description: Wire transfer impossible, due to financial limitation of the party that attempted the payment.
1668HttpStatus: 0 2175HttpStatus: 409
1669 2176
1670Value: 5103 2177Value: 5103
1671Name: BANK_NEGATIVE_NUMBER_AMOUNT 2178Name: BANK_NEGATIVE_NUMBER_AMOUNT
1672Description: Negative number was used (as value and/or fraction) to initiate a Amount object. 2179Description: Negative numbers are not allowed (as value and/or fraction) to instantiate an amount object.
1673HttpStatus: 0 2180HttpStatus: 400
1674 2181
1675Value: 5104 2182Value: 5104
1676Name: BANK_NUMBER_TOO_BIG 2183Name: BANK_NUMBER_TOO_BIG
1677Description: A number too big was used (as value and/or fraction) to initiate a amount object. 2184Description: A too big number was used (as value and/or fraction) to instantiate an amount object.
1678HttpStatus: 0 2185HttpStatus: 400
1679
1680Value: 5105
1681Name: BANK_LOGIN_FAILED
1682Description: Could not login for the requested operation.
1683HttpStatus: 0
1684 2186
1685Value: 5106 2187Value: 5106
1686Name: BANK_UNKNOWN_ACCOUNT 2188Name: BANK_UNKNOWN_ACCOUNT
1687Description: The bank account referenced in the requested operation was not found. Returned along "400 Not found". 2189Description: The bank account referenced in the requested operation was not found.
1688HttpStatus: 0 2190HttpStatus: 404
1689 2191
1690Value: 5107 2192Value: 5107
1691Name: BANK_TRANSACTION_NOT_FOUND 2193Name: BANK_TRANSACTION_NOT_FOUND
1692Description: The transaction referenced in the requested operation (typically a reject operation), was not found. 2194Description: The transaction referenced in the requested operation (typically a reject operation), was not found.
1693HttpStatus: 0 2195HttpStatus: 404
1694 2196
1695Value: 5108 2197Value: 5108
1696Name: BANK_BAD_FORMAT_AMOUNT 2198Name: BANK_BAD_FORMAT_AMOUNT
1697Description: Bank received a malformed amount string. 2199Description: Bank received a malformed amount string.
1698HttpStatus: 0 2200HttpStatus: 400
1699 2201
1700Value: 5109 2202Value: 5109
1701Name: BANK_REJECT_NO_RIGHTS 2203Name: BANK_REJECT_NO_RIGHTS
1702Description: The client does not own the account credited by the transaction which is to be rejected, so it has no rights do reject it. To be returned along HTTP 403 Forbidden. 2204Description: The client does not own the account credited by the transaction which is to be rejected, so it has no rights do reject it.
1703HttpStatus: 0 2205HttpStatus: 403
1704 2206
1705Value: 5110 2207Value: 5110
1706Name: BANK_UNMANAGED_EXCEPTION 2208Name: BANK_UNMANAGED_EXCEPTION
1707Description: This error code is returned when no known exception types captured the exception, and comes along with a 500 Internal Server Error. 2209Description: This error code is returned when no known exception types captured the exception.
1708HttpStatus: 0 2210HttpStatus: 500
1709 2211
1710Value: 5111 2212Value: 5111
1711Name: BANK_SOFT_EXCEPTION 2213Name: BANK_SOFT_EXCEPTION
1712Description: This error code is used for all those exceptions that do not really need a specific error code to return to the client, but need to signal the middleware that the bank is not responding with 500 Internal Server Error. Used for example when a client is trying to register with a unavailable username. 2214Description: This error code is used for all those exceptions that do not really need a specific error code to return to the client. Used for example when a client is trying to register with a unavailable username.
1713HttpStatus: 0 2215HttpStatus: 500
1714 2216
1715Value: 5112 2217Value: 5112
1716Name: BANK_TRANSFER_REQUEST_UID_REUSED 2218Name: BANK_TRANSFER_REQUEST_UID_REUSED
@@ -1727,6 +2229,160 @@ Name: BANK_DUPLICATE_RESERVE_PUB_SUBJECT
1727Description: The wire transfer subject duplicates an existing reserve public key. But wire transfer subjects must be unique. 2229Description: The wire transfer subject duplicates an existing reserve public key. But wire transfer subjects must be unique.
1728HttpStatus: 409 2230HttpStatus: 409
1729 2231
2232Value: 5115
2233Name: BANK_ANCIENT_TRANSACTION_GONE
2234Description: The client requested a transaction that is so far in the past, that it has been forgotten by the bank.
2235HttpStatus: 410
2236
2237Value: 5116
2238Name: BANK_ABORT_CONFIRM_CONFLICT
2239Description: The client attempted to abort a transaction that was already confirmed.
2240HttpStatus: 409
2241
2242Value: 5117
2243Name: BANK_CONFIRM_ABORT_CONFLICT
2244Description: The client attempted to confirm a transaction that was already aborted.
2245HttpStatus: 409
2246
2247Value: 5118
2248Name: BANK_REGISTER_CONFLICT
2249Description: The client attempted to register an account with the same name.
2250HttpStatus: 409
2251
2252Value: 5119
2253Name: BANK_POST_WITHDRAWAL_OPERATION_REQUIRED
2254Description: The client attempted to confirm a withdrawal operation before the wallet posted the required details.
2255HttpStatus: 400
2256
2257Value: 5120
2258Name: BANK_RESERVED_USERNAME_CONFLICT
2259Description: The client tried to register a new account under a reserved username (like 'admin' for example).
2260HttpStatus: 409
2261
2262Value: 5121
2263Name: BANK_REGISTER_USERNAME_REUSE
2264Description: The client tried to register a new account with an username already in use.
2265HttpStatus: 409
2266
2267Value: 5122
2268Name: BANK_REGISTER_PAYTO_URI_REUSE
2269Description: The client tried to register a new account with a payto:// URI already in use.
2270HttpStatus: 409
2271
2272Value: 5123
2273Name: BANK_ACCOUNT_BALANCE_NOT_ZERO
2274Description: The client tried to delete an account with a non null balance.
2275HttpStatus: 409
2276
2277Value: 5124
2278Name: BANK_UNKNOWN_CREDITOR
2279Description: The client tried to create a transaction or an operation that credit an unknown account.
2280HttpStatus: 409
2281
2282Value: 5125
2283Name: BANK_UNKNOWN_DEBTOR
2284Description: The client tried to create a transaction or an operation that debit an unknown account.
2285HttpStatus: 409
2286
2287Value: 5126
2288Name: BANK_ACCOUNT_IS_EXCHANGE
2289Description: The client tried to perform an action prohibited for exchange accounts.
2290HttpStatus: 409
2291
2292Value: 5127
2293Name: BANK_ACCOUNT_IS_NOT_EXCHANGE
2294Description: The client tried to perform an action reserved for exchange accounts.
2295HttpStatus: 409
2296
2297Value: 5128
2298Name: BANK_BAD_CONVERSION
2299Description: Received currency conversion is wrong.
2300HttpStatus: 409
2301
2302Value: 5129
2303Name: BANK_MISSING_TAN_INFO
2304Description: The account referenced in this operation is missing tan info for the chosen channel.
2305HttpStatus: 409
2306
2307Value: 5130
2308Name: BANK_CONFIRM_INCOMPLETE
2309Description: The client attempted to confirm a transaction with incomplete info.
2310HttpStatus: 409
2311
2312Value: 5131
2313Name: BANK_TAN_RATE_LIMITED
2314Description: The request rate is too high. The server is refusing requests to guard against brute-force attacks.
2315HttpStatus: 429
2316
2317Value: 5132
2318Name: BANK_TAN_CHANNEL_NOT_SUPPORTED
2319Description: This TAN channel is not supported.
2320HttpStatus: 501
2321
2322Value: 5133
2323Name: BANK_TAN_CHANNEL_SCRIPT_FAILED
2324Description: Failed to send TAN using the helper script. Either script is not found, or script timeout, or script terminated with a non-successful result.
2325HttpStatus: 500
2326
2327Value: 5134
2328Name: BANK_TAN_CHALLENGE_FAILED
2329Description: The client's response to the challenge was invalid.
2330HttpStatus: 403
2331
2332Value: 5135
2333Name: BANK_NON_ADMIN_PATCH_LEGAL_NAME
2334Description: A non-admin user has tried to change their legal name.
2335HttpStatus: 409
2336
2337Value: 5136
2338Name: BANK_NON_ADMIN_PATCH_DEBT_LIMIT
2339Description: A non-admin user has tried to change their debt limit.
2340HttpStatus: 409
2341
2342Value: 5137
2343Name: BANK_NON_ADMIN_PATCH_MISSING_OLD_PASSWORD
2344Description: A non-admin user has tried to change their password whihout providing the current one.
2345HttpStatus: 409
2346
2347Value: 5138
2348Name: BANK_PATCH_BAD_OLD_PASSWORD
2349Description: Provided old password does not match current password.
2350HttpStatus: 409
2351
2352Value: 5139
2353Name: BANK_PATCH_ADMIN_EXCHANGE
2354Description: An admin user has tried to become an exchange.
2355HttpStatus: 409
2356
2357Value: 5140
2358Name: BANK_NON_ADMIN_PATCH_CASHOUT
2359Description: A non-admin user has tried to change their cashout account.
2360HttpStatus: 409
2361
2362Value: 5141
2363Name: BANK_NON_ADMIN_PATCH_CONTACT
2364Description: A non-admin user has tried to change their contact info.
2365HttpStatus: 409
2366
2367Value: 5142
2368Name: BANK_ADMIN_CREDITOR
2369Description: The client tried to create a transaction that credit the admin account.
2370HttpStatus: 409
2371
2372Value: 5143
2373Name: BANK_CHALLENGE_NOT_FOUND
2374Description: The referenced challenge was not found.
2375HttpStatus: 404
2376
2377Value: 5144
2378Name: BANK_TAN_CHALLENGE_EXPIRED
2379Description: The referenced challenge has expired.
2380HttpStatus: 409
2381
2382Value: 5145
2383Name: BANK_NON_ADMIN_SET_TAN_CHANNEL
2384Description: A non-admin user has tried to create an account with 2fa.
2385HttpStatus: 409
1730 2386
1731# 6000 - 6999: Reserved for sync 2387# 6000 - 6999: Reserved for sync
1732# 6000 - 6099: Reserved for SYNC_GENERIC 2388# 6000 - 6099: Reserved for SYNC_GENERIC
@@ -1796,6 +2452,17 @@ Name: SYNC_MISSING_CONTENT_LENGTH
1796Description: The "Content-length" field for the upload is missing. 2452Description: The "Content-length" field for the upload is missing.
1797HttpStatus: 400 2453HttpStatus: 400
1798 2454
2455Value: 6113
2456Name: SYNC_GENERIC_BACKEND_ERROR
2457Description: Sync had problems communicating with its payment backend.
2458HttpStatus: 502
2459
2460Value: 6114
2461Name: SYNC_GENERIC_BACKEND_TIMEOUT
2462Description: Sync experienced a timeout communicating with its payment backend.
2463HttpStatus: 504
2464
2465
1799 2466
1800# 7000 - 7999: Reserved for wallet 2467# 7000 - 7999: Reserved for wallet
1801 2468
@@ -1880,8 +2547,8 @@ Description: A group of withdrawal operations (typically for the same reserve at
1880HttpStatus: 0 2547HttpStatus: 0
1881 2548
1882Value: 7016 2549Value: 7016
1883Name: WALLET_TIPPING_COIN_SIGNATURE_INVALID 2550Name: WALLET_REWARD_COIN_SIGNATURE_INVALID
1884Description: The signature on a coin by the exchange's denomination key (obtained through the merchant via tipping) is invalid after unblinding it. 2551Description: The signature on a coin by the exchange's denomination key (obtained through the merchant via a reward) is invalid after unblinding it.
1885HttpStatus: 0 2552HttpStatus: 0
1886 2553
1887Value: 7017 2554Value: 7017
@@ -1909,7 +2576,82 @@ Name: WALLET_PENDING_OPERATION_FAILED
1909Description: A pending operation failed, and thus the request can't be completed. 2576Description: A pending operation failed, and thus the request can't be completed.
1910HttpStatus: 0 2577HttpStatus: 0
1911 2578
1912# 8000 - 8999: Reserved for Anastasis 2579Value: 7022
2580Name: WALLET_PAY_MERCHANT_SERVER_ERROR
2581Description: A payment was attempted, but the merchant had an internal server error (5xx).
2582HttpStatus: 0
2583
2584Value: 7023
2585Name: WALLET_CRYPTO_WORKER_ERROR
2586Description: The crypto worker failed.
2587HttpStatus: 0
2588
2589Value: 7024
2590Name: WALLET_CRYPTO_WORKER_BAD_REQUEST
2591Description: The crypto worker received a bad request.
2592HttpStatus: 0
2593
2594Value: 7025
2595Name: WALLET_WITHDRAWAL_KYC_REQUIRED
2596Description: A KYC step is required before withdrawal can proceed.
2597HttpStatus: 0
2598
2599Value: 7026
2600Name: WALLET_DEPOSIT_GROUP_INSUFFICIENT_BALANCE
2601Description: The wallet does not have sufficient balance to create a deposit group.
2602HttpStatus: 0
2603
2604Value: 7027
2605Name: WALLET_PEER_PUSH_PAYMENT_INSUFFICIENT_BALANCE
2606Description: The wallet does not have sufficient balance to create a peer push payment.
2607HttpStatus: 0
2608
2609Value: 7028
2610Name: WALLET_PEER_PULL_PAYMENT_INSUFFICIENT_BALANCE
2611Description: The wallet does not have sufficient balance to pay for an invoice.
2612HttpStatus: 0
2613
2614Value: 7029
2615Name: WALLET_REFRESH_GROUP_INCOMPLETE
2616Description: A group of refresh operations has errors and will be tried again later.
2617HttpStatus: 0
2618
2619Value: 7030
2620Name: WALLET_EXCHANGE_BASE_URL_MISMATCH
2621Description: The exchange's self-reported base URL does not match the one that the wallet is using.
2622HttpStatus: 0
2623
2624Value: 7031
2625Name: WALLET_ORDER_ALREADY_PAID
2626Description: The order has already been paid by another wallet.
2627HttpStatus: 0
2628
2629Value: 7032
2630Name: WALLET_EXCHANGE_UNAVAILABLE
2631Description: An exchange that is required for some request is currently not available.
2632HttpStatus: 0
2633
2634Value: 7033
2635Name: WALLET_EXCHANGE_ENTRY_USED
2636Description: An exchange entry is still used by the exchange, thus it can't be deleted without purging.
2637HttpStatus: 0
2638
2639Value: 7034
2640Name: WALLET_DB_UNAVAILABLE
2641Description: The wallet database is unavailable and the wallet thus is not operational.
2642HttpStatus: 0
2643
2644Value: 7035
2645Name: WALLET_TALER_URI_MALFORMED
2646Description: A taler:// URI is malformed and can't be parsed.
2647HttpStatus: 0
2648
2649Value: 7036
2650Name: WALLET_CORE_REQUEST_CANCELLED
2651Description: A wallet-core request was cancelled and thus can't provide a response.
2652HttpStatus: 0
2653
2654# 8000 - 8499: Reserved for Anastasis
1913 2655
1914Value: 8000 2656Value: 8000
1915Name: ANASTASIS_GENERIC_BACKEND_TIMEOUT 2657Name: ANASTASIS_GENERIC_BACKEND_TIMEOUT
@@ -2251,8 +2993,31 @@ Name: ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED
2251Description: The reducer already synchronized with all providers. 2993Description: The reducer already synchronized with all providers.
2252HttpStatus: 0 2994HttpStatus: 0
2253 2995
2996# 8500 - 8600: Frosix
2997
2998# 8600 - 8700: Donau
2999
3000Value: 8607
3001Name: DONAU_GENERIC_KEYS_MISSING
3002Description: The Donau failed to perform the operation as it could not find the private keys. This is a problem with the Donau setup, not with the client's request.
3003HttpStatus: 503
3004
3005Value: 8608
3006Name: DONAU_CHARITY_SIGNATURE_INVALID
3007Description: The signature of the charity key is not valid.
3008HttpStatus: 403
3009
3010Value: 8609
3011Name: DONAU_CHARITY_NOT_FOUND
3012Description: The charity is unknown.
3013HttpStatus: 404
3014
3015Value: 8610
3016Name: DONAU_EXCEEDING_DONATION_LIMIT
3017Description: The donation amount specified in the request exceeds the limit of the charity.
3018HttpStatus: 400
2254 3019
2255# 9000 - 9998: LibEuFin. 3020# 9000 - 9599: LibEuFin.
2256 3021
2257Value: 9000 3022Value: 9000
2258Name: LIBEUFIN_NEXUS_GENERIC_ERROR 3023Name: LIBEUFIN_NEXUS_GENERIC_ERROR
@@ -2274,7 +3039,70 @@ Name: LIBEUFIN_SANDBOX_UNCAUGHT_EXCEPTION
2274Description: An uncaught exception happened in the LibEuFin sandbox service. 3039Description: An uncaught exception happened in the LibEuFin sandbox service.
2275HttpStatus: 500 3040HttpStatus: 500
2276 3041
3042# 9600 - 9749: Taldir
3043Value: 9600
3044Name: TALDIR_METHOD_NOT_SUPPORTED
3045Description: This validation method is not supported by the service.
3046HttpStatus: 404
3047
3048Value: 9601
3049Name: TALDIR_REGISTER_RATE_LIMITED
3050Description: Number of allowed attempts for initiating a challenge exceeded.
3051HttpStatus: 429
3052
3053# 9750-9999: Challenger
3054Value: 9750
3055Name: CHALLENGER_GENERIC_CLIENT_UNKNOWN
3056Description: The client is unknown or unauthorized.
3057HttpStatus: 404
3058
3059Value: 9751
3060Name: CHALLENGER_GENERIC_CLIENT_FORBIDDEN_BAD_REDIRECT_URI
3061Description: The client is not authorized to use the given redirect URI.
3062HttpStatus: 403
3063
3064Value: 9752
3065Name: CHALLENGER_HELPER_EXEC_FAILED
3066Description: The service failed to execute its helper process to send the challenge.
3067HttpStatus: 500
3068
3069Value: 9753
3070Name: CHALLENGER_GRANT_UNKNOWN
3071Description: The grant is unknown to the service (it could also have expired).
3072HttpStatus: 404
3073
3074Value: 9754
3075Name: CHALLENGER_CLIENT_FORBIDDEN_BAD_CODE
3076Description: The code given is not even well-formed.
3077HttpStatus: 403
3078
3079Value: 9755
3080Name: CHALLENGER_GENERIC_VALIDATION_UNKNOWN
3081Description: The service is not aware of the referenced validation process.
3082HttpStatus: 404
3083
3084Value: 9756
3085Name: CHALLENGER_CLIENT_FORBIDDEN_INVALID_CODE
3086Description: The code given is not valid.
3087HttpStatus: 403
3088
3089Value: 9757
3090Name: CHALLENGER_TOO_MANY_ATTEMPTS
3091Description: Too many attempts have been made, validation is temporarily disabled for this address.
3092HttpStatus: 429
3093
3094Value: 9758
3095Name: CHALLENGER_INVALID_PIN
3096Description: The PIN code provided is incorrect.
3097HttpStatus: 403
3098
3099Value: 9759
3100Name: CHALLENGER_MISSING_ADDRESS
3101Description: The token cannot be valid as no address was ever provided by the client.
3102HttpStatus: 409
3103
2277 3104
3105# Some of our build systems expect the range to be < 10k, so let's keep it like this for now.
2278Value: 9999 3106Value: 9999
2279Name: END 3107Name: END
2280Description: End of error code range. 3108Description: End of error code range.
diff --git a/gnu-taler-error-codes/rst.footer b/gnu-taler-error-codes/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnu-taler-error-codes/rst.footer
diff --git a/gnu-taler-error-codes/rst.header b/gnu-taler-error-codes/rst.header
new file mode 100644
index 0000000..0b30d8a
--- /dev/null
+++ b/gnu-taler-error-codes/rst.header
@@ -0,0 +1,14 @@
1GNU Taler Error Codes
2---------------------
3
4Entries
5^^^^^^^
6
7.. list-table:: GNU Taler Error Codes
8 :widths: auto
9 :header-rows: 1
10
11 * - Name
12 - Value
13 - HTTP Status
14 - Description
diff --git a/gnu-taler-error-codes/rst.template b/gnu-taler-error-codes/rst.template
new file mode 100644
index 0000000..9bff06c
--- /dev/null
+++ b/gnu-taler-error-codes/rst.template
@@ -0,0 +1,4 @@
1 * - {{Name}}
2 - {{Value}}
3 - {{HttpStatus_Value}} ({{HttpStatus_Identifier}})
4 - {{Description}}
diff --git a/gnu-taler-extensions/registry.rec b/gnu-taler-extensions/registry.rec
index 81dc913..d9b4eff 100644
--- a/gnu-taler-extensions/registry.rec
+++ b/gnu-taler-extensions/registry.rec
@@ -24,10 +24,20 @@ Critical: true
24Contact: oec-taler@kesim.org 24Contact: oec-taler@kesim.org
25References: Design document 24 25References: Design document 24
26 26
27Identifier: P2P_PAYMENTS 27Identifier: POLICY_REFUND
28Description: Support for payments directly between wallets. 28Description: Support for refund in payments.
29Critical: false 29Critical: false
30Contact: team@taler.net 30Contact: team@taler.net
31References: Design document 13 31References: Design document 13
32 32
33Identifier: POLICY_AUCTION
34Description: Auction support via libbrandt
35Critical: false
36Contact: oec-taler@kesim.org
37References: Design document 32
33 38
39Identifier: POLICY_ESCROW
40Description: Escrow functionality provided by the exchange. Deposited coins can be put into escrow for a specified time interval, potentially in the future. If the owner of the coins and the merchant both sign the contract within the interval, the coins' value will be transferred to the merchant's account. Otherwise, the coins can be refreshed by the owner.
41Critical: false
42Contact: oec-taler@kesim.org
43References: NOT YET
diff --git a/gnu-taler-extensions/rst.footer b/gnu-taler-extensions/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnu-taler-extensions/rst.footer
diff --git a/gnu-taler-extensions/rst.header b/gnu-taler-extensions/rst.header
new file mode 100644
index 0000000..a172030
--- /dev/null
+++ b/gnu-taler-extensions/rst.header
@@ -0,0 +1,4 @@
1GNS Default Top-Level-Domains
2-----------------------------
3
4
diff --git a/gnu-taler-extensions/rst.template b/gnu-taler-extensions/rst.template
new file mode 100644
index 0000000..6d757b7
--- /dev/null
+++ b/gnu-taler-extensions/rst.template
@@ -0,0 +1,9 @@
1
2
3=================== ===========================================================
4Suffix {{Name}}
5------------------- -----------------------------------------------------------
6Zone Key {{Key}}
7Comment {{Comment}}
8=================== ===========================================================
9
diff --git a/gnu-taler-kyc-attributes/Makefile b/gnu-taler-kyc-attributes/Makefile
new file mode 100644
index 0000000..edb88bb
--- /dev/null
+++ b/gnu-taler-kyc-attributes/Makefile
@@ -0,0 +1,6 @@
1all: check
2
3check: registry.rec
4 recfix --check registry.rec
5
6.PHONY: all check
diff --git a/gnu-taler-kyc-attributes/registry.rec b/gnu-taler-kyc-attributes/registry.rec
new file mode 100644
index 0000000..af71f4c
--- /dev/null
+++ b/gnu-taler-kyc-attributes/registry.rec
@@ -0,0 +1,66 @@
1# -*- mode: rec -*-
2#
3# Registry for GNU Taler attributes, as per Design document 31
4#
5%rec: TalerAttributes
6%key: Identifier
7%typedef: Identifier_t regexp /^[ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789:\.]*$/
8%type: Identifier Identifier_t
9%unique: Identifier
10%mandatory: Identifier
11%typedef: Description_t regexp |^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\(\)\.,;!"':#\/ -]*$|
12%type: Description Description_t
13%mandatory: Description
14%typedef: Category_t enum individual business both
15%type: Category Category_t
16%mandatory: Category
17%allowed: Contact
18%allowed: References
19%allowed: Comment
20%sort: Identifier Description Contact References
21
22
23Identifier: BUSINESS_NAME
24Description: Full legal name of the business.
25Category: business
26
27Identifier: BUSINESS_TAX_ID
28Description: Tax identifier of the business.
29Category: business
30Comment: Format may depend on the country of residence of the business.
31
32Identifier: FULL_NAME
33Description: Full legal name of an individual.
34Category: individual
35
36Identifier: CONTACT_EMAIL
37Description: E-mail address to contact the individual or business.
38Category: both
39Comment: Can be validated via E-mail with TAN.
40
41Identifier: CONTACT_PHONE
42Description: Phone number to contact the individual or business.
43Category: both
44Comment: Can be validated via SMS-TAN or phone call.
45
46Identifier: CONTACT_DNS_DOMAIN
47Description: DNS domain name owned by the individual or business.
48Category: both
49Comment: Can be validated by having the owner set an appropriate DNS TXT record.
50
51Identifier: CONTACT_WEB_DOMAIN
52Description: Web site owned by the individual or business.
53Category: both
54Comment: Can be validated by having the owner serve an appropriate well-known page.
55
56Identifier: ADDRESS_STREET
57Description: Street address (including house number) of the individual or business.
58Category: both
59
60Identifier: ADDRESS_CITY
61Description: Name of the city where the individual or business resides.
62Category: both
63
64Identifier: ADDRESS_COUNTRY
65Description: Name of the country where the individual or business resides.
66Category: both
diff --git a/gnunet-dht-block-types/.gitignore b/gnunet-dht-block-types/.gitignore
new file mode 100644
index 0000000..0a437d0
--- /dev/null
+++ b/gnunet-dht-block-types/.gitignore
@@ -0,0 +1 @@
gnu-name-system-record-types.h
diff --git a/gnunet-dht-block-types/Makefile b/gnunet-dht-block-types/Makefile
index f402c2d..7ac5f54 100644
--- a/gnunet-dht-block-types/Makefile
+++ b/gnunet-dht-block-types/Makefile
@@ -1,4 +1,4 @@
1FILES=gnunet_dht_block_types.h 1FILES=gnunet_dht_block_types.h gnunet_dht_block_types.rst
2all: check $(FILES) 2all: check $(FILES)
3 3
4check: 4check:
@@ -15,4 +15,14 @@ gnunet_dht_block_types.h.tmp: registry.rec h.template
15gnunet_dht_block_types.h: h.header gnunet_dht_block_types.h.tmp h.footer 15gnunet_dht_block_types.h: h.header gnunet_dht_block_types.h.tmp h.footer
16 cat h.header gnunet_dht_block_types.h.tmp h.footer > $@ 16 cat h.header gnunet_dht_block_types.h.tmp h.footer > $@
17 17
18gnunet_dht_block_types.rst.tmp: registry.rec rst.template
19 ../format.sh rst.template < registry.rec > $@
20
21rst.header.tmp:
22 cat README POLICY rst.header.template > $@
23
24gnunet_dht_block_types.rst: rst.header.tmp gnunet_dht_block_types.rst.tmp rst.footer
25 cat rst.header.tmp gnunet_dht_block_types.rst.tmp rst.footer > $@
26
27
18.PHONY: check clean distclean 28.PHONY: check clean distclean
diff --git a/gnunet-dht-block-types/POLICY b/gnunet-dht-block-types/POLICY
new file mode 100644
index 0000000..4308df6
--- /dev/null
+++ b/gnunet-dht-block-types/POLICY
@@ -0,0 +1,11 @@
1Policy
2^^^^^^
3
4Developers working on GNUnet or packages based on GNUnet should
5feel free to extend this registry. Entries may be deleted if
6no code using them is still expected to be in production anywhere.
7
8Updating the name of the package or subsystem is allowed provided
9that the code using the signature is being moved, as those fields
10are merely informational or used for code generation.
11
diff --git a/gnunet-dht-block-types/README b/gnunet-dht-block-types/README
index e11fe42..844d7e2 100644
--- a/gnunet-dht-block-types/README
+++ b/gnunet-dht-block-types/README
@@ -1,3 +1,6 @@
1R5N DHT Block Types
2-------------------
3
1This registry is for GNUnet DHT Block Types. 4This registry is for GNUnet DHT Block Types.
2 5
3DHT Block Types types uniquely identify the different kinds 6DHT Block Types types uniquely identify the different kinds
@@ -7,3 +10,4 @@ This registry is used to ensure that the names and numeric values
7used to identify block types are uniquely defined and to 10used to identify block types are uniquely defined and to
8allow DHT implementors to find out details about the 11allow DHT implementors to find out details about the
9respective semantics and human-readable syntax. 12respective semantics and human-readable syntax.
13
diff --git a/gnunet-dht-block-types/registry.rec b/gnunet-dht-block-types/registry.rec
index e2366d3..e73dea4 100644
--- a/gnunet-dht-block-types/registry.rec
+++ b/gnunet-dht-block-types/registry.rec
@@ -37,8 +37,8 @@ Comment: Type of a block representing a block to be encoded on demand from disk.
37References: None 37References: None
38 38
39Number: 7 39Number: 7
40Name: DHT_HELLO 40Name: LEGACY_HELLO
41Comment: Type of a block that contains a HELLO for a peer. 41Comment: Legacy type of a block that contains a HELLO for a peer.
42References: None 42References: None
43 43
44Number: 8 44Number: 8
@@ -67,9 +67,9 @@ Comment: Block type for a revocation message by which a key is revoked.
67References: None 67References: None
68 68
69Number: 13 69Number: 13
70Name: DHT_URL_HELLO 70Name: DHT_HELLO
71Comment: Type of a block that contains a DHT-NG HELLO for a peer. 71Comment: Type of a block that contains a DHT-NG HELLO for a peer.
72References: None 72References: LSD-0004
73 73
74Number: 22 74Number: 22
75Name: REGEX 75Name: REGEX
diff --git a/gnunet-dht-block-types/rst.footer b/gnunet-dht-block-types/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnunet-dht-block-types/rst.footer
diff --git a/gnunet-dht-block-types/rst.header.template b/gnunet-dht-block-types/rst.header.template
new file mode 100644
index 0000000..a577b68
--- /dev/null
+++ b/gnunet-dht-block-types/rst.header.template
@@ -0,0 +1,11 @@
1Entries
2^^^^^^^
3
4.. list-table:: R5N Block Types
5 :widths: auto
6 :header-rows: 1
7
8 * - Name
9 - Number
10 - References
11 - Comment
diff --git a/gnunet-dht-block-types/rst.template b/gnunet-dht-block-types/rst.template
new file mode 100644
index 0000000..11468c9
--- /dev/null
+++ b/gnunet-dht-block-types/rst.template
@@ -0,0 +1,4 @@
1 * - {{Name}}
2 - {{Number}}
3 - {{References}}
4 - {{Comment}}
diff --git a/gnunet-error-codes/.gitignore b/gnunet-error-codes/.gitignore
new file mode 100644
index 0000000..f6c67c1
--- /dev/null
+++ b/gnunet-error-codes/.gitignore
@@ -0,0 +1,3 @@
1gnunet_error_codes.c
2gnunet_error_codes.go
3gnunet_error_codes.ts
diff --git a/gnunet-error-codes/Makefile b/gnunet-error-codes/Makefile
new file mode 100644
index 0000000..14fd480
--- /dev/null
+++ b/gnunet-error-codes/Makefile
@@ -0,0 +1,71 @@
1FILES=gnunet_error_codes.h \
2 gnunet_error_codes.c \
3 gnunet_error_codes.ts \
4 gnunet_error_codes.go \
5 gnunet_error_codes.rst
6
7all: check $(FILES)
8
9check: registry.rec
10 recfix --check registry.rec
11
12distclean:
13 rm -f *.tmp
14
15clean:
16 rm -f $(FILES) *.tmp
17
18prep:
19 cd ../http-status-codes; make ; cd -
20
21# Because prep is phony, this rule always triggers. To avoid
22# combined.tmp cascading into triggering the other rules even
23# if nothing changed, we use 'diff' to make sure that 'recsel'
24# actually changed the result.
25combined.tmp: registry.rec prep
26 recsel -t GnunetErrorCode -j HttpStatus -p Description,Name,Value,HttpStatus,HttpStatus.Value,HttpStatus.Identifier ../http-status-codes/registry.rec registry.rec > combined.xtmp
27 if ! diff $@ combined.xtmp > /dev/null; then mv combined.xtmp $@; else rm combined.xtmp; fi
28
29combined-escaped.tmp: combined.tmp
30 sed 's/"/\\"/g' combined.tmp > $@
31
32length.tmp: combined.tmp
33 recsel -p "Count(Description):ECS_LENGTH" combined.tmp > $@
34
35gnunet_error_codes.h.tmp: combined.tmp h.template
36 ../format.sh h.template < combined.tmp > $@
37
38gnunet_error_codes.h: h.header gnunet_error_codes.h.tmp h.footer
39 cat h.header gnunet_error_codes.h.tmp h.footer > $@
40
41gnunet_error_codes.c.tmp: combined-escaped.tmp c.template
42 ../format.sh c.template < combined-escaped.tmp > $@
43
44gnunet_error_codes-length.c.tmp: length.tmp c-length.template
45 ../format.sh c-length.template < length.tmp > $@
46
47gnunet_error_codes.c: c.header gnunet_error_codes.c.tmp gnunet_error_codes-length.c.tmp c.footer
48 cat c.header gnunet_error_codes.c.tmp gnunet_error_codes-length.c.tmp c.footer > $@
49
50gnunet_error_codes.ts.tmp: combined.tmp ts.template
51 ../format.sh ts.template < combined.tmp > $@
52
53gnunet_error_codes.ts: ts.header gnunet_error_codes.ts.tmp ts.footer
54 cat ts.header gnunet_error_codes.ts.tmp ts.footer > $@
55
56gnunet_error_codes.go.tmp: combined.tmp go.template
57 ../format.sh go.template < combined.tmp > $@
58
59gnunet_error_codes.go: go.header gnunet_error_codes.go.tmp go.footer
60 cat go.header gnunet_error_codes.go.tmp go.footer > $@
61
62gnunet_error_codes.rst.tmp: combined.tmp rst.template
63 ../format.sh rst.template < combined.tmp > $@
64
65rst.header.tmp:
66 cat README POLICY rst.header.template > $@
67
68gnunet_error_codes.rst: rst.header.tmp gnunet_error_codes.rst.tmp rst.footer
69 cat rst.header.tmp gnunet_error_codes.rst.tmp rst.footer > $@
70
71.PHONY: check clean distclean prep
diff --git a/gnunet-error-codes/POLICY b/gnunet-error-codes/POLICY
new file mode 100644
index 0000000..4308df6
--- /dev/null
+++ b/gnunet-error-codes/POLICY
@@ -0,0 +1,11 @@
1Policy
2^^^^^^
3
4Developers working on GNUnet or packages based on GNUnet should
5feel free to extend this registry. Entries may be deleted if
6no code using them is still expected to be in production anywhere.
7
8Updating the name of the package or subsystem is allowed provided
9that the code using the signature is being moved, as those fields
10are merely informational or used for code generation.
11
diff --git a/gnunet-error-codes/README b/gnunet-error-codes/README
new file mode 100644
index 0000000..6fce4a8
--- /dev/null
+++ b/gnunet-error-codes/README
@@ -0,0 +1,5 @@
1GNUnet Error Codes
2------------------
3
4GNUnet error code registry.
5
diff --git a/gnunet-error-codes/c-length.template b/gnunet-error-codes/c-length.template
new file mode 100644
index 0000000..24e3e41
--- /dev/null
+++ b/gnunet-error-codes/c-length.template
@@ -0,0 +1,9 @@
1
2
3};
4
5
6/**
7 * The length of @e code_hint_pairs.
8 */
9static const unsigned int code_hint_pairs_length = {{ECS_LENGTH}};
diff --git a/gnunet-error-codes/c.footer b/gnunet-error-codes/c.footer
new file mode 100644
index 0000000..ad326ec
--- /dev/null
+++ b/gnunet-error-codes/c.footer
@@ -0,0 +1,66 @@
1
2
3
4const char *
5GNUNET_ErrorCode_get_hint (enum GNUNET_ErrorCode ec)
6{
7 unsigned int lower = 0;
8 unsigned int upper = code_hint_pairs_length - 1;
9 unsigned int mid = upper / 2;
10 while (lower <= upper)
11 {
12 mid = (upper + lower) / 2;
13 if (code_hint_pairs[mid].ec < ec)
14 {
15 lower = mid + 1;
16 }
17 else if (code_hint_pairs[mid].ec > ec)
18 {
19 upper = mid - 1;
20 }
21 else
22 {
23 return code_hint_pairs[mid].hint;
24 }
25 }
26 return "<no hint found>";
27}
28
29
30unsigned int
31GNUNET_ErrorCode_get_http_status (enum GNUNET_ErrorCode ec)
32{
33 unsigned int lower = 0;
34 unsigned int upper = code_hint_pairs_length - 1;
35 unsigned int mid = upper / 2;
36 while (lower <= upper)
37 {
38 mid = (upper + lower) / 2;
39 if (code_hint_pairs[mid].ec < ec)
40 {
41 lower = mid + 1;
42 }
43 else if (code_hint_pairs[mid].ec > ec)
44 {
45 upper = mid - 1;
46 }
47 else
48 {
49 return code_hint_pairs[mid].http_code;
50 }
51 }
52 return UINT_MAX;
53}
54
55
56unsigned int
57GNUNET_ErrorCode_get_http_status_safe (enum GNUNET_ErrorCode ec)
58{
59 unsigned int hc;
60
61 hc = GNUNET_ErrorCode_get_http_status (ec);
62 if ( (0 == hc) ||
63 (UINT_MAX == hc) )
64 return MHD_HTTP_INTERNAL_SERVER_ERROR;
65 return hc;
66}
diff --git a/gnunet-error-codes/c.header b/gnunet-error-codes/c.header
new file mode 100644
index 0000000..9539ef3
--- /dev/null
+++ b/gnunet-error-codes/c.header
@@ -0,0 +1,55 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012-2022 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20#include "gnunet_error_codes.h"
21#include <stddef.h>
22#include <microhttpd.h>
23#include <gettext.h>
24
25/**
26 * MHD does not define our value for 0 (client-side generated code).
27 */
28#define MHD_HTTP_UNINITIALIZED 0
29
30/**
31 * A pair containing an error code and its hint.
32 */
33struct ErrorCodeAndHint
34{
35 /**
36 * The error code.
37 */
38 enum GNUNET_ErrorCode ec;
39
40 /**
41 * The hint.
42 */
43 const char *hint;
44
45 /**
46 * The HTTP status code.
47 */
48 unsigned int http_code;
49};
50
51
52/**
53 * The list of all error codes with their hints.
54 */
55static const struct ErrorCodeAndHint code_hint_pairs[] = {
diff --git a/gnunet-error-codes/c.template b/gnunet-error-codes/c.template
new file mode 100644
index 0000000..140f09f
--- /dev/null
+++ b/gnunet-error-codes/c.template
@@ -0,0 +1,6 @@
1
2 {
3 .ec = GNUNET_EC_{{Name}},
4 .hint = gettext_noop ("{{Description}}"),
5 .http_code = MHD_HTTP_{{HttpStatus_Identifier}}
6 },
diff --git a/gnunet-error-codes/go.footer b/gnunet-error-codes/go.footer
new file mode 100644
index 0000000..bea8cd1
--- /dev/null
+++ b/gnunet-error-codes/go.footer
@@ -0,0 +1 @@
)
diff --git a/gnunet-error-codes/go.header b/gnunet-error-codes/go.header
new file mode 100644
index 0000000..9c5d1e7
--- /dev/null
+++ b/gnunet-error-codes/go.header
@@ -0,0 +1,23 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012-2022 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
21package gana
22
23const (
diff --git a/gnunet-error-codes/go.template b/gnunet-error-codes/go.template
new file mode 100644
index 0000000..fd4ba79
--- /dev/null
+++ b/gnunet-error-codes/go.template
@@ -0,0 +1,7 @@
1
2
3 /**
4 * {{Description}}
5 * Returned with an HTTP status code of #MHD_HTTP_{{HttpStatus_Identifier}} ({{HttpStatus_Value}}).
6 */
7 {{Name}} = {{Value}}
diff --git a/gnunet-error-codes/h.footer b/gnunet-error-codes/h.footer
new file mode 100644
index 0000000..fcd44d7
--- /dev/null
+++ b/gnunet-error-codes/h.footer
@@ -0,0 +1,45 @@
1
2
3};
4
5
6/**
7 * Returns a hint for a given error code.
8 *
9 * @param ec the error code.
10 * @return the hint if it could be found, otherwise "<no hint found>"
11 */
12const char *
13GNUNET_ErrorCode_get_hint (enum GNUNET_ErrorCode ec);
14
15
16/**
17 * Return HTTP status for a given error code.
18 *
19 * @param ec the error code.
20 * @return the HTTP status code for the given @a ec, UINT_MAX if not found
21 */
22unsigned int
23GNUNET_ErrorCode_get_http_status (enum GNUNET_ErrorCode ec);
24
25
26/**
27 * Return HTTP status for a given error code that is guaranteed
28 * to work (no corner cases).
29 *
30 * @param ec the error code.
31 * @return the HTTP status code for the given @a ec, 500 if
32 * the @a ec is not found or is a client-side code
33 */
34unsigned int
35GNUNET_ErrorCode_get_http_status_safe (enum GNUNET_ErrorCode ec);
36
37
38#if 0 /* keep Emacsens' auto-indent happy */
39{
40#endif
41#ifdef __cplusplus
42}
43#endif
44
45#endif
diff --git a/gnunet-error-codes/h.header b/gnunet-error-codes/h.header
new file mode 100644
index 0000000..92debba
--- /dev/null
+++ b/gnunet-error-codes/h.header
@@ -0,0 +1,43 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012-2022 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20 /**
21 * @file include/taler_error_codes.h
22 * @brief GNUnet error codes, generated via https://gana.gnunet.org/
23 *
24 * Do NOT edit this file, it is generated!
25 */
26#ifndef GNUNET_ERROR_CODES_H
27#define GNUNET_ERROR_CODES_H
28
29#ifdef __cplusplus
30extern "C" {
31#if 0 /* keep Emacsens' auto-indent happy */
32}
33#endif
34#endif
35
36#include <limits.h>
37
38
39/**
40 * Taler error codes.
41 */
42enum GNUNET_ErrorCode
43{
diff --git a/gnunet-error-codes/h.template b/gnunet-error-codes/h.template
new file mode 100644
index 0000000..b79bf6c
--- /dev/null
+++ b/gnunet-error-codes/h.template
@@ -0,0 +1,7 @@
1
2
3 /**
4 * {{Description}}
5 * Returned with an HTTP status code of #MHD_HTTP_{{HttpStatus_Identifier}} ({{HttpStatus_Value}}).
6 */
7 GNUNET_EC_{{Name}} = {{Value}},
diff --git a/gnunet-error-codes/registry.rec b/gnunet-error-codes/registry.rec
new file mode 100644
index 0000000..e833bb5
--- /dev/null
+++ b/gnunet-error-codes/registry.rec
@@ -0,0 +1,136 @@
1# -*- mode: rec -*-
2#
3# Registry for GNUnet errors.
4#
5%rec: GnunetErrorCode
6%key: Value
7%typedef: ValueRange_t range 0 9999
8%type: Value ValueRange_t
9%mandatory: Value
10%typedef: Description_t regexp |^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\(\)\.,;!"':#\/ -]*$|
11%type: Description Description_t
12%mandatory: Description
13%typedef: Name_t regexp /^[ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*$/
14%type: Name Name_t
15%unique: Name
16%mandatory: Name
17# A status of 0 means no HTTP status is associated
18%type: HttpStatus rec HttpStatusCode
19%mandatory: HttpStatus
20%sort: Value
21
22Value: 0
23Name: NONE
24Description: No error (success).
25HttpStatus: 0
26
27Value: 1
28Name: UNKNOWN
29Description: Unknown and unspecified error.
30HttpStatus: 500
31
32Value: 101
33Name: SERVICE_COMMUNICATION_FAILED
34Description: Communication with service failed.
35HttpStatus: 500
36
37# IDENTITY Error Codes
38
39Value: 200
40Name: IDENTITY_NOT_FOUND
41Description: Ego not found.
42HttpStatus: 404
43
44Value: 201
45Name: IDENTITY_NAME_CONFLICT
46Description: Identifier already in use for another ego.
47HttpStatus: 409
48
49Value: 202
50Name: IDENTITY_INVALID
51Description: The given ego is invalid or malformed.
52HttpStatus: 500
53
54# NAMESTORE Error Codes
55
56Value: 5000
57Name: NAMESTORE_UNKNOWN
58Description: Unknown namestore error.
59HttpStatus: 500
60
61Value: 5001
62Name: NAMESTORE_ITERATION_FAILED
63Description: Zone iteration failed.
64HttpStatus: 500
65
66Value: 5002
67Name: NAMESTORE_ZONE_NOT_FOUND
68Description: Zone not found.
69HttpStatus: 404
70
71Value: 5003
72Name: NAMESTORE_RECORD_NOT_FOUND
73Description: Record not found.
74HttpStatus: 404
75
76Value: 5004
77Name: NAMESTORE_RECORD_DELETE_FAILED
78Description: Zone iteration failed.
79HttpStatus: 500
80
81Value: 5005
82Name: NAMESTORE_ZONE_EMPTY
83Description: Zone does not contain any records.
84HttpStatus: 404
85
86Value: 5006
87Name: NAMESTORE_LOOKUP_ERROR
88Description: Failed to lookup record.
89HttpStatus: 500
90
91Value: 5007
92Name: NAMESTORE_NO_RECORDS_GIVEN
93Description: No records given.
94HttpStatus: 400
95
96Value: 5008
97Name: NAMESTORE_RECORD_DATA_INVALID
98Description: Record data invalid.
99HttpStatus: 400
100
101Value: 5009
102Name: NAMESTORE_NO_LABEL_GIVEN
103Description: No label given.
104HttpStatus: 400
105
106Value: 5010
107Name: NAMESTORE_NO_RESULTS
108Description: No results given.
109HttpStatus: 404
110
111Value: 5011
112Name: NAMESTORE_RECORD_EXISTS
113Description: Record already exists.
114HttpStatus: 409
115
116Value: 5012
117Name: NAMESTORE_RECORD_TOO_BIG
118Description: Record size exceeds maximum limit.
119HttpStatus: 500
120
121Value: 5013
122Name: NAMESTORE_BACKEND_FAILED
123Description: There was an error in the database backend.
124HttpStatus: 500
125
126Value: 5014
127Name: NAMESTORE_STORE_FAILED
128Description: Failed to store the given records.
129HttpStatus: 500
130
131Value: 5015
132Name: NAMESTORE_LABEL_INVALID
133Description: Label invalid or malformed.
134HttpStatus: 400
135
136
diff --git a/gnunet-error-codes/rst.footer b/gnunet-error-codes/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnunet-error-codes/rst.footer
diff --git a/gnunet-error-codes/rst.header.template b/gnunet-error-codes/rst.header.template
new file mode 100644
index 0000000..2c4ddcf
--- /dev/null
+++ b/gnunet-error-codes/rst.header.template
@@ -0,0 +1,11 @@
1Entries
2^^^^^^^
3
4.. list-table:: GNUnet Error Codes
5 :widths: auto
6 :header-rows: 1
7
8 * - Name
9 - Value
10 - HttpStatus
11 - Description
diff --git a/gnunet-error-codes/rst.template b/gnunet-error-codes/rst.template
new file mode 100644
index 0000000..9bff06c
--- /dev/null
+++ b/gnunet-error-codes/rst.template
@@ -0,0 +1,4 @@
1 * - {{Name}}
2 - {{Value}}
3 - {{HttpStatus_Value}} ({{HttpStatus_Identifier}})
4 - {{Description}}
diff --git a/gnunet-error-codes/ts.footer b/gnunet-error-codes/ts.footer
new file mode 100644
index 0000000..b285e7d
--- /dev/null
+++ b/gnunet-error-codes/ts.footer
@@ -0,0 +1,3 @@
1
2
3}
diff --git a/gnunet-error-codes/ts.header b/gnunet-error-codes/ts.header
new file mode 100644
index 0000000..1438b99
--- /dev/null
+++ b/gnunet-error-codes/ts.header
@@ -0,0 +1,21 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012-2022 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
21export enum GnunetErrorCode {
diff --git a/gnunet-error-codes/ts.template b/gnunet-error-codes/ts.template
new file mode 100644
index 0000000..ee72f88
--- /dev/null
+++ b/gnunet-error-codes/ts.template
@@ -0,0 +1,7 @@
1
2
3 /**
4 * {{Description}}
5 * Returned with an HTTP status code of #MHD_HTTP_{{HttpStatus_Identifier}} ({{HttpStatus_Value}}).
6 */
7 {{Name}} = {{Value}},
diff --git a/gnunet-protocols/.gitignore b/gnunet-protocols/.gitignore
new file mode 100644
index 0000000..0a437d0
--- /dev/null
+++ b/gnunet-protocols/.gitignore
@@ -0,0 +1 @@
gnu-name-system-record-types.h
diff --git a/gnunet-protocols/Makefile b/gnunet-protocols/Makefile
new file mode 100644
index 0000000..f87c482
--- /dev/null
+++ b/gnunet-protocols/Makefile
@@ -0,0 +1,30 @@
1FILES=gnunet_overlay_protocols.h gnunet_overlay_protocols.rst
2all: check $(FILES)
3
4check:
5 recfix --check registry.rec
6
7distclean:
8 rm -f *.tmp
9clean:
10 rm -f $(FILES) *.tmp
11
12gnunet_overlay_protocols.h.tmp: registry.rec h.template
13 ../format.sh h.template < registry.rec > $@
14
15gnunet_overlay_protocols.h: h.header gnunet_overlay_protocols.h.tmp h.footer
16 cat h.header gnunet_overlay_protocols.h.tmp h.footer > $@
17
18gnunet_overlay_protocols.rst.tmp: registry.rec rst.template
19 ../format.sh rst.template < registry.rec > $@
20
21rst.header.tmp:
22 cat rst.header.template README POLICY > $@
23 echo "Entries" >> $@
24 echo "^^^^^^^" >> $@
25
26gnunet_overlay_protocols.rst: rst.header.tmp gnunet_overlay_protocols.rst.tmp rst.footer
27 cat rst.header.tmp gnunet_overlay_protocols.rst.tmp rst.footer > $@
28
29
30.PHONY: check clean distclean
diff --git a/gnunet-protocols/POLICY b/gnunet-protocols/POLICY
new file mode 100644
index 0000000..24ebdf3
--- /dev/null
+++ b/gnunet-protocols/POLICY
@@ -0,0 +1,20 @@
1Policy
2^^^^^^
3
4Each registry entry should contain three values: the "Number" of the
5protocol, which must be above 255 (to avoid conflicts with legacy
6Internet protocols), the "Name" of the protocol, and a "Reference" with links
7to further information about the record type.
8
9The "Name" must be unique in the entire registry. The value must be a
10case insensitive ASCII string and is restricted to alphanumeric
11characters.
12
13Adding protocols is possible after expert review, using a
14first-come-first-served policy for unique "Name" allocation.
15Experts are responsible to ensure that the chosen "Name" is
16appropriate for the record type.
17
18The current contact(s) for expert review are reachable at
19gns-registry@gnunet.org.
20
diff --git a/gnunet-protocols/README b/gnunet-protocols/README
new file mode 100644
index 0000000..e335357
--- /dev/null
+++ b/gnunet-protocols/README
@@ -0,0 +1,10 @@
1This registry is for overlay protocols.
2
3Overlay protocol numbers uniquely identify the different kinds
4of protocols implemented to realize overlay service communication.
5
6This registry is used to ensure that the names and numeric values
7used to identify the protocols are uniquely defined and to
8allow implementors to find out details about the respective semantics and
9specifications.
10
diff --git a/gnunet-protocols/h.footer b/gnunet-protocols/h.footer
new file mode 100644
index 0000000..adccc7a
--- /dev/null
+++ b/gnunet-protocols/h.footer
@@ -0,0 +1,11 @@
1
2
3
4#if 0 /* keep Emacsens' auto-indent happy */
5{
6#endif
7#ifdef __cplusplus
8}
9#endif
10
11#endif
diff --git a/gnunet-protocols/h.header b/gnunet-protocols/h.header
new file mode 100644
index 0000000..8bbba29
--- /dev/null
+++ b/gnunet-protocols/h.header
@@ -0,0 +1,30 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2012-2022 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20#ifndef GNUNET_OVERLAY_PROTOCOLS_H
21#define GNUNET_OVERLAY_PROTOCOLS_H
22
23/**
24 * WARNING:
25 * This header is generated!
26 * In order to add overlay protocols, you must register
27 * them in GANA, and then use the header generation script
28 * to create an update of this file. You may then replace this
29 * file with the update.
30 */
diff --git a/gnunet-protocols/h.template b/gnunet-protocols/h.template
new file mode 100644
index 0000000..2d7e828
--- /dev/null
+++ b/gnunet-protocols/h.template
@@ -0,0 +1,6 @@
1
2
3/**
4 * {{Comment}}
5 */
6#define GNUNET_OVERLAY_PROTOCOL_{{Name}} {{Number}}
diff --git a/gnunet-protocols/registry.rec b/gnunet-protocols/registry.rec
new file mode 100644
index 0000000..96c8dcb
--- /dev/null
+++ b/gnunet-protocols/registry.rec
@@ -0,0 +1,23 @@
1# -*- mode: rec -*-
2#
3# Registry for overlay protocols
4#
5
6%rec: OverlayProtocol
7%key: Number
8%typedef: NumberRange_t range 256 65535
9%type: Number NumberRange_t
10%mandatory: Number
11%typedef: Name_t regexp /^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-]*$/
12%type: Name Name_t
13%unique: Name
14%mandatory: Name
15%mandatory: Comment
16%allowed: Contact
17%allowed: References
18%sort: Number Name Contact References
19
20Number: 256
21Name: CADET
22Comment: CADET protocol.
23References: https://git.gnunet.org/bibliography.git/plain/docs/cadet.pdf
diff --git a/gnunet-protocols/rst.footer b/gnunet-protocols/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnunet-protocols/rst.footer
diff --git a/gnunet-protocols/rst.header.template b/gnunet-protocols/rst.header.template
new file mode 100644
index 0000000..f6e68fa
--- /dev/null
+++ b/gnunet-protocols/rst.header.template
@@ -0,0 +1,4 @@
1GNUnet Overlay Protocols
2------------------------
3
4
diff --git a/gnunet-protocols/rst.template b/gnunet-protocols/rst.template
new file mode 100644
index 0000000..e032a7f
--- /dev/null
+++ b/gnunet-protocols/rst.template
@@ -0,0 +1,10 @@
1
2
3=================== ===========================================================
4Name GNUNET_OVERLAY_PROTOCOL_{{Name}}
5------------------- -----------------------------------------------------------
6Number {{Number}}
7Comment {{Comment}}
8References {{References}}
9=================== ===========================================================
10
diff --git a/gnunet-signatures/Makefile b/gnunet-signatures/Makefile
index d3eef80..509febf 100644
--- a/gnunet-signatures/Makefile
+++ b/gnunet-signatures/Makefile
@@ -1,4 +1,4 @@
1FILES=gnunet_signatures.h 1FILES=gnunet_signatures.h gnunet_signatures.rst
2all: check $(FILES) 2all: check $(FILES)
3check: 3check:
4 recfix --check registry.rec 4 recfix --check registry.rec
@@ -12,4 +12,14 @@ gnunet_signatures.h.tmp: registry.rec h.template
12gnunet_signatures.h: h.header gnunet_signatures.h.tmp h.footer 12gnunet_signatures.h: h.header gnunet_signatures.h.tmp h.footer
13 cat h.header gnunet_signatures.h.tmp h.footer > $@ 13 cat h.header gnunet_signatures.h.tmp h.footer > $@
14 14
15gnunet_signatures.rst.tmp: registry.rec rst.template
16 ../format.sh rst.template 'Package = "GNUnet"' < registry.rec > $@
17
18rst.header.tmp:
19 cat README POLICY rst.header.template > $@
20
21gnunet_signatures.rst: rst.header.tmp gnunet_signatures.rst.tmp rst.footer
22 cat rst.header.tmp gnunet_signatures.rst.tmp rst.footer > $@
23
24
15.PHONY: check clean distclean 25.PHONY: check clean distclean
diff --git a/gnunet-signatures/POLICY b/gnunet-signatures/POLICY
new file mode 100644
index 0000000..4308df6
--- /dev/null
+++ b/gnunet-signatures/POLICY
@@ -0,0 +1,11 @@
1Policy
2^^^^^^
3
4Developers working on GNUnet or packages based on GNUnet should
5feel free to extend this registry. Entries may be deleted if
6no code using them is still expected to be in production anywhere.
7
8Updating the name of the package or subsystem is allowed provided
9that the code using the signature is being moved, as those fields
10are merely informational or used for code generation.
11
diff --git a/gnunet-signatures/README b/gnunet-signatures/README
index 99587b7..b68b960 100644
--- a/gnunet-signatures/README
+++ b/gnunet-signatures/README
@@ -1,3 +1,6 @@
1GNUnet Signature Purposes
2-------------------------
3
1GNUnet signature purpose registry. 4GNUnet signature purpose registry.
2 5
3Every time a signature is created or verified with libgnunetutil's 6Every time a signature is created or verified with libgnunetutil's
@@ -5,3 +8,4 @@ signature functions, the signer must provide a "purpose" that provides
5the context for the signature. By signing over the "purpose", it is 8the context for the signature. By signing over the "purpose", it is
6not possible for an adversary to use a signature made in one context 9not possible for an adversary to use a signature made in one context
7in another context. 10in another context.
11
diff --git a/gnunet-signatures/registry.rec b/gnunet-signatures/registry.rec
index d9bb568..d3a2a12 100644
--- a/gnunet-signatures/registry.rec
+++ b/gnunet-signatures/registry.rec
@@ -39,10 +39,10 @@ Package: GNUnet
39Subsystem: GNUnet-TRANSPORT 39Subsystem: GNUnet-TRANSPORT
40 40
41Number: 3 41Number: 3
42Name: REVOCATION 42Name: GNS_REVOCATION
43Comment: Signature for confirming a key revocation. 43Comment: GNS zone key revocation
44Package: GNUnet 44Package: GNUnet
45Subsystem: GNUnet-Revocation 45Subsystem: GNS
46 46
47Number: 4 47Number: 4
48Name: NAMESPACE_ADVERTISEMENT 48Name: NAMESPACE_ADVERTISEMENT
@@ -94,9 +94,9 @@ Subsystem: GNUnet-NSE
94 94
95Number: 15 95Number: 15
96Name: GNS_RECORD_SIGN 96Name: GNS_RECORD_SIGN
97Comment: Signature of a gnunet naming system record block 97Comment: GNS record set signature
98Package: GNUnet 98Package: GNUnet
99Subsystem: GNUnet-GNSRECORD 99Subsystem: GNS
100 100
101Number: 16 101Number: 16
102Name: SET_ECC_KEY 102Name: SET_ECC_KEY
@@ -219,12 +219,27 @@ Package: GNUnet
219Subsystem: GNUnet-TRANSPORT-TCP 219Subsystem: GNUnet-TRANSPORT-TCP
220 220
221#----------------------------------------------------------------------------- 221#-----------------------------------------------------------------------------
222# GNU Taler 222# GNU Taler, >= 1000
223 223
224# 224#
225# Exchange offline signatures (with master key) 225# Exchange offline signatures (with master key)
226# 226#
227 227
228Number: 1017
229Name: MASTER_AML_KEY
230Comment: Initialize or update the status of an AML key for an AML officer
231Package: GNU Taler
232
233Number: 1018
234Name: MASTER_DRAIN_PROFIT
235Comment: Affirm wiring of exchange profits to operator account.
236Package: GNU Taler
237
238Number: 1019
239Name: MASTER_PARTNER_DETAILS
240Comment: Signature affirming a partner configuration for wads.
241Package: GNU Taler
242
228Number: 1020 243Number: 1020
229Name: MASTER_SIGNING_KEY_REVOKED 244Name: MASTER_SIGNING_KEY_REVOKED
230Comment: The given revocation key was revoked and must no longer be used. 245Comment: The given revocation key was revoked and must no longer be used.
@@ -285,10 +300,6 @@ Name: MASTER_EXTENSION
285Comment: Set the configuration of an extension (age-restriction or peer2peer) 300Comment: Set the configuration of an extension (age-restriction or peer2peer)
286Package: GNU Taler 301Package: GNU Taler
287 302
288Number: 1048
289Name: MASTER_PARTNER_DETAILS
290Comment: Signature affirming a partner configuration for wads.
291Package: GNU Taler
292 303
293# 304#
294# Exchange online signatures (with signing key) 305# Exchange online signatures (with signing key)
@@ -374,6 +385,21 @@ Name: EXCHANGE_PURSE_STATUS
374Comment: Purpose for the state of a purse, signed by the exchange's signing key. 385Comment: Purpose for the state of a purse, signed by the exchange's signing key.
375Package: GNU Taler 386Package: GNU Taler
376 387
388Number: 1048
389Name: EXCHANGE_RESERVE_ATTEST_DETAILS
390Comment: Signature by which the exchange attests identity attributes of a particular reserve owner.
391Package: GNU Taler
392
393Number: 1049
394Name: EXCHANGE_CONFIRM_PURSE_REFUND
395Comment: Signature by which the exchange confirms that a purse expired and a coin was refunded.
396Package: GNU Taler
397
398Number: 1050
399Name: EXCHANGE_CONFIRM_AGE_WITHDRAW
400Comment: Signature where the Exchange confirms an age-withdraw.
401Package: GNU Taler
402
377# 403#
378# Auditor signatures 404# Auditor signatures
379# 405#
@@ -418,7 +444,7 @@ Package: GNU Taler
418 444
419Number: 1200 445Number: 1200
420Name: WALLET_RESERVE_WITHDRAW 446Name: WALLET_RESERVE_WITHDRAW
421Comment: Signature where the reserve key confirms a withdraw request. 447Comment: Signature where the reserve key confirms a withdraw request. Signed with the reserve private key.
422Package: GNU Taler 448Package: GNU Taler
423 449
424Number: 1201 450Number: 1201
@@ -428,17 +454,17 @@ Package: GNU Taler
428 454
429Number: 1202 455Number: 1202
430Name: WALLET_COIN_MELT 456Name: WALLET_COIN_MELT
431Comment: Signature using a coin key confirming the melting of a coin. 457Comment: Signature using a coin key confirming the melting of a coin. Signed with the coin's private key.
432Package: GNU Taler 458Package: GNU Taler
433 459
434Number: 1203 460Number: 1203
435Name: WALLET_COIN_RECOUP 461Name: WALLET_COIN_RECOUP
436Comment: Signature using a coin key requesting recoup. 462Comment: Signature using a coin key requesting recoup. Signed with the coin's private key.
437Package: GNU Taler 463Package: GNU Taler
438 464
439Number: 1204 465Number: 1204
440Name: WALLET_COIN_LINK 466Name: WALLET_COIN_LINK
441Comment: Signature using a coin key authenticating link data. 467Comment: Signature using a coin key authenticating link data. Signed with the old coin's private key.
442Package: GNU Taler 468Package: GNU Taler
443 469
444Number: 1205 470Number: 1205
@@ -448,7 +474,7 @@ Package: GNU Taler
448 474
449Number: 1206 475Number: 1206
450Name: WALLET_COIN_RECOUP_REFRESH 476Name: WALLET_COIN_RECOUP_REFRESH
451Comment: Signature using a coin key requesting recoup-refresh. 477Comment: Signature using a coin key requesting recoup-refresh. Signed with the coin private key.
452Package: GNU Taler 478Package: GNU Taler
453 479
454Number: 1207 480Number: 1207
@@ -458,47 +484,72 @@ Package: GNU Taler
458 484
459Number: 1208 485Number: 1208
460Name: WALLET_RESERVE_HISTORY 486Name: WALLET_RESERVE_HISTORY
461Comment: Request full reserve history and pay for it. 487Comment: Request full or partial reserve history. Signed with the reserve private key.
462Package: GNU Taler 488Package: GNU Taler
463 489
464Number: 1209 490Number: 1209
465Name: WALLET_RESERVE_STATUS 491Name: WALLET_COIN_HISTORY
466Comment: Request detailed account status (for free). 492Comment: Request full or partial coin history. Signed with the coin private key.
467Package: GNU Taler 493Package: GNU Taler
468 494
469Number: 1210 495Number: 1210
470Name: WALLET_PURSE_CREATE 496Name: WALLET_PURSE_CREATE
471Comment: Request purse creation (without reserve). 497Comment: Request purse creation (without reserve). Signed by the purse private key.
472Package: GNU Taler 498Package: GNU Taler
473 499
474Number: 1211 500Number: 1211
475Name: WALLET_PURSE_DEPOSIT 501Name: WALLET_PURSE_DEPOSIT
476Comment: Request coin to be deposited into a purse. 502Comment: Request coin to be deposited into a purse. Signed with the coin private key.
477Package: GNU Taler 503Package: GNU Taler
478 504
479Number: 1212 505Number: 1212
480Name: WALLET_PURSE_STATUS 506Name: WALLET_PURSE_STATUS
481Comment: Request purse status. 507Comment: Request purse status. Signed with the purse private key.
482Package: GNU Taler 508Package: GNU Taler
483 509
484Number: 1213 510Number: 1213
485Name: WALLET_PURSE_MERGE 511Name: WALLET_PURSE_MERGE
486Comment: Request purse to be merged with a reserve (by purse). 512Comment: Request purse to be merged with a reserve. Signed with the purse private key.
487Package: GNU Taler 513Package: GNU Taler
488 514
489Number: 1214 515Number: 1214
490Name: WALLET_ACCOUNT_MERGE 516Name: WALLET_ACCOUNT_MERGE
491Comment: Request purse to be merged with a reserve (by account). 517Comment: Request purse to be merged with a reserve. Signed by the reserve private key.
492Package: GNU Taler 518Package: GNU Taler
493 519
494Number: 1215 520Number: 1215
495Name: WALLET_RESERVE_CLOSE 521Name: WALLET_RESERVE_CLOSE
496Comment: Request account to be closed. 522Comment: Request account to be closed. Signed with the reserve private key.
497Package: GNU Taler 523Package: GNU Taler
498 524
499Number: 1216 525Number: 1216
500Name: WALLET_PURSE_ECONTRACT 526Name: WALLET_PURSE_ECONTRACT
501Comment: Associates encrypted contract with a purse. 527Comment: Associates encrypted contract with a purse. Signed with the purse private key.
528Package: GNU Taler
529
530Number: 1217
531Name: WALLET_RESERVE_OPEN
532Comment: Request reserve to be kept open. Signed with the reserve private key.
533Package: GNU Taler
534
535Number: 1218
536Name: WALLET_RESERVE_OPEN_DEPOSIT
537Comment: Request coin to be used to pay for reserve to be kept open. Signed with the coin private key.
538Package: GNU Taler
539
540Number: 1219
541Name: WALLET_RESERVE_ATTEST_DETAILS
542Comment: Request attestation about reserve owner. Signed by the reserve private key.
543Package: GNU Taler
544
545Number: 1220
546Name: WALLET_PURSE_DELETE
547Comment: Signature by which a wallet requests a purse to be deleted.
548Package: GNU Taler
549
550Number: 1221
551Name: WALLET_RESERVE_AGE_WITHDRAW
552Comment: Signature where the reserve key confirms an age-withdraw request. Signed with the reserve private key.
502Package: GNU Taler 553Package: GNU Taler
503 554
504# 555#
@@ -535,7 +586,22 @@ Comment: EdDSA test signature.
535Package: GNU Taler 586Package: GNU Taler
536 587
537# 588#
538# Anastasis signatures 589# AML officer signatures
590#
591
592Number: 1350
593Name: AML_DECISION
594Comment: Signature by which an AML officer signs an AML decision.
595Package: GNU Taler
596
597Number: 1351
598Name: AML_QUERY
599Comment: Signature by which an AML officer requests AML data.
600Package: GNU Taler
601
602
603#
604# GNU Anastasis signatures, >= 1400
539# 605#
540 606
541Number: 1400 607Number: 1400
@@ -544,10 +610,25 @@ Comment: EdDSA signature for a policy upload.
544Package: GNU Taler 610Package: GNU Taler
545 611
546# 612#
547# Sync signatures 613# Sync signatures, >= 1450
548# 614#
549 615
550Number: 1450 616Number: 1450
551Name: SYNC_BACKUP_UPLOAD 617Name: SYNC_BACKUP_UPLOAD
552Comment: EdDSA signature for a backup upload. 618Comment: EdDSA signature for a backup upload.
553Package: GNU Taler 619Package: GNU Taler
620
621
622#
623# Donau signatures, >= 1500
624#
625
626Number: 1500
627Name: DONAU_DONATION_STATEMENT
628Comment: The signature is done by the Donau. The Donau signes over the total amount of the corresponding year, the corresponding year and the donation identifier of a specific donor. The statement confirms that the donor made this total in donations for the given year.
629Package: Donau
630
631Number: 1501
632Name: CHARITY_DONATION_CONFIRMATION
633Comment: The signature is made by a charity and shows that the charity is in agreement with the donation request which it sends to the Donau. The charity signs over all blinded identifiers and key pairs which it has received from the donor. The signature affirms that the charity wants the donation receipts to be issued on its behalf.
634Package: Donau
diff --git a/gnunet-signatures/rst.footer b/gnunet-signatures/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gnunet-signatures/rst.footer
diff --git a/gnunet-signatures/rst.header.template b/gnunet-signatures/rst.header.template
new file mode 100644
index 0000000..1f2f336
--- /dev/null
+++ b/gnunet-signatures/rst.header.template
@@ -0,0 +1,12 @@
1Entries
2^^^^^^^
3
4.. list-table:: GNS Signature Purposes
5 :widths: auto
6 :header-rows: 1
7
8 * - Name
9 - Number
10 - Package
11 - Subsystem
12 - Comment
diff --git a/gnunet-signatures/rst.template b/gnunet-signatures/rst.template
new file mode 100644
index 0000000..7e4af96
--- /dev/null
+++ b/gnunet-signatures/rst.template
@@ -0,0 +1,5 @@
1 * - {{Name}}
2 - {{Number}}
3 - {{Package}}
4 - {{Subsystem}}
5 - {{Comment}}
diff --git a/http-status-codes/Makefile b/http-status-codes/Makefile
index cea962b..1cc83de 100644
--- a/http-status-codes/Makefile
+++ b/http-status-codes/Makefile
@@ -5,14 +5,14 @@ check: registry.rec
5 5
6# http-status-codes-1.csv is from IANA! 6# http-status-codes-1.csv is from IANA!
7iana.tmp: http-status-codes-1.csv 7iana.tmp: http-status-codes-1.csv
8 cat $^ | grep -v Unassigned | csv2rec > $@ 8 cat http-status-codes-1.csv | grep -v Unassigned | csv2rec > $@
9 9
10# extend by all-caps descriptions suitable for C-style identifier generation 10# extend by all-caps descriptions suitable for C-style identifier generation
11iana-extended.tmp: iana.tmp 11iana-extended.tmp: iana.tmp
12 ./extend.sh $@ $^ 12 ./extend.sh $@ iana.tmp
13 13
14registry.rec: types.rec iana-extended.tmp extras.rec 14registry.rec: types.rec iana-extended.tmp extras.rec
15 cat $^ > $@ 15 cat types.rec iana-extended.tmp extras.rec > $@
16 16
17distclean: 17distclean:
18 rm -f *.tmp 18 rm -f *.tmp
@@ -25,7 +25,7 @@ http-status-codes.h.tmp: registry.rec h.template
25 ../format.sh h.template < registry.rec > $@ 25 ../format.sh h.template < registry.rec > $@
26 26
27http-status-codes.h: h.header http-status-codes.h.tmp h.footer 27http-status-codes.h: h.header http-status-codes.h.tmp h.footer
28 cat $^ > $@ 28 cat h.header http-status-codes.h.tmp h.footer > $@
29 29
30 30
31.PHONY: check clean distclean 31.PHONY: check clean distclean
diff --git a/http-status-codes/POLICY b/http-status-codes/POLICY
new file mode 100644
index 0000000..79d1e37
--- /dev/null
+++ b/http-status-codes/POLICY
@@ -0,0 +1,5 @@
1The main registry is populated from the IANA registry.
2
3The 'extras.rec' may be populated with additional status
4codes that have significant usage and do not conflict with
5IANA registry entries. \ No newline at end of file
diff --git a/http-status-codes/extend.sh b/http-status-codes/extend.sh
index db09f6b..91a600e 100755
--- a/http-status-codes/extend.sh
+++ b/http-status-codes/extend.sh
@@ -12,11 +12,13 @@ cat "$@" > ${TARGET}
12TMPDIR=`pwd` 12TMPDIR=`pwd`
13export TMPDIR 13export TMPDIR
14 14
15for n in `seq 100 599` 15n=100
16while [ "$n" -le 599 ]
16do 17do
17 VAL=`recsel -e "Value = $n" -P Description iana.tmp || true` 18 VAL=`recsel -e "Value = $n" -P Description iana.tmp || true`
18 CAPS=`echo ${VAL} | tr [a-z] [A-Z] | tr " -" "__"` 19 CAPS=`echo ${VAL} | tr [a-z] [A-Z] | tr " -" "__"`
19 recset -f Identifier -a "${CAPS}" -e "Value = $n" ${TARGET} 20 recset -f Identifier -a "${CAPS}" -e "Value = $n" ${TARGET}
21 n=`expr $n + 1`
20done 22done
21 23
22 24
diff --git a/http-status-codes/http-status-codes-1.csv b/http-status-codes/http-status-codes-1.csv
index 9abdcae..b21e36f 100644
--- a/http-status-codes/http-status-codes-1.csv
+++ b/http-status-codes/http-status-codes-1.csv
@@ -39,14 +39,14 @@ Value,Description,Reference
39410,Gone,"[RFC7231, Section 6.5.9]" 39410,Gone,"[RFC7231, Section 6.5.9]"
40411,Length Required,"[RFC7231, Section 6.5.10]" 40411,Length Required,"[RFC7231, Section 6.5.10]"
41412,Precondition Failed,"[RFC7232, Section 4.2][RFC8144, Section 3.2]" 41412,Precondition Failed,"[RFC7232, Section 4.2][RFC8144, Section 3.2]"
42413,Payload Too Large,"[RFC7231, Section 6.5.11]" 42413,Content Too Large,"[RFC9110, Section 15.5.14]"
43414,URI Too Long,"[RFC7231, Section 6.5.12]" 43414,URI Too Long,"[RFC7231, Section 6.5.12]"
44415,Unsupported Media Type,"[RFC7231, Section 6.5.13][RFC7694, Section 3]" 44415,Unsupported Media Type,"[RFC7231, Section 6.5.13][RFC7694, Section 3]"
45416,Range Not Satisfiable,"[RFC7233, Section 4.4]" 45416,Range Not Satisfiable,"[RFC7233, Section 4.4]"
46417,Expectation Failed,"[RFC7231, Section 6.5.14]" 46417,Expectation Failed,"[RFC7231, Section 6.5.14]"
47418-420,Unassigned, 47418-420,Unassigned,
48421,Misdirected Request,"[RFC7540, Section 9.1.2]" 48421,Misdirected Request,"[RFC7540, Section 9.1.2]"
49422,Unprocessable Entity,[RFC4918] 49422,Unprocessable Content,"[RFC9110, Sectio 15.5.21]"
50423,Locked,[RFC4918] 50423,Locked,[RFC4918]
51424,Failed Dependency,[RFC4918] 51424,Failed Dependency,[RFC4918]
52425,Too Early,[RFC8470] 52425,Too Early,[RFC8470]
diff --git a/images/gnunet-blue.png b/images/gnunet-blue.png
new file mode 100644
index 0000000..1658455
--- /dev/null
+++ b/images/gnunet-blue.png
Binary files differ
diff --git a/index.rst b/index.rst
new file mode 100644
index 0000000..c565eb7
--- /dev/null
+++ b/index.rst
@@ -0,0 +1,10 @@
1############################################
2The GNUnet Assigned Numbers Authority (GANA)
3############################################
4
5
6.. toctree::
7 :maxdepth: 2
8
9 about
10 registries
diff --git a/payto-payment-target-types/Makefile b/payto-payment-target-types/Makefile
index 8364f52..9fa175c 100644
--- a/payto-payment-target-types/Makefile
+++ b/payto-payment-target-types/Makefile
@@ -1,2 +1,20 @@
1FILES=payto_payment_target_types.rst
2all: check $(FILES)
3
4
1check: 5check:
2 recfix --check registry.rec 6 recfix --check registry.rec
7
8distclean:
9 rm -f *.tmp
10
11clean:
12 rm -f $(FILES) *.tmp
13
14payto_payment_target_types.rst.tmp: registry.rec rst.template
15 ../format.sh rst.template < registry.rec > $@
16
17payto_payment_target_types.rst: rst.header payto_payment_target_types.rst.tmp
18 cat rst.header payto_payment_target_types.rst.tmp > $@
19
20.PHONY: check
diff --git a/payto-payment-target-types/eth.txt b/payto-payment-target-types/eth.txt
new file mode 100644
index 0000000..356f17d
--- /dev/null
+++ b/payto-payment-target-types/eth.txt
@@ -0,0 +1,119 @@
1# Payto Payment Target Type for Ethereum-compatible Blockchain Addresses
2
3## Target Type "eth"
4
5Name: eth
6
7Description: Ethereum-compatible Blockchain Address
8
9 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
10 NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
11 "MAY", and "OPTIONAL" in this document are to be interpreted as
12 described in RFC 2119 and RFC 8174.
13
14 The path consists of two components: The chain ID and the
15 Ethereum-compatible Mixed-case checksum address.
16
17 This is used to uniquely identify both the chain and the account
18 on the chain. The chain ID is used to prevent replay attacks
19 between different chains. If the checksum is invalid, the address
20 and corresponding URI is invalid and the payment should not be sent.
21 Connecting to the chain is out of scope for this specification. If
22 the chain is not available, the payment should not be sent, but the
23 URI is still valid.
24
25 The currency type can be omitted from the amount option, leaving
26 a simple decimal number with a maximum of 8 decimal places.
27 If the currency type (as part of the amount) is not present,
28 the currency is assumed to be the native currency of the chain.
29 If the currency is present, it must be a valid ERC-55 address
30 pointing to a valid ERC-20 token contract on the chain. If the
31 currency is not a valid ERC-20 token, then the URI is invalid.
32 This includes three-letter currency codes, which are not valid
33 ERC-20 token addresses.
34
35
36Syntax:
37 payto-eth-URI = "payto://eth/" addr [ "@" chain_id ] [ "?" opts ]
38
39 'addr' is an Ethereum-compatible Mixed-case checksum address
40 as defined in [ERC-55](https://eips.ethereum.org/EIPS/eip-55).
41 It MUST not be the zero address, and the checksum MUST be valid.
42 If either of these conditions is not met, the URI is invalid.
43
44 'chain_id' is an Ethereum chain ID as defined in
45 [EIP-155](https://eips.ethereum.org/EIPS/eip-155).
46 If not present, it MUST default to 1 (mainnet).
47
48 'opts' is defined in
49 [Section 2 of RFC 8905](https://tools.ietf.org/html/rfc8905#section-2).
50
51
52Examples:
53
54 payto://eth/0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1
55 payto://eth/0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1@11155111
56 payto://eth/0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1?amount=1.23
57 payto://eth/0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1?amount=0x6b175474e89094c44da98b954eedeac495271d0f:1.23
58
59 The first address requests that payment be sent to the
60 mainnet address '0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1'.
61
62 The second address requests that payment be sent to the
63 Sepolia testnet address
64 '0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1'.
65
66 The third address requests that 1.23 ETH (1230000000000000000
67 wei) be sent to the mainnet address
68 '0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1'.
69
70 The fourth address requests that 1.23 DAI (1230000000000000000
71 base units of DAI, since DAI has 18 ERC-20 decimals) be sent
72 to the mainnet address '0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1'.
73
74
75Motivation - not normative
76
77This syntax is modeled after the ERC-681 URL format
78for transaction requests, commonly used in Ethereum
79wallets and DApps. The function and function parameters
80are not included in this URI type, since they are not
81needed for payment requests.
82
83The chain ID is included in the URI, to prevent replay
84attacks between different chains. The checksum address
85is included in the URI, to prevent typos and other
86errors in the address. The checksum address is also
87included in the URI, to prevent phishing attacks by
88displaying the address in a different case than the
89one used to create the address.
90
91The currency is included in the URI, to allow payments
92to be made in any ERC-20 token. Three-letter currency
93codes are not included, since they are not valid ERC-20
94token addresses. Should sending traditional currencies
95be desired, Stablecoins are often ERC-20 tokens, and are
96therefore valid currencies for this URI type.
97
98
99Contact: <gavinnjohn@gmail.com>
100
101
102Normative References
103
104* [ERC-20] Token Standard
105 <https://eips.ethereum.org/EIPS/eip-20>
106
107* [ERC-55] Mixed-case checksum address encoding
108 <https://eips.ethereum.org/EIPS/eip-55>
109
110* [EIP-155] Simple replay attack protection
111 <https://eips.ethereum.org/EIPS/eip-155>
112
113* [RFC 8905] The 'payto' URI Scheme for Payments
114 <https://tools.ietf.org/html/rfc8905>
115
116Informative References
117
118* [EIP-681] URL Format for Transaction Requests
119 <https://eips.ethereum.org/EIPS/eip-681>
diff --git a/payto-payment-target-types/registry.rec b/payto-payment-target-types/registry.rec
index f91ab9c..1c8fb3c 100644
--- a/payto-payment-target-types/registry.rec
+++ b/payto-payment-target-types/registry.rec
@@ -37,3 +37,15 @@ Reference: RFC 8905
37Name: ldap 37Name: ldap
38Reference: ldap.txt 38Reference: ldap.txt
39Contact: ietf@pep.security 39Contact: ietf@pep.security
40
41Name: eth
42Reference: eth.txt
43Contact: gavinnjohn@gmail.com
44
45Name: interac-etransfer
46Reference: TBD
47Contact: singpolyma@singpolyma.net
48
49Name: wallee-transaction
50Reference: wallee-transaction.txt
51Contact: habej2@bfh.ch
diff --git a/payto-payment-target-types/rst.footer b/payto-payment-target-types/rst.footer
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/payto-payment-target-types/rst.footer
diff --git a/payto-payment-target-types/rst.header b/payto-payment-target-types/rst.header
new file mode 100644
index 0000000..5840ecc
--- /dev/null
+++ b/payto-payment-target-types/rst.header
@@ -0,0 +1,13 @@
1GNU Taler Payment Target Types
2------------------------------
3
4Entries
5^^^^^^^
6
7.. list-table:: GNU Taler Payment Target Types
8 :widths: auto
9 :header-rows: 1
10
11 * - Name
12 - Reference
13 - Contact
diff --git a/payto-payment-target-types/rst.template b/payto-payment-target-types/rst.template
new file mode 100644
index 0000000..be6e655
--- /dev/null
+++ b/payto-payment-target-types/rst.template
@@ -0,0 +1,3 @@
1 * - {{Name}}
2 - {{Reference}}
3 - {{Contact}}
diff --git a/payto-payment-target-types/wallee-transaction.txt b/payto-payment-target-types/wallee-transaction.txt
new file mode 100644
index 0000000..ee03e63
--- /dev/null
+++ b/payto-payment-target-types/wallee-transaction.txt
@@ -0,0 +1,49 @@
1# Payto Payment Target Type for Wallee Transactions
2
3## Target Type "wallee-transaction"
4
5Name: wallee-transaction
6
7Description: Wallee Transaction
8
9 A Wallee transaction is targeted by this payto target-type.
10 It aims to allow refunding a transaction which was initiated
11 by Wallee.
12
13 For refunding a transaction using Wallee, this payto specification
14 shall be used. To trigger a refund operation in Wallee, the identifier
15 of the transaction must be given as path parameter. The identifier is
16 a 64-bit integer.
17
18Syntax:
19
20 payto-wallee-transaction-URI = "payto://wallee-transaction/" [ id ]
21
22 'id' is a Long as defined in
23 [Wallee Type System](https://app-wallee.com/en-us/doc/api/web-service#_type_system)
24
25
26Examples:
27
28 payto://wallee-transaction/18446744073709551616
29 payto://wallee-transaction/13434452243525552616
30
31
32Contact: <mailto:habej2@bfh.ch>
33
34
35Normative References
36
37* [RFC 8905] The 'payto' URI Scheme for Payments
38 <https://tools.ietf.org/html/rfc8905>
39
40Informative References
41
42* [Wallee Transaction Model] The Transaction model of Wallee
43 <https://app-wallee.com/en-us/doc/api/model/transaction>
44
45* [Wallee Transaction API] The Transaction api of Wallee
46 <https://app-wallee.com/doc/api/web-service#_transaction>
47
48* [Wallee Type System] The type system used by Wallee
49 <https://app-wallee.com/en-us/doc/api/web-service#_type_system>
diff --git a/registries.rst b/registries.rst
new file mode 100644
index 0000000..35cfa91
--- /dev/null
+++ b/registries.rst
@@ -0,0 +1,19 @@
1Registries
2==========
3
4.. toctree::
5 :maxdepth: 1
6
7 dot-alt/dot_alt.rst
8 gnu-name-system-default-tlds/tlds.rst
9 gnu-name-system-record-flags/gnu_name_system_record_flags.rst
10 gnu-name-system-record-types/gnu_name_system_record_types.rst
11 gnunet-error-codes/gnunet_error_codes.rst
12 gnunet-protocols/gnunet_overlay_protocols.rst
13 gnunet-signatures/gnunet_signatures.rst
14 gnunet-dht-block-types/gnunet_dht_block_types.rst
15 gnu-taler-db-events/taler_dbevents.rst
16 gnu-taler-error-codes/taler_error_codes.rst
17 payto-payment-target-types/payto_payment_target_types.rst
18 gns-protocol-numbers/gnu_name_system_protocols.rst
19 gns-service-port-numbers/gnu_name_system_service_ports.rst \ No newline at end of file