diff options
155 files changed, 5379 insertions, 210 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 | |||
3 | make | ||
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 | |||
5 | chmod -R ag+rX _build | ||
6 | rsync --exclude=".*" --exclude="Makefile" --exclude="conf.py" -a --delete ./_build/ handbook@firefly.gnunet.org:~/gana/_build/ | ||
@@ -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 | |||
4 | REGISTRIES = 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. | ||
23 | SPHINXOPTS ?= | ||
24 | SPHINXBUILD ?= sphinx-build | ||
25 | SOURCEDIR = . | ||
26 | BUILDDIR = _build | ||
27 | |||
28 | |||
29 | all: rsts html | ||
30 | |||
31 | # Put it first so that "make" without argument is like "make help". | ||
32 | help: | ||
33 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
34 | |||
35 | .PHONY: all clean help texinfo info Makefile | ||
36 | |||
37 | rsts: | ||
38 | for dir in $(REGISTRIES); do \ | ||
39 | $(MAKE) -C $$dir; \ | ||
40 | done | ||
41 | |||
42 | html: | ||
43 | @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
44 | |||
45 | texinfo: | ||
46 | @$(SPHINXBUILD) -M texinfo "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
47 | |||
48 | info: | ||
49 | @$(SPHINXBUILD) -M info "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
50 | |||
51 | clean: | ||
52 | rm -rf $(BUILDDIR) | ||
53 | for dir in $(REGISTRIES); do \ | ||
54 | $(MAKE) -C $$dir; \ | ||
55 | done | ||
56 | |||
57 | distclean: clean | ||
58 | |||
59 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
60 | #%: Makefile | ||
61 | # @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
@@ -8,6 +8,21 @@ protocols. If you need to open a new registry, please feel free | |||
8 | to contact us at gana@gnunet.org. | 8 | to contact us at gana@gnunet.org. |
9 | 9 | ||
10 | 10 | ||
11 | Contributors | ||
12 | ============ | ||
13 | |||
14 | If you have Git access to GANA, you are generally authorized to add | ||
15 | new entries to the registries. Most registries are under a simple | ||
16 | first-come first-use policy. If you are unsure about the registration | ||
17 | policy of a particular registry, do ask gana@gnunet.org before making | ||
18 | changes. | ||
19 | |||
20 | Deleting or modifying existing entries (except improving comments) | ||
21 | should be done particularly carefully, so if unsure you might want to | ||
22 | double-check with gana@gnunet.org before changing or deleting | ||
23 | anything. | ||
24 | |||
25 | |||
11 | History | 26 | History |
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 | |||
13 | import re | ||
14 | import six | ||
15 | |||
16 | from docutils import nodes | ||
17 | from docutils.parsers.rst import directives | ||
18 | from docutils.statemachine import ViewList | ||
19 | |||
20 | from sphinx.util import force_decode | ||
21 | from sphinx.util.compat import Directive | ||
22 | from sphinx.util.nodes import nested_parse_with_titles | ||
23 | from sphinx.util.docstrings import prepare_docstring | ||
24 | from sphinx.pycode import ModuleAnalyzer | ||
25 | |||
26 | from sphinxcontrib import httpdomain | ||
27 | from sphinxcontrib.autohttp.common import http_directive, import_object | ||
28 | |||
29 | |||
30 | def 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 | |||
53 | def 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 | |||
59 | class 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 | |||
110 | def 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 | """ | ||
11 | import six | ||
12 | from six.moves import builtins | ||
13 | from six.moves import reduce | ||
14 | |||
15 | def 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 | |||
25 | def 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 | """ | ||
12 | from __future__ import absolute_import | ||
13 | |||
14 | import re | ||
15 | import itertools | ||
16 | import six | ||
17 | |||
18 | from docutils import nodes | ||
19 | from docutils.parsers.rst import directives | ||
20 | from docutils.statemachine import ViewList | ||
21 | |||
22 | from sphinx.util import force_decode | ||
23 | from sphinx.util.compat import Directive | ||
24 | from sphinx.util.nodes import nested_parse_with_titles | ||
25 | from sphinx.util.docstrings import prepare_docstring | ||
26 | from sphinx.pycode import ModuleAnalyzer | ||
27 | |||
28 | from sphinxcontrib import httpdomain | ||
29 | from sphinxcontrib.autohttp.common import http_directive, import_object | ||
30 | |||
31 | from .flask_base import AutoflaskBase | ||
32 | |||
33 | class 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 | |||
45 | def 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 | |||
13 | import re | ||
14 | import itertools | ||
15 | import six | ||
16 | |||
17 | from docutils import nodes | ||
18 | from docutils.parsers.rst import directives | ||
19 | from docutils.statemachine import ViewList | ||
20 | |||
21 | from sphinx.util import force_decode | ||
22 | from sphinx.util.compat import Directive | ||
23 | from sphinx.util.nodes import nested_parse_with_titles | ||
24 | from sphinx.util.docstrings import prepare_docstring | ||
25 | from sphinx.pycode import ModuleAnalyzer | ||
26 | |||
27 | from sphinxcontrib import httpdomain | ||
28 | from sphinxcontrib.autohttp.common import http_directive, import_object | ||
29 | |||
30 | |||
31 | def 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 | |||
47 | def 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 | |||
73 | def 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 | |||
100 | class 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 | |||
14 | from docutils import nodes | ||
15 | from docutils.statemachine import ViewList | ||
16 | |||
17 | from sphinxcontrib import httpdomain | ||
18 | from sphinx.util.nodes import nested_parse_with_titles | ||
19 | |||
20 | from .flask import AutoflaskBase | ||
21 | |||
22 | |||
23 | class 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 | |||
76 | def 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 | |||
13 | import inspect | ||
14 | import re | ||
15 | import six | ||
16 | |||
17 | from docutils import nodes | ||
18 | from docutils.parsers.rst import directives | ||
19 | from docutils.statemachine import ViewList | ||
20 | |||
21 | from sphinx.util import force_decode | ||
22 | from sphinx.util.compat import Directive | ||
23 | from sphinx.util.nodes import nested_parse_with_titles | ||
24 | from sphinx.util.docstrings import prepare_docstring | ||
25 | from sphinx.pycode import ModuleAnalyzer | ||
26 | |||
27 | from sphinxcontrib import httpdomain | ||
28 | from sphinxcontrib.autohttp.common import http_directive, import_object | ||
29 | |||
30 | |||
31 | def 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 | |||
49 | def 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 | |||
65 | def normalize_path(path): | ||
66 | if path.endswith('$'): | ||
67 | path = path[:-1] | ||
68 | return path | ||
69 | |||
70 | |||
71 | class 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 | |||
125 | def 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 | |||
12 | import re | ||
13 | |||
14 | from docutils import nodes | ||
15 | |||
16 | from pygments.lexer import RegexLexer, bygroups | ||
17 | from pygments.lexers import get_lexer_by_name | ||
18 | from pygments.token import Literal, Text, Operator, Keyword, Name, Number | ||
19 | from pygments.util import ClassNotFound | ||
20 | |||
21 | from sphinx import addnodes | ||
22 | from sphinx.roles import XRefRole | ||
23 | from sphinx.domains import Domain, ObjType, Index | ||
24 | from sphinx.directives import ObjectDescription, directives | ||
25 | from sphinx.util.nodes import make_refnode | ||
26 | from 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 | |||
39 | class 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 | |||
53 | class 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 | |||
63 | class 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 | |||
71 | class 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 | |||
78 | class 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. | ||
89 | METHOD_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. | ||
106 | HEADER_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 | |||
179 | HTTP_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 | |||
237 | WEBDAV_STATUS_CODES = [207, 422, 423, 424, 507] | ||
238 | |||
239 | http_sig_param_re = re.compile(r'\((?:(?P<type>[^:)]+):)?(?P<name>[\w_]+)\)', | ||
240 | re.VERBOSE) | ||
241 | |||
242 | |||
243 | def 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 | |||
254 | def http_resource_anchor(method, path): | ||
255 | path = re.sub(r'[{}]', '', re.sub(r'[<>:/]', '-', path)) | ||
256 | return method.lower() + '-' + path | ||
257 | |||
258 | |||
259 | class 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 | |||
349 | class HTTPOptions(HTTPResource): | ||
350 | |||
351 | method = 'options' | ||
352 | |||
353 | |||
354 | class HTTPHead(HTTPResource): | ||
355 | |||
356 | method = 'head' | ||
357 | |||
358 | |||
359 | class HTTPPatch(HTTPResource): | ||
360 | |||
361 | method = 'patch' | ||
362 | |||
363 | |||
364 | class HTTPPost(HTTPResource): | ||
365 | |||
366 | method = 'post' | ||
367 | |||
368 | |||
369 | class HTTPGet(HTTPResource): | ||
370 | |||
371 | method = 'get' | ||
372 | |||
373 | |||
374 | class HTTPPut(HTTPResource): | ||
375 | |||
376 | method = 'put' | ||
377 | |||
378 | |||
379 | class HTTPDelete(HTTPResource): | ||
380 | |||
381 | method = 'delete' | ||
382 | |||
383 | |||
384 | class HTTPTrace(HTTPResource): | ||
385 | |||
386 | method = 'trace' | ||
387 | |||
388 | |||
389 | class HTTPConnect(HTTPResource): | ||
390 | |||
391 | method = 'connect' | ||
392 | |||
393 | |||
394 | class HTTPCopy(HTTPResource): | ||
395 | |||
396 | method = 'copy' | ||
397 | |||
398 | |||
399 | class HTTPAny(HTTPResource): | ||
400 | |||
401 | method = 'any' | ||
402 | |||
403 | |||
404 | class 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 | |||
416 | class 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 | |||
437 | class 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 | |||
510 | class 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 | |||
524 | class 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 | |||
571 | class 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 | |||
697 | class 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 | |||
762 | def 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 | """ | ||
2 | TypeScript domain. | ||
3 | |||
4 | :copyright: Copyright 2019 by Taler Systems SA | ||
5 | :license: LGPLv3+ | ||
6 | :author: Florian Dold | ||
7 | """ | ||
8 | |||
9 | import re | ||
10 | |||
11 | from pathlib import Path | ||
12 | |||
13 | from docutils import nodes | ||
14 | from typing import List, Optional, Iterable, Dict, Tuple | ||
15 | from typing import cast | ||
16 | |||
17 | from pygments.lexers import get_lexer_by_name | ||
18 | from pygments.filter import Filter | ||
19 | from pygments.token import Literal, Text, Operator, Keyword, Name, Number | ||
20 | from pygments.token import Comment, Token, _TokenType | ||
21 | from pygments.token import * | ||
22 | from pygments.lexer import RegexLexer, bygroups, include | ||
23 | from pygments.formatters import HtmlFormatter | ||
24 | |||
25 | from docutils import nodes | ||
26 | from docutils.nodes import Element, Node | ||
27 | |||
28 | from sphinx.roles import XRefRole | ||
29 | from sphinx.domains import Domain, ObjType, Index | ||
30 | from sphinx.directives import directives | ||
31 | from sphinx.util.docutils import SphinxDirective | ||
32 | from sphinx.util.nodes import make_refnode | ||
33 | from sphinx.util import logging | ||
34 | from sphinx.highlighting import PygmentsBridge | ||
35 | from sphinx.builders.html import StandaloneHTMLBuilder | ||
36 | from sphinx.pygments_styles import SphinxStyle | ||
37 | |||
38 | logger = logging.getLogger(__name__) | ||
39 | |||
40 | |||
41 | class 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 | |||
120 | class 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 | |||
185 | class 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. | ||
304 | token_props = {} | ||
305 | |||
306 | |||
307 | class 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"&", | ||
363 | ord("<"): u"<", | ||
364 | ord(">"): u">", | ||
365 | ord('"'): u""", | ||
366 | ord("'"): u"'", | ||
367 | } | ||
368 | |||
369 | |||
370 | class 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 | |||
498 | class 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 | |||
528 | class 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 | |||
542 | def get_annotation(tok, key): | ||
543 | if not hasattr(tok, "kv"): | ||
544 | return None | ||
545 | return tok.kv.get(key) | ||
546 | |||
547 | |||
548 | def 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 | |||
556 | def 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 | |||
565 | def 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 | |||
574 | link_reg = re.compile(r"(?<!`)`([^`<]+)\s*(?:<([^>]+)>)?\s*`_?") | ||
575 | literal_reg = re.compile(r"``([^`]+)``") | ||
576 | |||
577 | |||
578 | def 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 @@ | |||
1 | div.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 @@ | |||
1 | About GANA | ||
2 | ========== | ||
3 | |||
4 | The GNUnet Assigned Numbers Authority (GANA) contains various registries | ||
5 | we maintain, for GNUnet other projects that need names and numbers for | ||
6 | use in network protocols. If you need to open a new registry, please | ||
7 | feel free to contact us at gana@gnunet.org. | ||
8 | |||
9 | The registry sources can be found here: https://git.gnunet.org/gana.git | ||
10 | |||
11 | History | ||
12 | ------- | ||
13 | |||
14 | Barry Leiba `wrote on April 4th 2020 <https://datatracker.ietf.org/doc/conflict-review-dold-payto/ballot/>`_ that “Neither IANA nor participants | ||
15 | in the IETF will have any necessary expertise to evaluate registration | ||
16 | requests in the sort of registry described, and no one will be well | ||
17 | served by the creation of such a registry at IANA. It would be far | ||
18 | better to have a registration process be described in this document | ||
19 | involving experts from the industry as reviewers and maintenance of the | ||
20 | registrations by an industry organization, rather than by IANA.” | ||
21 | |||
22 | So here we are. As IETF/IANA “lack the necessary expertise to operate a | ||
23 | registry” for names and numbers used in network protocols, the GNUnet | ||
24 | project is happy to step up. | ||
25 | |||
26 | License | ||
27 | ------- | ||
28 | |||
29 | The GANA database is licensed under the GPL. See ``COPYING`` in the Git | ||
30 | repository. | ||
31 | |||
32 | Design | ||
33 | ------ | ||
34 | |||
35 | Each registry must have a unique name and all associated information | ||
36 | lives in a directory under that unique name in the Git repository. | ||
37 | |||
38 | Each 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``). | ||
@@ -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 ----------------------------------------------------- | ||
19 | import sys | ||
20 | import os | ||
21 | |||
22 | project = 'GANA' | ||
23 | copyright = '2024, GNUnet Project' | ||
24 | author = 'GNUnet Project' | ||
25 | |||
26 | sys.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. | ||
33 | extensions = [ | ||
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. | ||
48 | templates_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. | ||
53 | exclude_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 | # | ||
61 | html_theme = 'sphinx_rtd_theme' | ||
62 | |||
63 | html_sidebars = { | ||
64 | #"**": ["navbar-logo.html", "sbt-sidebar-nav.html", "search-field.html"] | ||
65 | "**": ["search-field.html", "sbt-sidebar-nav.html"] | ||
66 | } | ||
67 | |||
68 | html_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". | ||
92 | html_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 | |||
100 | html_logo = "images/gnunet-blue.png" | ||
101 | |||
102 | # Display to-do items in docs | ||
103 | todo_include_todos = True | ||
104 | |||
105 | primary_domain = "c" | ||
106 | |||
107 | highlight_language = "c" | ||
108 | |||
109 | rst_prolog = f""" | ||
110 | .. role:: c(code) | ||
111 | :language: c | ||
112 | |||
113 | .. role:: bolditalic | ||
114 | :class: bolditalic | ||
115 | """ | ||
116 | |||
117 | rst_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 @@ | |||
1 | FILES=dot_alt.rst | ||
2 | all: check $(FILES) | ||
3 | |||
4 | check: | ||
5 | recfix --check registry.rec | ||
6 | |||
7 | distclean: | ||
8 | |||
9 | rm -f *.tmp | ||
10 | clean: | ||
11 | rm -f $(FILES) *.tmp | ||
12 | |||
13 | dot_alt.rst.tmp: registry.rec rst.template | ||
14 | ../format.sh rst.template < registry.rec > $@ | ||
15 | |||
16 | rst.header.tmp: | ||
17 | cat README POLICY rst.header.template > $@ | ||
18 | |||
19 | dot_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 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | The "Label" must be unique in the entire registry. The value must be a | ||
5 | case insensitive `LDH label <https://www.rfc-editor.org/rfc/rfc5890#section-2.3.1>`__ | ||
6 | following the restrictions on DNS names. | ||
7 | |||
8 | Adding records can be done on a first-come first-served basis after GANA | ||
9 | committer review. | ||
10 | |||
11 | The current contact(s) for review are reachable at | ||
12 | alt-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 | |||
4 | This 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 | |||
6 | This registry is used to ensure that names of alternative name systems | ||
7 | do 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 | |||
18 | Label: gns | ||
19 | UnicodeLabel: gns | ||
20 | Contact: Martin Schanzenbach <schanzen@gnunet.org> | ||
21 | References: RFC 9498 | ||
22 | Description: The .alt subdomain for GNS | ||
23 | |||
24 | Label: i2p | ||
25 | UnicodeLabel: i2p | ||
26 | Contact: zzz <zzz AT i2pmail DOT org> | ||
27 | References: https://geti2p.net/en/docs/naming | ||
28 | Description: I2P is a P2P network implementing its own name resolution mechanism | ||
29 | |||
30 | # Unreserved unicode example | ||
31 | Label: xn--fsq | ||
32 | UnicodeLabel: 例 | ||
33 | Contact: Martin Schanzenbach <schanzen@gnunet.org> | ||
34 | References: None | ||
35 | Description: 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 @@ | |||
1 | Entries | ||
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}} | ||
@@ -12,7 +12,8 @@ | |||
12 | ## | 12 | ## |
13 | me=$(basename $0) | 13 | me=$(basename $0) |
14 | 14 | ||
15 | version='1.3' | 15 | version='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 @@ | |||
1 | FILES=gnu_name_system_protocols.h gnu_name_system_protocols.rst | ||
2 | all: check $(FILES) | ||
3 | |||
4 | check: | ||
5 | recfix --check registry.rec | ||
6 | |||
7 | distclean: | ||
8 | rm -f *.tmp | ||
9 | clean: | ||
10 | rm -f $(FILES) *.tmp | ||
11 | |||
12 | gnu_name_system_protocols.h.tmp: registry.rec h.template | ||
13 | ../format.sh h.template < registry.rec > $@ | ||
14 | |||
15 | gnu_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 | |||
18 | gnu_name_system_protocols.rst.tmp: registry.rec rst.template | ||
19 | ../format.sh rst.template < registry.rec > $@ | ||
20 | |||
21 | rst.header.tmp: | ||
22 | cat README POLICY rst.header.template > $@ | ||
23 | |||
24 | gnu_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 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | Each registry entry should contain three values: the port "Number" of the | ||
5 | protocol, which must be above 255, | ||
6 | the "Name" of the protocol, and a "Reference" with links | ||
7 | to further information about the record type. | ||
8 | |||
9 | The "Name" must be unique in the entire registry. The value must be a | ||
10 | case insensitive ASCII string and is restricted to alphanumeric | ||
11 | characters. | ||
12 | |||
13 | Adding protocols is possible after expert review, using a | ||
14 | first-come-first-served policy for unique "Name" allocation. | ||
15 | Experts are responsible to ensure that the chosen "Name" is | ||
16 | appropriate for the record type. | ||
17 | |||
18 | The current contact(s) for expert review are reachable at | ||
19 | gns-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 @@ | |||
1 | GNS Protocol Numbers | ||
2 | -------------------- | ||
3 | |||
4 | This registry is for protocol number mappings for GNS names that are BOXed. | ||
5 | |||
6 | Some "_"-labels map to protocol numbers, but others do not. | ||
7 | For 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 | |||
7 | uint16_t | ||
8 | GNUNET_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 | |||
21 | const char* | ||
22 | GNUNET_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 | ||
33 | extern "C" { | ||
34 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
35 | } | ||
36 | #endif | ||
37 | #endif | ||
38 | |||
39 | struct GNUNET_GNS_Protocol | ||
40 | { | ||
41 | const char *name; | ||
42 | |||
43 | uint16_t number; | ||
44 | }; | ||
45 | |||
46 | struct 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 | |||
19 | Number: 49152 | ||
20 | Name: trust | ||
21 | Comment: LIGHTest trust policy scheme | ||
22 | References: 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 @@ | |||
1 | Entries | ||
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 @@ | |||
1 | FILES=gnu_name_system_service_ports.h gnu_name_system_service_ports.rst | ||
2 | all: check $(FILES) | ||
3 | |||
4 | check: | ||
5 | recfix --check registry.rec | ||
6 | |||
7 | distclean: | ||
8 | rm -f *.tmp | ||
9 | clean: | ||
10 | rm -f $(FILES) *.tmp | ||
11 | |||
12 | gnu_name_system_service_ports.h.tmp: registry.rec h.template | ||
13 | ../format.sh h.template < registry.rec > $@ | ||
14 | |||
15 | gnu_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 | |||
18 | gnu_name_system_service_ports.rst.tmp: registry.rec rst.template | ||
19 | ../format.sh rst.template < registry.rec > $@ | ||
20 | |||
21 | rst.header.tmp: | ||
22 | cat README POLICY rst.header.template > $@ | ||
23 | |||
24 | gnu_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 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | Each registry entry should contain three values: the port "Number" of the | ||
5 | service, which must be above 49151 (private/dynamic port range), | ||
6 | the "Name" of the service, and a "Reference" with links | ||
7 | to further information about the record type. | ||
8 | |||
9 | The "Name" must be unique in the entire registry. The value must be a | ||
10 | case insensitive ASCII string and is restricted to alphanumeric | ||
11 | characters. | ||
12 | |||
13 | Adding records is possible after expert review, using a | ||
14 | first-come-first-served policy for unique "Name" allocation. | ||
15 | Experts are responsible to ensure that the chosen "Name" is | ||
16 | appropriate for the record type. | ||
17 | |||
18 | The current contact(s) for expert review are reachable at | ||
19 | gns-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 @@ | |||
1 | GNS Service Ports | ||
2 | ----------------- | ||
3 | |||
4 | This registry is for service-to-port mappings for GNS names that are BOXed. | ||
5 | |||
6 | Some "_"-labels map to service ports (RFC 6335), but others do not. | ||
7 | For 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 | |||
7 | uint16_t | ||
8 | GNUNET_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 | |||
21 | const char* | ||
22 | GNUNET_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 | ||
33 | extern "C" { | ||
34 | #if 0 /* keep Emacsens' auto-indent happy */ | ||
35 | } | ||
36 | #endif | ||
37 | #endif | ||
38 | |||
39 | struct GNUNET_GNS_ServicePort | ||
40 | { | ||
41 | const char *name; | ||
42 | |||
43 | uint16_t port; | ||
44 | }; | ||
45 | |||
46 | struct 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 | |||
19 | Number: 49152 | ||
20 | Name: scheme | ||
21 | Comment: Used by Trust Scheme Authorities to publish information about Trust Schemes (LIGHTest) | ||
22 | References: TODO | ||
23 | |||
24 | Number: 49153 | ||
25 | Name: translation | ||
26 | Comment: Used Trust Translation Authorities to publish information about Trust Translations (LIGHTest) | ||
27 | References: 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 @@ | |||
1 | Entries | ||
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 @@ | |||
1 | FILES=tlds.conf | 1 | FILES=tlds.conf tlds.rst |
2 | all: check $(FILES) | 2 | all: check $(FILES) |
3 | 3 | ||
4 | check: | 4 | check: |
@@ -16,4 +16,14 @@ tlds.conf.tmp: registry.rec tlds.template | |||
16 | tlds.conf: tlds.header tlds.conf.tmp | 16 | tlds.conf: tlds.header tlds.conf.tmp |
17 | cat tlds.header tlds.conf.tmp > $@ | 17 | cat tlds.header tlds.conf.tmp > $@ |
18 | 18 | ||
19 | tlds.rst.tmp: registry.rec rst.template | ||
20 | ../format.sh rst.template < registry.rec > $@ | ||
21 | |||
22 | rst.header.tmp: | ||
23 | cat README POLICY rst.header.template > $@ | ||
24 | |||
25 | tlds.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 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
1 | Each registry entry should contain three values: the "Key" of the | 4 | Each registry entry should contain three values: the "Key" of the |
2 | authoritative zone of a TLD, the "Name" of the TLDS, an optional | 5 | authoritative 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 | ||
12 | The current contact(s) for expert review are reachable at | 15 | The current contact(s) for expert review are reachable at |
13 | gns-registry@gnunet.org. | 16 | gns-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 @@ | |||
1 | GNS Default Top-Level-Domains | ||
2 | ----------------------------- | ||
3 | |||
1 | This registry is the default Top-Level-Domains (TLDs) for the GNU Name System. | 4 | This registry is the default Top-Level-Domains (TLDs) for the GNU Name System. |
2 | 5 | ||
3 | This registry is used to ensure that GNS resolvers ship with a default | 6 | This registry is used to ensure that GNS resolvers ship with a default |
4 | configuration of TLDs in order to ease transition and enable instant use. | 7 | configuration 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 | ||
20 | Name: pin | 20 | Name: pin.gns.alt |
21 | Key: 000G001MF6DVMZZ4Y8XRZQDXM1PB3D3VGEK29ZHXBA57EPSNW1QBPKT8J0 | 21 | Key: 000G0522TTKQESZ9KPRT2K0RA9ZC8YMD52D2XYVYVGPDCNPMWHH9QXXF4W |
22 | Comment: The FCFS authority managed by GNUnet e.V. | 22 | Comment: The FCFS authority managed by GNUnet e.V. |
23 | |||
24 | Name: gnunet.gns.alt | ||
25 | Key: 000G0522TTKQESZ9KPRT2K0RA9ZC8YMD52D2XYVYVGPDCNPMWHH9QXXF4W | ||
26 | Comment: 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 @@ | |||
1 | Entries | ||
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 @@ | |||
1 | FILES=gnu_name_system_record_flags.h gnu_name_system_record_flags.rst | ||
2 | all: check $(FILES) | ||
3 | |||
4 | check: | ||
5 | recfix --check registry.rec | ||
6 | |||
7 | distclean: | ||
8 | rm -f *.tmp | ||
9 | clean: | ||
10 | rm -f $(FILES) *.tmp | ||
11 | |||
12 | gnu_name_system_record_flags.h.tmp: registry.rec h.template | ||
13 | ../format.sh h.template < registry.rec > $@ | ||
14 | |||
15 | gnu_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 | |||
18 | gnu_name_system_record_flags.rst.tmp: registry.rec rst.template | ||
19 | ../format.sh rst.template < registry.rec > $@ | ||
20 | |||
21 | rst.header.tmp: | ||
22 | cat README POLICY rst.header.template > $@ | ||
23 | |||
24 | gnu_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 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | Each registry entry should contain three values: the "Number" of the | ||
5 | record flags, which must be between 0 and 15, | ||
6 | the "Name" of the record flag, and a "Reference" with links | ||
7 | to further information about the record flag. | ||
8 | |||
9 | The "Name" must be unique in the entire registry. The value must be a | ||
10 | case insensitive ASCII string and is restricted to alphanumeric | ||
11 | characters. | ||
12 | |||
13 | Adding flags is possible after expert review, using a | ||
14 | first-come-first-served policy for unique "Name" allocation. | ||
15 | Experts are responsible to ensure that the chosen "Name" is | ||
16 | appropriate for the record flag. | ||
17 | |||
18 | The current contact(s) for expert review are reachable at | ||
19 | gns-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 @@ | |||
1 | GNS Record Flags | ||
2 | ---------------- | ||
3 | |||
4 | This registry is for GNU Name System Record Flags. | ||
5 | |||
6 | GNU Name System Record flags uniquely identify the different kinds | ||
7 | of key-value pairs that can be used as flags of a GNU Name System record. | ||
8 | |||
9 | This registry is used to ensure that the names and numeric values | ||
10 | used to identify record flags are uniquely defined and to | ||
11 | allow GNS resolvers implementors to find out details about the | ||
12 | respective 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 | */ | ||
44 | enum 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 | |||
20 | Number: 15 | ||
21 | Name: CRITICAL | ||
22 | Comment: This record is critical. If it cannot be processed (for example because the record type is unknown) resolution MUST fail | ||
23 | References: https://lsd.gnunet.org/lsd0001 | ||
24 | |||
25 | Number: 14 | ||
26 | Name: SHADOW | ||
27 | Comment: This record should not be used unless all (other) records in the set with an absolute expiration time have expired. | ||
28 | References: https://lsd.gnunet.org/lsd0001 | ||
29 | |||
30 | Number: 13 | ||
31 | Name: SUPPLEMENTAL | ||
32 | Comment: This is a supplemental record. | ||
33 | References: https://lsd.gnunet.org/lsd0001 | ||
34 | |||
35 | Number: 1 | ||
36 | Name: RELATIVE_EXPIRATION | ||
37 | Comment: This expiration time of the record is a relative time (not an absolute time). Used in GNUnet implementation. | ||
38 | References: https://git.gnunet.org/gnunet.git | ||
39 | |||
40 | Number: 0 | ||
41 | Name: PRIVATE | ||
42 | Comment: This is a private record of this peer and it should thus not be published. | ||
43 | References: 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 @@ | |||
1 | Entries | ||
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 @@ | |||
1 | FILES=gnu_name_system_record_types.h | 1 | FILES=gnu_name_system_record_types.h gnu_name_system_record_types.rst |
2 | all: check $(FILES) | 2 | all: check $(FILES) |
3 | 3 | ||
4 | check: | 4 | check: |
@@ -15,4 +15,14 @@ gnu_name_system_record_types.h.tmp: registry.rec h.template | |||
15 | gnu_name_system_record_types.h: h.header gnu_name_system_record_types.h.tmp h.footer | 15 | gnu_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 | ||
18 | gnu_name_system_record_types.rst.tmp: registry.rec rst.template | ||
19 | ../format.sh rst.template < registry.rec > $@ | ||
20 | |||
21 | rst.header.tmp: | ||
22 | cat README POLICY rst.header.template > $@ | ||
23 | |||
24 | gnu_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 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
1 | Each registry entry should contain three values: the "Number" of the | 4 | Each registry entry should contain three values: the "Number" of the |
2 | record type, which must be above 65535 (to avoid conflicts with legacy | 5 | record type, which must be above 65535 (to avoid conflicts with legacy |
3 | DNS record types), the "Name" of the record type, and a "Reference" with links | 6 | DNS 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. | |||
12 | Experts are responsible to ensure that the chosen "Name" is | 15 | Experts are responsible to ensure that the chosen "Name" is |
13 | appropriate for the record type. | 16 | appropriate for the record type. |
14 | 17 | ||
18 | Numbers above 0xFFFF0000 non-exclusively indicate record types for private use. | ||
19 | |||
15 | The current contact(s) for expert review are reachable at | 20 | The current contact(s) for expert review are reachable at |
16 | gns-registry@gnunet.org. | 21 | gns-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 @@ | |||
1 | GNS Record Types | ||
2 | ---------------- | ||
3 | |||
1 | This registry is for GNU Name System Record Types. | 4 | This registry is for GNU Name System Record Types. |
2 | 5 | ||
3 | GNU Name System Record types uniquely identify the different kinds | 6 | GNU 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 | |||
7 | used to identify record types are uniquely defined and to | 10 | used to identify record types are uniquely defined and to |
8 | allow GNS resolvers implementors to find out details about the | 11 | allow GNS resolvers implementors to find out details about the |
9 | respective semantics and human-readable syntax. | 12 | respective 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 | ||
19 | Number: 65536 | 19 | Number: 65536 |
20 | Name: PKEY | 20 | Name: PKEY |
21 | Comment: GNS zone transfer | 21 | Comment: GNS zone delegation (PKEY) |
22 | References: LSD0001 | 22 | References: RFC 9498 |
23 | 23 | ||
24 | Number: 65537 | 24 | Number: 65537 |
25 | Name: NICK | 25 | Name: NICK |
26 | Comment: GNS nick names | 26 | Comment: GNS zone nickname |
27 | References: LSD0001 | 27 | References: RFC 9498 |
28 | 28 | ||
29 | Number: 65538 | 29 | Number: 65538 |
30 | Name: LEHO | 30 | Name: LEHO |
31 | Comment: legacy hostnames | 31 | Comment: GNS legacy hostname |
32 | References: LSD0001 | 32 | References: RFC 9498 |
33 | 33 | ||
34 | Number: 65539 | 34 | Number: 65539 |
35 | Name: VPN | 35 | Name: VPN |
36 | Comment: VPN resolution | 36 | Comment: VPN resolution |
37 | References: LSD0001 | 37 | References: |
38 | 38 | ||
39 | Number: 65540 | 39 | Number: 65540 |
40 | Name: GNS2DNS | 40 | Name: GNS2DNS |
41 | Comment: Delegation to DNS | 41 | Comment: Delegation to DNS |
42 | References: LSD0001 | 42 | References: RFC 9498 |
43 | 43 | ||
44 | Number: 65541 | 44 | Number: 65541 |
45 | Name: BOX | 45 | Name: BOX |
46 | Comment: Boxed records (see TLSA/SRV handling in GNS) | 46 | Comment: Box record |
47 | References: LSD0001 | 47 | References: RFC 9498 |
48 | 48 | ||
49 | Number: 65542 | 49 | Number: 65542 |
50 | Name: PLACE | 50 | Name: PLACE |
@@ -66,6 +66,12 @@ Name: RECLAIM_TICKET | |||
66 | Comment: local ticket reference | 66 | Comment: local ticket reference |
67 | Contact: schanzen@gnunet.org | 67 | Contact: schanzen@gnunet.org |
68 | 68 | ||
69 | Number: 65547 | ||
70 | Name: SBOX | ||
71 | Comment: SBox record | ||
72 | Contact: sebastian.nadler@tum.de | ||
73 | References: LSD 0008 | ||
74 | |||
69 | Number: 65548 | 75 | Number: 65548 |
70 | Name: DELEGATE | 76 | Name: DELEGATE |
71 | Comment: For ABD policies | 77 | Comment: For ABD policies |
@@ -83,8 +89,8 @@ Contact: schanzen@gnunet.org | |||
83 | 89 | ||
84 | Number: 65551 | 90 | Number: 65551 |
85 | Name: REDIRECT | 91 | Name: REDIRECT |
86 | Comment: Resolver redirects | 92 | Comment: Redirection record |
87 | Contact: LSD0001 | 93 | Contact: RFC 9498 |
88 | 94 | ||
89 | Number: 65552 | 95 | Number: 65552 |
90 | Name: RECLAIM_OIDC_CLIENT | 96 | Name: RECLAIM_OIDC_CLIENT |
@@ -109,7 +115,7 @@ Contact: schanzen@gnunet.org | |||
109 | 115 | ||
110 | Number: 65556 | 116 | Number: 65556 |
111 | Name: EDKEY | 117 | Name: EDKEY |
112 | Comment: Record type for EDKEY zone delegations. | 118 | Comment: GNS zone delegation (EDKEY) |
113 | 119 | ||
114 | Number: 65557 | 120 | Number: 65557 |
115 | Name: ERIS_READ_CAPABILITY | 121 | Name: ERIS_READ_CAPABILITY |
@@ -130,3 +136,14 @@ Number: 65560 | |||
130 | Name: MESSENGER_ROOM_DETAILS | 136 | Name: MESSENGER_ROOM_DETAILS |
131 | Comment: Record type to store details about a messenger room | 137 | Comment: Record type to store details about a messenger room |
132 | Contact: thejackimonster@gmail.com | 138 | Contact: thejackimonster@gmail.com |
139 | |||
140 | Number: 65561 | ||
141 | Name: DID_DOCUMENT | ||
142 | Comment: Record type to store DID Documents | ||
143 | Contact: schanzen@gnunet.orgNumber: 65561 | ||
144 | |||
145 | # Private range started from 0xFFFF0000 | ||
146 | Number: 4294901760 | ||
147 | Name: GNS_REGISTRAR_METADATA | ||
148 | Comment: Private metadata for a delegation registration | ||
149 | Contact: 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 @@ | |||
1 | Entries | ||
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 @@ | |||
1 | FILES=taler_dbevents.h | 1 | FILES=taler_dbevents.h taler_dbevents.rst |
2 | 2 | ||
3 | all: check $(FILES) | 3 | all: check $(FILES) |
4 | 4 | ||
@@ -17,4 +17,10 @@ taler_dbevents.h.tmp: registry.rec h.template | |||
17 | taler_dbevents.h: h.header taler_dbevents.h.tmp h.footer | 17 | taler_dbevents.h: h.header taler_dbevents.h.tmp h.footer |
18 | cat $^ > $@ | 18 | cat $^ > $@ |
19 | 19 | ||
20 | taler_dbevents.rst.tmp: registry.rec rst.template | ||
21 | ../format.sh rst.template < registry.rec > $@ | ||
22 | |||
23 | taler_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 | |||
48 | Name: EXCHANGE_PURSE_DEPOSITED | 48 | Name: EXCHANGE_PURSE_DEPOSITED |
49 | Description: Event triggered when coins are deposited into a purse. | 49 | Description: Event triggered when coins are deposited into a purse. |
50 | 50 | ||
51 | Value: 1007 | ||
52 | Name: EXCHANGE_DEPOSIT_STATUS_CHANGED | ||
53 | Description: Event triggered when the tracking status for a deposit has changed. | ||
54 | |||
55 | Value: 1008 | ||
56 | Name: EXCHANGE_PURSE_REFUNDED | ||
57 | Description: Event triggered when any purse was refunded. | ||
58 | |||
59 | |||
51 | # 1100-1199: For Taler Merchant | 60 | # 1100-1199: For Taler Merchant |
52 | 61 | ||
53 | Value: 1100 | 62 | Value: 1100 |
@@ -74,9 +83,66 @@ Value: 1105 | |||
74 | Name: MERCHANT_ORDERS_CHANGE | 83 | Name: MERCHANT_ORDERS_CHANGE |
75 | Description: Event triggered when the set of orders or their state changes. | 84 | Description: Event triggered when the set of orders or their state changes. |
76 | 85 | ||
86 | Value: 1106 | ||
87 | Name: MERCHANT_WEBHOOK_PENDING | ||
88 | Description: Event triggered when a new pending webhook is ready to be run. | ||
89 | |||
90 | Value: 1107 | ||
91 | Name: MERCHANT_REWARD_PICKUP | ||
92 | Description: Event triggered when a reward is being picked up. | ||
93 | |||
94 | Value: 1108 | ||
95 | Name: MERCHANT_WIRE_TRANSFER_CONFIRMED | ||
96 | Description: Event triggered when a wire transfer is confirmed. Triggers interaction with the exchange to download details about which payments were aggregated. | ||
97 | |||
98 | Value: 1109 | ||
99 | Name: MERCHANT_ACCOUNTS_CHANGED | ||
100 | Description: Event triggered when the set of accounts has changed. Triggers restart of taler-merchant-wirewatch. | ||
101 | |||
102 | Value: 1110 | ||
103 | Name: MERCHANT_EXCHANGE_KEYS | ||
104 | Description: Event triggered when we downloaded "/keys" from an exchange and stored it in the database. Extra argument must be the exchange base URL. | ||
105 | |||
106 | Value: 1111 | ||
107 | Name: MERCHANT_NEW_WIRE_DEADLINE | ||
108 | Description: 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 | ||
112 | Value: 1200 | ||
113 | Name: EXCHANGE_AUDITOR_NEW_DEPOSIT_CONFIRMATION | ||
114 | Description: 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 | ||
80 | Value: 2000 | 120 | Value: 2000 |
81 | Name: ANASTASIS_AUTH_IBAN_TRANSFER | 121 | Name: ANASTASIS_AUTH_IBAN_TRANSFER |
82 | Description: A wire transfer from the target account with the correct wire transfer subject was received. | 122 | Description: A wire transfer from the target account with the correct wire transfer subject was received. |
123 | |||
124 | # 3000-3099: For Libeufin | ||
125 | |||
126 | Value: 3000 | ||
127 | Name: LIBEUFIN_TALER_INCOMING | ||
128 | Description: 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. | ||
133 | Value: 3001 | ||
134 | Name: LIBEUFIN_REGIO_TX | ||
135 | Description: 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. | ||
140 | Value: 3002 | ||
141 | Name: LIBEUFIN_SANDBOX_FIAT_INCOMING | ||
142 | Description: 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. | ||
146 | Value: 3003 | ||
147 | Name: LIBEUFIN_NEXUS_TX | ||
148 | Description: 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 @@ | |||
1 | Taler DB Events | ||
2 | --------------- | ||
3 | |||
4 | Entries | ||
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 |
6 | taler_error_codes.py | 6 | taler_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 | ||
7 | all: check $(FILES) | 9 | all: 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. |
25 | combined.tmp: registry.rec prep | 27 | combined.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 | ||
29 | combined-escaped.tmp: combined.tmp | 31 | combined-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 | ||
38 | taler_error_codes.h: h.header taler_error_codes.h.tmp h.footer | 40 | taler_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 | ||
41 | taler_error_codes.c.tmp: combined-escaped.tmp c.template | 43 | taler_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 | ||
53 | taler_error_codes.ts: ts.header taler_error_codes.ts.tmp ts.footer | 55 | taler_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 | ||
56 | taler_error_codes.kt.tmp: combined.tmp kt.template | 58 | taler_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 | |||
62 | taler_error_codes.py.tmp: combined.tmp py.template | 64 | taler_error_codes.py.tmp: combined.tmp py.template |
63 | ../format.sh py.template < combined.tmp > $@ | 65 | ../format.sh py.template < combined.tmp > $@ |
64 | 66 | ||
65 | taler_error_codes.py: py.header taler_error_codes.py.tmp | 67 | taler_error_codes.py: py.header taler_error_codes.py.tmp |
66 | cat $^ > $@ | 68 | cat $^ > $@ |
67 | 69 | ||
70 | taler_error_codes.go.tmp: combined.tmp go.template | ||
71 | ../format.sh go.template < combined.tmp > $@ | ||
72 | |||
73 | taler_error_codes.go: go.header taler_error_codes.go.tmp go.footer | ||
74 | cat $^ > $@ | ||
75 | |||
76 | taler_error_codes.rst.tmp: combined.tmp rst.template | ||
77 | ../format.sh rst.template < combined.tmp > $@ | ||
78 | |||
79 | taler_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 | |||
24 | package gana | ||
25 | |||
26 | const ( | ||
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 fe8d7c4..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 | ||
25 | Value: 0 | 28 | Value: 0000 |
26 | Name: NONE | 29 | Name: NONE |
27 | Description: Special code to indicate success (no error). | 30 | Description: Special code to indicate success (no error). |
28 | HttpStatus: 0 | 31 | HttpStatus: 0 |
29 | 32 | ||
30 | # We could not get the error code. | 33 | # We could not get the error code. |
31 | 34 | Value: 0001 | |
32 | Value: 1 | ||
33 | Name: INVALID | 35 | Name: INVALID |
34 | Description: A non-integer error code was returned in the JSON response. | 36 | Description: 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. |
35 | HttpStatus: 0 | 37 | HttpStatus: 0 |
36 | 38 | ||
37 | Value: 2 | 39 | Value: 0002 |
38 | Name: GENERIC_CLIENT_INTERNAL_ERROR | 40 | Name: GENERIC_CLIENT_INTERNAL_ERROR |
39 | Description: An internal failure happened on the client side. | 41 | Description: 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. |
40 | HttpStatus: 0 | 42 | HttpStatus: 0 |
41 | 43 | ||
42 | # Fundamental problems detected client-side (10-19) | 44 | # Fundamental problems detected client-side (10-19) |
43 | 45 | ||
44 | Value: 10 | 46 | Value: 0010 |
45 | Name: GENERIC_INVALID_RESPONSE | 47 | Name: GENERIC_INVALID_RESPONSE |
46 | Description: The response we got from the server was not even in JSON format. | 48 | Description: 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. |
47 | HttpStatus: 0 | 49 | HttpStatus: 0 |
48 | 50 | ||
49 | Value: 11 | 51 | Value: 0011 |
50 | Name: GENERIC_TIMEOUT | 52 | Name: GENERIC_TIMEOUT |
51 | Description: An operation timed out. | 53 | Description: The operation timed out. Trying again might help. Check the network connection. |
52 | HttpStatus: 0 | 54 | HttpStatus: 0 |
53 | 55 | ||
54 | Value: 12 | 56 | Value: 0012 |
55 | Name: GENERIC_VERSION_MALFORMED | 57 | Name: GENERIC_VERSION_MALFORMED |
56 | Description: The version string given does not follow the expected CURRENT:REVISION:AGE Format. | 58 | Description: 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. |
57 | HttpStatus: 0 | 59 | HttpStatus: 0 |
58 | 60 | ||
59 | Value: 13 | 61 | Value: 0013 |
60 | Name: GENERIC_REPLY_MALFORMED | 62 | Name: GENERIC_REPLY_MALFORMED |
61 | Description: 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. | 63 | Description: 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. |
62 | HttpStatus: 0 | 64 | HttpStatus: 0 |
63 | 65 | ||
64 | Value: 14 | 66 | Value: 0014 |
65 | Name: GENERIC_CONFIGURATION_INVALID | 67 | Name: GENERIC_CONFIGURATION_INVALID |
66 | Description: There is an error in the client-side configuration, for example the base URL specified is malformed. | 68 | Description: 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. |
67 | HttpStatus: 0 | 69 | HttpStatus: 0 |
68 | 70 | ||
69 | Value: 15 | 71 | Value: 0015 |
70 | Name: GENERIC_UNEXPECTED_REQUEST_ERROR | 72 | Name: GENERIC_UNEXPECTED_REQUEST_ERROR |
71 | Description: The client made a request to a service, but received an error response it does not know how to handle. | 73 | Description: 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. |
72 | HttpStatus: 0 | 74 | HttpStatus: 0 |
73 | 75 | ||
76 | Value: 0016 | ||
77 | Name: GENERIC_TOKEN_PERMISSION_INSUFFICIENT | ||
78 | Description: 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. | ||
79 | HttpStatus: 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 | ||
77 | Value: 20 | 84 | Value: 0020 |
78 | Name: GENERIC_METHOD_INVALID | 85 | Name: GENERIC_METHOD_INVALID |
79 | Description: The HTTP method used is invalid for this endpoint. | 86 | Description: 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. |
80 | HttpStatus: 405 | 87 | HttpStatus: 405 |
81 | 88 | ||
82 | Value: 21 | 89 | Value: 0021 |
83 | Name: GENERIC_ENDPOINT_UNKNOWN | 90 | Name: GENERIC_ENDPOINT_UNKNOWN |
84 | Description: There is no endpoint defined for the URL provided by the client. | 91 | Description: 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. |
85 | HttpStatus: 404 | 92 | HttpStatus: 404 |
86 | 93 | ||
87 | Value: 22 | 94 | Value: 0022 |
88 | Name: GENERIC_JSON_INVALID | 95 | Name: GENERIC_JSON_INVALID |
89 | Description: The JSON in the client's request was malformed (generic parse error). | 96 | Description: 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. |
90 | HttpStatus: 400 | 97 | HttpStatus: 400 |
91 | 98 | ||
92 | Value: 23 | 99 | Value: 0023 |
93 | Name: GENERIC_HTTP_HEADERS_MALFORMED | 100 | Name: GENERIC_HTTP_HEADERS_MALFORMED |
94 | Description: Some of the HTTP headers provided by the client caused the server to not be able to handle the request. | 101 | Description: 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. |
95 | HttpStatus: 400 | 102 | HttpStatus: 400 |
96 | 103 | ||
97 | Value: 24 | 104 | Value: 0024 |
98 | Name: GENERIC_PAYTO_URI_MALFORMED | 105 | Name: GENERIC_PAYTO_URI_MALFORMED |
99 | Description: The payto:// URI provided by the client is malformed. | 106 | Description: 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. |
100 | HttpStatus: 400 | 107 | HttpStatus: 400 |
101 | 108 | ||
102 | Value: 25 | 109 | Value: 0025 |
103 | Name: GENERIC_PARAMETER_MISSING | 110 | Name: GENERIC_PARAMETER_MISSING |
104 | Description: A required parameter in the request was missing. | 111 | Description: 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. |
105 | HttpStatus: 400 | 112 | HttpStatus: 400 |
106 | 113 | ||
107 | Value: 26 | 114 | Value: 0026 |
108 | Name: GENERIC_PARAMETER_MALFORMED | 115 | Name: GENERIC_PARAMETER_MALFORMED |
109 | Description: A parameter in the request was malformed. | 116 | Description: 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. |
110 | HttpStatus: 400 | 117 | HttpStatus: 400 |
111 | 118 | ||
119 | Value: 0027 | ||
120 | Name: GENERIC_RESERVE_PUB_MALFORMED | ||
121 | Description: The reserve public key was malformed. | ||
122 | HttpStatus: 400 | ||
123 | FIXME: Fold with 26? | ||
124 | |||
125 | Value: 0028 | ||
126 | Name: GENERIC_COMPRESSION_INVALID | ||
127 | Description: 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. | ||
128 | HttpStatus: 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 | ||
116 | Value: 30 | 133 | Value: 0030 |
117 | Name: GENERIC_CURRENCY_MISMATCH | 134 | Name: GENERIC_CURRENCY_MISMATCH |
118 | Description: The currencies involved in the operation do not match. | 135 | Description: 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. |
119 | HttpStatus: 400 | 136 | HttpStatus: 400 |
120 | 137 | ||
121 | Value: 31 | 138 | Value: 0031 |
122 | Name: GENERIC_URI_TOO_LONG | 139 | Name: GENERIC_URI_TOO_LONG |
123 | Description: The URI is longer than the longest URI the HTTP server is willing to parse. | 140 | Description: 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. |
124 | HttpStatus: 414 | 141 | HttpStatus: 414 |
125 | 142 | ||
126 | Value: 32 | 143 | Value: 0032 |
127 | Name: GENERIC_UPLOAD_EXCEEDS_LIMIT | 144 | Name: GENERIC_UPLOAD_EXCEEDS_LIMIT |
128 | Description: The body is too large to be permissible for the endpoint. | 145 | Description: 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. |
129 | HttpStatus: 413 | 146 | HttpStatus: 413 |
130 | 147 | ||
131 | 148 | ||
132 | # 40-49: available for future use | 149 | # 40-49: access control issues |
150 | Value: 0040 | ||
151 | Name: GENERIC_UNAUTHORIZED | ||
152 | Description: The service refused the request due to lack of proper authorization. | ||
153 | HttpStatus: 401 | ||
154 | |||
155 | Value: 0041 | ||
156 | Name: GENERIC_TOKEN_UNKNOWN | ||
157 | Description: The service refused the request as the given authorization token is unknown. | ||
158 | HttpStatus: 401 | ||
159 | |||
160 | Value: 0042 | ||
161 | Name: GENERIC_TOKEN_EXPIRED | ||
162 | Description: The service refused the request as the given authorization token expired. | ||
163 | HttpStatus: 401 | ||
133 | 164 | ||
165 | Value: 0043 | ||
166 | Name: GENERIC_TOKEN_MALFORMED | ||
167 | Description: The service refused the request as the given authorization token is malformed. | ||
168 | HttpStatus: 401 | ||
134 | 169 | ||
170 | Value: 0044 | ||
171 | Name: GENERIC_FORBIDDEN | ||
172 | Description: The service refused the request due to lack of proper rights on the resource. | ||
173 | HttpStatus: 403 | ||
135 | 174 | ||
136 | # Server-side database problems (50-59) | 175 | # Server-side database problems (50-59) |
137 | 176 | ||
138 | Value: 50 | 177 | Value: 0050 |
139 | Name: GENERIC_DB_SETUP_FAILED | 178 | Name: GENERIC_DB_SETUP_FAILED |
140 | Description: The service failed initialize its connection to the database. | 179 | Description: 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. |
141 | HttpStatus: 500 | 180 | HttpStatus: 500 |
142 | 181 | ||
143 | Value: 51 | 182 | Value: 0051 |
144 | Name: GENERIC_DB_START_FAILED | 183 | Name: GENERIC_DB_START_FAILED |
145 | Description: The service encountered an error event to just start the database transaction. | 184 | Description: The service encountered an error event to just start the database transaction. The system administrator should check that the database is running. |
146 | HttpStatus: 500 | 185 | HttpStatus: 500 |
147 | 186 | ||
148 | Value: 52 | 187 | Value: 0052 |
149 | Name: GENERIC_DB_STORE_FAILED | 188 | Name: GENERIC_DB_STORE_FAILED |
150 | Description: The service failed to store information in its database. | 189 | Description: The service failed to store information in its database. The system administrator should check that the database is running and review the service logs. |
151 | HttpStatus: 500 | 190 | HttpStatus: 500 |
152 | 191 | ||
153 | Value: 53 | 192 | Value: 0053 |
154 | Name: GENERIC_DB_FETCH_FAILED | 193 | Name: GENERIC_DB_FETCH_FAILED |
155 | Description: The service failed to fetch information from its database. | 194 | Description: The service failed to fetch information from its database. The system administrator should check that the database is running and review the service logs. |
156 | HttpStatus: 500 | 195 | HttpStatus: 500 |
157 | 196 | ||
158 | Value: 54 | 197 | Value: 0054 |
159 | Name: GENERIC_DB_COMMIT_FAILED | 198 | Name: GENERIC_DB_COMMIT_FAILED |
160 | Description: The service encountered an error event to commit the database transaction (hard, unrecoverable error). | 199 | Description: 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. |
161 | HttpStatus: 500 | 200 | HttpStatus: 500 |
162 | 201 | ||
163 | Value: 55 | 202 | Value: 0055 |
164 | Name: GENERIC_DB_SOFT_FAILURE | 203 | Name: GENERIC_DB_SOFT_FAILURE |
165 | Description: 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.) | 204 | Description: 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. |
166 | HttpStatus: 500 | 205 | HttpStatus: 500 |
167 | 206 | ||
168 | Value: 56 | 207 | Value: 0056 |
169 | Name: GENERIC_DB_INVARIANT_FAILURE | 208 | Name: GENERIC_DB_INVARIANT_FAILURE |
170 | Description: The service's database is inconsistent and violates service-internal invariants. | 209 | Description: 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. |
171 | HttpStatus: 500 | 210 | HttpStatus: 500 |
172 | 211 | ||
173 | 212 | ||
174 | # Server-side computational problems (60-69) | 213 | # Server-side computational problems (60-69) |
175 | 214 | ||
176 | Value: 60 | 215 | Value: 0060 |
177 | Name: GENERIC_INTERNAL_INVARIANT_FAILURE | 216 | Name: GENERIC_INTERNAL_INVARIANT_FAILURE |
178 | Description: The HTTP server experienced an internal invariant failure (bug). | 217 | Description: 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. |
179 | HttpStatus: 500 | 218 | HttpStatus: 500 |
180 | 219 | ||
181 | Value: 61 | 220 | Value: 0061 |
182 | Name: GENERIC_FAILED_COMPUTE_JSON_HASH | 221 | Name: GENERIC_FAILED_COMPUTE_JSON_HASH |
183 | Description: The service could not compute a cryptographic hash over some JSON value. | 222 | Description: 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. |
184 | HttpStatus: 500 | 223 | HttpStatus: 500 |
185 | 224 | ||
186 | Value: 62 | 225 | Value: 0062 |
187 | Name: GENERIC_FAILED_COMPUTE_AMOUNT | 226 | Name: GENERIC_FAILED_COMPUTE_AMOUNT |
188 | Description: The service could not compute an amount. | 227 | Description: The service could not compute an amount. Check if you are using the latest available version and/or file a report with the developers. |
189 | HttpStatus: 500 | 228 | HttpStatus: 500 |
190 | 229 | ||
191 | 230 | ||
192 | # Server-side resource problems (70-79) | 231 | # Server-side resource problems (70-79) |
193 | 232 | ||
194 | Value: 70 | 233 | Value: 0070 |
195 | Name: GENERIC_PARSER_OUT_OF_MEMORY | 234 | Name: GENERIC_PARSER_OUT_OF_MEMORY |
196 | Description: The HTTP server had insufficient memory to parse the request. | 235 | Description: 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. |
197 | HttpStatus: 500 | 236 | HttpStatus: 500 |
198 | 237 | ||
199 | Value: 71 | 238 | Value: 0071 |
200 | Name: GENERIC_ALLOCATION_FAILURE | 239 | Name: GENERIC_ALLOCATION_FAILURE |
201 | Description: The HTTP server failed to allocate memory. | 240 | Description: 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. |
202 | HttpStatus: 500 | 241 | HttpStatus: 500 |
203 | 242 | ||
204 | Value: 72 | 243 | Value: 0072 |
205 | Name: GENERIC_JSON_ALLOCATION_FAILURE | 244 | Name: GENERIC_JSON_ALLOCATION_FAILURE |
206 | Description: The HTTP server failed to allocate memory for building JSON reply. | 245 | Description: 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. |
207 | HttpStatus: 500 | 246 | HttpStatus: 500 |
208 | 247 | ||
209 | Value: 73 | 248 | Value: 0073 |
210 | Name: GENERIC_CURL_ALLOCATION_FAILURE | 249 | Name: GENERIC_CURL_ALLOCATION_FAILURE |
211 | Description: The HTTP server failed to allocate memory for making a CURL request. | 250 | Description: 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. |
212 | HttpStatus: 500 | 251 | HttpStatus: 500 |
213 | 252 | ||
214 | # 80-99: available for future use | 253 | Value: 0074 |
254 | Name: GENERIC_FAILED_TO_LOAD_TEMPLATE | ||
255 | Description: 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. | ||
256 | HttpStatus: 500 | ||
257 | |||
258 | Value: 0075 | ||
259 | Name: GENERIC_FAILED_TO_EXPAND_TEMPLATE | ||
260 | Description: 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. | ||
261 | HttpStatus: 500 | ||
215 | 262 | ||
216 | 263 | ||
217 | 264 | ||
218 | # 100 - 999: VERBOTEN due to confusion with HTTP status codes (at least 100-599). | 265 | # 0080-0099: available for future use |
266 | |||
267 | |||
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 | |||
316 | HttpStatus: 400 | 367 | HttpStatus: 400 |
317 | 368 | ||
318 | Value: 1019 | 369 | Value: 1019 |
319 | Name: EXCHANGE_GENERIC_RESERVE_PUB_MALFORMED | 370 | Name: EXCHANGE_GENERIC_COIN_UNKNOWN |
320 | Description: The reserve public key was malformed. | 371 | Description: The coin is not known to the exchange (yet). |
321 | HttpStatus: 400 | 372 | HttpStatus: 404 |
322 | 373 | ||
323 | Value: 1020 | 374 | Value: 1020 |
324 | Name: EXCHANGE_GENERIC_CLOCK_SKEW | 375 | Name: EXCHANGE_GENERIC_CLOCK_SKEW |
@@ -365,6 +416,50 @@ Name: EXCHANGE_GENERIC_KYC_REQUIRED | |||
365 | Description: The exchange is not allowed to proceed with the operation until the client has satisfied a KYC check. | 416 | Description: The exchange is not allowed to proceed with the operation until the client has satisfied a KYC check. |
366 | HttpStatus: 451 | 417 | HttpStatus: 451 |
367 | 418 | ||
419 | Value: 1029 | ||
420 | Name: EXCHANGE_PURSE_DEPOSIT_COIN_CONFLICTING_ATTEST_VS_AGE_COMMITMENT | ||
421 | Description: Inconsistency between provided age commitment and attest: either none or both must be provided | ||
422 | HttpStatus: 400 | ||
423 | |||
424 | Value: 1030 | ||
425 | Name: EXCHANGE_PURSE_DEPOSIT_COIN_AGE_ATTESTATION_FAILURE | ||
426 | Description: The provided attestation for the minimum age couldn't be verified by the exchange. | ||
427 | HttpStatus: 400 | ||
428 | |||
429 | Value: 1031 | ||
430 | Name: EXCHANGE_GENERIC_PURSE_DELETED | ||
431 | Description: The purse was deleted. | ||
432 | HttpStatus: 410 | ||
433 | |||
434 | Value: 1032 | ||
435 | Name: EXCHANGE_GENERIC_AML_OFFICER_PUB_MALFORMED | ||
436 | Description: The public key of the AML officer in the URL was malformed. | ||
437 | HttpStatus: 400 | ||
438 | |||
439 | Value: 1033 | ||
440 | Name: EXCHANGE_GENERIC_AML_OFFICER_GET_SIGNATURE_INVALID | ||
441 | Description: The signature affirming the GET request of the AML officer is invalid. | ||
442 | HttpStatus: 403 | ||
443 | |||
444 | Value: 1034 | ||
445 | Name: EXCHANGE_GENERIC_AML_OFFICER_ACCESS_DENIED | ||
446 | Description: The specified AML officer does not have access at this time. | ||
447 | HttpStatus: 403 | ||
448 | |||
449 | Value: 1035 | ||
450 | Name: EXCHANGE_GENERIC_AML_PENDING | ||
451 | Description: 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. | ||
452 | HttpStatus: 451 | ||
453 | |||
454 | Value: 1036 | ||
455 | Name: EXCHANGE_GENERIC_AML_FROZEN | ||
456 | Description: The requested operation is denied as the account was frozen on suspicion of money laundering. Please contact the exchange operator. | ||
457 | HttpStatus: 451 | ||
458 | |||
459 | Value: 1037 | ||
460 | Name: EXCHANGE_GENERIC_KYC_CONVERTER_FAILED | ||
461 | Description: The exchange failed to start a KYC attribute conversion helper process. It is likely configured incorrectly. | ||
462 | HttpStatus: 500 | ||
368 | 463 | ||
369 | 464 | ||
370 | Value: 1100 | 465 | Value: 1100 |
@@ -402,11 +497,20 @@ Name: EXCHANGE_DEPOSITS_GET_MERCHANT_SIGNATURE_INVALID | |||
402 | Description: The signature of the merchant is invalid. | 497 | Description: The signature of the merchant is invalid. |
403 | HttpStatus: 403 | 498 | HttpStatus: 403 |
404 | 499 | ||
500 | Value: 1107 | ||
501 | Name: EXCHANGE_DEPOSITS_POLICY_NOT_ACCEPTED | ||
502 | Description: The provided policy data was not accepted | ||
503 | HttpStatus: 400 | ||
504 | |||
405 | Value: 1150 | 505 | Value: 1150 |
406 | Name: EXCHANGE_WITHDRAW_INSUFFICIENT_FUNDS | 506 | Name: EXCHANGE_WITHDRAW_INSUFFICIENT_FUNDS |
407 | Description: 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. | 507 | Description: 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. |
408 | HttpStatus: 409 | 508 | HttpStatus: 409 |
409 | 509 | ||
510 | Value: 1151 | ||
511 | Name: EXCHANGE_AGE_WITHDRAW_INSUFFICIENT_FUNDS | ||
512 | Description: 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. | ||
513 | HttpStatus: 409 | ||
410 | 514 | ||
411 | Value: 1152 | 515 | Value: 1152 |
412 | Name: EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW | 516 | Name: EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW |
@@ -424,10 +528,15 @@ Description: The signature of the reserve is not valid. | |||
424 | HttpStatus: 403 | 528 | HttpStatus: 403 |
425 | 529 | ||
426 | Value: 1155 | 530 | Value: 1155 |
427 | Name: EXCHANGE_WITHDRAW_HISTORY_ERROR_INSUFFICIENT_FUNDS | 531 | Name: EXCHANGE_RESERVE_HISTORY_ERROR_INSUFFICIENT_FUNDS |
428 | Description: When computing the reserve history, we ended up with a negative overall balance, which should be impossible. | 532 | Description: When computing the reserve history, we ended up with a negative overall balance, which should be impossible. |
429 | HttpStatus: 500 | 533 | HttpStatus: 500 |
430 | 534 | ||
535 | Value: 1156 | ||
536 | Name: EXCHANGE_GET_RESERVE_HISTORY_ERROR_INSUFFICIENT_BALANCE | ||
537 | Description: The reserve did not have sufficient funds in it to pay for a full reserve history statement. | ||
538 | HttpStatus: 409 | ||
539 | |||
431 | Value: 1158 | 540 | Value: 1158 |
432 | Name: EXCHANGE_WITHDRAW_DENOMINATION_KEY_LOST | 541 | Name: EXCHANGE_WITHDRAW_DENOMINATION_KEY_LOST |
433 | Description: Withdraw period of the coin to be withdrawn is in the past. | 542 | Description: Withdraw period of the coin to be withdrawn is in the past. |
@@ -441,8 +550,33 @@ HttpStatus: 0 | |||
441 | Value: 1160 | 550 | Value: 1160 |
442 | Name: EXCHANGE_WITHDRAW_NONCE_REUSE | 551 | Name: EXCHANGE_WITHDRAW_NONCE_REUSE |
443 | Description: The client re-used a withdraw nonce, which is not allowed. | 552 | Description: The client re-used a withdraw nonce, which is not allowed. |
553 | HttpStatus: 409 | ||
554 | |||
555 | Value: 1161 | ||
556 | Name: EXCHANGE_AGE_WITHDRAW_COMMITMENT_UNKNOWN | ||
557 | Description: The client provided an unknown commitment for an age-withdraw request. | ||
444 | HttpStatus: 400 | 558 | HttpStatus: 400 |
445 | 559 | ||
560 | Value: 1162 | ||
561 | Name: EXCHANGE_AGE_WITHDRAW_AMOUNT_OVERFLOW | ||
562 | Description: The total sum of amounts from the denominations did overflow. | ||
563 | HttpStatus: 500 | ||
564 | |||
565 | Value: 1163 | ||
566 | Name: EXCHANGE_AGE_WITHDRAW_AMOUNT_INCORRECT | ||
567 | Description: The total sum of value and fees from the denominations differs from the committed amount with fees. | ||
568 | HttpStatus: 400 | ||
569 | |||
570 | Value: 1164 | ||
571 | Name: EXCHANGE_AGE_WITHDRAW_REVEAL_INVALID_HASH | ||
572 | Description: The original commitment differs from the calculated hash | ||
573 | HttpStatus: 400 | ||
574 | |||
575 | Value: 1165 | ||
576 | Name: EXCHANGE_AGE_WITHDRAW_MAXIMUM_AGE_TOO_LARGE | ||
577 | Description: The maximum age in the commitment is too large for the reserve | ||
578 | HttpStatus: 409 | ||
579 | |||
446 | Value: 1175 | 580 | Value: 1175 |
447 | Name: EXCHANGE_WITHDRAW_BATCH_IDEMPOTENT_PLANCHET | 581 | Name: EXCHANGE_WITHDRAW_BATCH_IDEMPOTENT_PLANCHET |
448 | Description: The batch withdraw included a planchet that was already withdrawn. This is not allowed. | 582 | Description: The batch withdraw included a planchet that was already withdrawn. This is not allowed. |
@@ -494,18 +628,19 @@ Description: The deposited amount is smaller than the deposit fee, which would r | |||
494 | HttpStatus: 400 | 628 | HttpStatus: 400 |
495 | 629 | ||
496 | 630 | ||
497 | Value: 1250 | 631 | Value: 1240 |
498 | Name: EXCHANGE_RESERVES_STATUS_UNKNOWN | 632 | Name: EXCHANGE_EXTENSIONS_INVALID_FULFILLMENT |
499 | Description: The reserve balance, status or history was requested for a reserve which is not known to the exchange. | 633 | Description: The proof of policy fulfillment was invalid. |
500 | HttpStatus: 404 | 634 | HttpStatus: 400 |
635 | |||
501 | 636 | ||
502 | Value: 1251 | 637 | Value: 1251 |
503 | Name: EXCHANGE_RESERVES_STATUS_BAD_SIGNATURE | 638 | Name: EXCHANGE_COIN_HISTORY_BAD_SIGNATURE |
504 | Description: The reserve status was requested with a bad signature. | 639 | Description: The coin history was requested with a bad signature. |
505 | HttpStatus: 403 | 640 | HttpStatus: 403 |
506 | 641 | ||
507 | Value: 1252 | 642 | Value: 1252 |
508 | Name: EXCHANGE_RESERVES_HISTORY_BAD_SIGNATURE | 643 | Name: EXCHANGE_RESERVE_HISTORY_BAD_SIGNATURE |
509 | Description: The reserve history was requested with a bad signature. | 644 | Description: The reserve history was requested with a bad signature. |
510 | HttpStatus: 403 | 645 | HttpStatus: 403 |
511 | 646 | ||
@@ -782,11 +917,25 @@ Name: EXCHANGE_RESERVES_PURSE_FEE_TOO_LOW | |||
782 | Description: The purse fee specified for the request is lower than the purse fee charged by the exchange at this time. | 917 | Description: The purse fee specified for the request is lower than the purse fee charged by the exchange at this time. |
783 | HttpStatus: 400 | 918 | HttpStatus: 400 |
784 | 919 | ||
920 | Value: 1679 | ||
921 | Name: EXCHANGE_PURSE_DELETE_ALREADY_DECIDED | ||
922 | Description: The payment request cannot be deleted anymore, as it either already completed or timed out. | ||
923 | HttpStatus: 409 | ||
924 | |||
925 | Value: 1680 | ||
926 | Name: EXCHANGE_PURSE_DELETE_SIGNATURE_INVALID | ||
927 | Description: The signature affirming the purse deletion is invalid. | ||
928 | HttpStatus: 403 | ||
929 | |||
930 | Value: 1681 | ||
931 | Name: EXCHANGE_RESERVES_AGE_RESTRICTION_REQUIRED | ||
932 | Description: Withdrawal from the reserve requires age restriction to be set. | ||
933 | HttpStatus: 403 | ||
785 | 934 | ||
786 | Value: 1700 | 935 | Value: 1700 |
787 | Name: EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE | 936 | Name: EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE |
788 | Description: The exchange failed to talk to the process responsible for its private denomination keys. | 937 | Description: The exchange failed to talk to the process responsible for its private denomination keys or the helpers had no denominations (properly) configured. |
789 | HttpStatus: 500 | 938 | HttpStatus: 502 |
790 | 939 | ||
791 | Value: 1701 | 940 | Value: 1701 |
792 | Name: EXCHANGE_DENOMINATION_HELPER_BUG | 941 | Name: EXCHANGE_DENOMINATION_HELPER_BUG |
@@ -807,7 +956,7 @@ HttpStatus: 0 | |||
807 | Value: 1750 | 956 | Value: 1750 |
808 | Name: EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE | 957 | Name: EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE |
809 | Description: The exchange failed to talk to the process responsible for its private signing keys. | 958 | Description: The exchange failed to talk to the process responsible for its private signing keys. |
810 | HttpStatus: 500 | 959 | HttpStatus: 502 |
811 | 960 | ||
812 | Value: 1751 | 961 | Value: 1751 |
813 | Name: EXCHANGE_SIGNKEY_HELPER_BUG | 962 | Name: EXCHANGE_SIGNKEY_HELPER_BUG |
@@ -840,7 +989,30 @@ Name: EXCHANGE_RESERVES_RESERVE_MERGE_SIGNATURE_INVALID | |||
840 | Description: The signature by the reserve affirming the merge is invalid. | 989 | Description: The signature by the reserve affirming the merge is invalid. |
841 | HttpStatus: 403 | 990 | HttpStatus: 403 |
842 | 991 | ||
992 | Value: 1785 | ||
993 | Name: EXCHANGE_RESERVES_OPEN_BAD_SIGNATURE | ||
994 | Description: The signature by the reserve affirming the open operation is invalid. | ||
995 | HttpStatus: 403 | ||
996 | |||
997 | Value: 1786 | ||
998 | Name: EXCHANGE_RESERVES_CLOSE_BAD_SIGNATURE | ||
999 | Description: The signature by the reserve affirming the close operation is invalid. | ||
1000 | HttpStatus: 403 | ||
843 | 1001 | ||
1002 | Value: 1787 | ||
1003 | Name: EXCHANGE_RESERVES_ATTEST_BAD_SIGNATURE | ||
1004 | Description: The signature by the reserve affirming the attestion request is invalid. | ||
1005 | HttpStatus: 403 | ||
1006 | |||
1007 | Value: 1788 | ||
1008 | Name: EXCHANGE_RESERVES_CLOSE_NO_TARGET_ACCOUNT | ||
1009 | Description: 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. | ||
1010 | HttpStatus: 409 | ||
1011 | |||
1012 | Value: 1789 | ||
1013 | Name: EXCHANGE_RESERVES_OPEN_INSUFFICIENT_FUNDS | ||
1014 | Description: The reserve balance is insufficient to pay for the open operation. | ||
1015 | HttpStatus: 409 | ||
844 | 1016 | ||
845 | Value: 1800 | 1017 | Value: 1800 |
846 | Name: EXCHANGE_MANAGEMENT_AUDITOR_NOT_FOUND | 1018 | Name: EXCHANGE_MANAGEMENT_AUDITOR_NOT_FOUND |
@@ -932,6 +1104,44 @@ Name: EXCHANGE_MANAGEMENT_GLOBAL_FEE_SIGNATURE_INVALID | |||
932 | Description: The signature affirming the fee structure is invalid. | 1104 | Description: The signature affirming the fee structure is invalid. |
933 | HttpStatus: 403 | 1105 | HttpStatus: 403 |
934 | 1106 | ||
1107 | Value: 1818 | ||
1108 | Name: EXCHANGE_MANAGEMENT_DRAIN_PROFITS_SIGNATURE_INVALID | ||
1109 | Description: The signature affirming the profit drain is invalid. | ||
1110 | HttpStatus: 403 | ||
1111 | |||
1112 | Value: 1825 | ||
1113 | Name: EXCHANGE_AML_DECISION_ADD_SIGNATURE_INVALID | ||
1114 | Description: The signature affirming the AML decision is invalid. | ||
1115 | HttpStatus: 403 | ||
1116 | |||
1117 | Value: 1826 | ||
1118 | Name: EXCHANGE_AML_DECISION_INVALID_OFFICER | ||
1119 | Description: The AML officer specified is not allowed to make AML decisions right now. | ||
1120 | HttpStatus: 403 | ||
1121 | |||
1122 | Value: 1827 | ||
1123 | Name: EXCHANGE_AML_DECISION_MORE_RECENT_PRESENT | ||
1124 | Description: There is a more recent AML decision on file. The decision was rejected as timestamps of AML decisions must be monotonically increasing. | ||
1125 | HttpStatus: 409 | ||
1126 | |||
1127 | Value: 1828 | ||
1128 | Name: EXCHANGE_AML_DECISION_UNKNOWN_CHECK | ||
1129 | Description: There AML decision would impose an AML check of a type that is not provided by any KYC provider known to the exchange. | ||
1130 | HttpStatus: 400 | ||
1131 | |||
1132 | Value: 1830 | ||
1133 | Name: EXCHANGE_MANAGEMENT_UPDATE_AML_OFFICER_SIGNATURE_INVALID | ||
1134 | Description: The signature affirming the change in the AML officer status is invalid. | ||
1135 | HttpStatus: 403 | ||
1136 | |||
1137 | Value: 1831 | ||
1138 | Name: EXCHANGE_MANAGEMENT_AML_OFFICERS_MORE_RECENT_PRESENT | ||
1139 | Description: A more recent decision about the AML officer status is known to the exchange. | ||
1140 | HttpStatus: 409 | ||
1141 | |||
1142 | |||
1143 | |||
1144 | |||
935 | Value: 1850 | 1145 | Value: 1850 |
936 | Name: EXCHANGE_PURSE_CREATE_CONFLICTING_META_DATA | 1146 | Name: EXCHANGE_PURSE_CREATE_CONFLICTING_META_DATA |
937 | Description: The purse was previously created with different meta data. | 1147 | Description: The purse was previously created with different meta data. |
@@ -1012,6 +1222,16 @@ Name: EXCHANGE_MERGE_PURSE_PARTNER_UNKNOWN | |||
1012 | Description: The exchange of the target account is not a partner of this exchange. | 1222 | Description: The exchange of the target account is not a partner of this exchange. |
1013 | HttpStatus: 404 | 1223 | HttpStatus: 404 |
1014 | 1224 | ||
1225 | Value: 1890 | ||
1226 | Name: EXCHANGE_MANAGEMENT_ADD_PARTNER_SIGNATURE_INVALID | ||
1227 | Description: The signature affirming the new partner is invalid. | ||
1228 | HttpStatus: 403 | ||
1229 | |||
1230 | Value: 1891 | ||
1231 | Name: EXCHANGE_MANAGEMENT_ADD_PARTNER_DATA_CONFLICT | ||
1232 | Description: Conflicting data for the partner already exists with the exchange. | ||
1233 | HttpStatus: 409 | ||
1234 | |||
1015 | 1235 | ||
1016 | Value: 1900 | 1236 | Value: 1900 |
1017 | Name: EXCHANGE_AUDITORS_AUDITOR_SIGNATURE_INVALID | 1237 | Name: EXCHANGE_AUDITORS_AUDITOR_SIGNATURE_INVALID |
@@ -1048,11 +1268,58 @@ Name: EXCHANGE_KYC_PROOF_BACKEND_AUTHORIZATION_FAILED | |||
1048 | Description: The backend signaled an authorization failure. | 1268 | Description: The backend signaled an authorization failure. |
1049 | HttpStatus: 403 | 1269 | HttpStatus: 403 |
1050 | 1270 | ||
1271 | Value: 1929 | ||
1272 | Name: EXCHANGE_KYC_PROOF_REQUEST_UNKNOWN | ||
1273 | Description: The exchange is unaware of having made an the authorization request. | ||
1274 | HttpStatus: 404 | ||
1275 | |||
1051 | Value: 1930 | 1276 | Value: 1930 |
1052 | Name: EXCHANGE_KYC_CHECK_AUTHORIZATION_FAILED | 1277 | Name: EXCHANGE_KYC_CHECK_AUTHORIZATION_FAILED |
1053 | Description: The payto-URI hash did not match. Hence the request was denied. | 1278 | Description: The payto-URI hash did not match. Hence the request was denied. |
1054 | HttpStatus: 403 | 1279 | HttpStatus: 403 |
1055 | 1280 | ||
1281 | Value: 1931 | ||
1282 | Name: EXCHANGE_KYC_GENERIC_LOGIC_UNKNOWN | ||
1283 | Description: The request used a logic specifier that is not known to the exchange. | ||
1284 | HttpStatus: 404 | ||
1285 | |||
1286 | Value: 1932 | ||
1287 | Name: EXCHANGE_KYC_GENERIC_LOGIC_GONE | ||
1288 | Description: The request requires a logic which is no longer configured at the exchange. | ||
1289 | HttpStatus: 500 | ||
1290 | |||
1291 | Value: 1933 | ||
1292 | Name: EXCHANGE_KYC_GENERIC_LOGIC_BUG | ||
1293 | Description: The logic plugin had a bug in its interaction with the KYC provider. | ||
1294 | HttpStatus: 500 | ||
1295 | |||
1296 | Value: 1934 | ||
1297 | Name: EXCHANGE_KYC_GENERIC_PROVIDER_ACCESS_REFUSED | ||
1298 | Description: 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. | ||
1299 | HttpStatus: 511 | ||
1300 | |||
1301 | Value: 1935 | ||
1302 | Name: EXCHANGE_KYC_GENERIC_PROVIDER_TIMEOUT | ||
1303 | Description: 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. | ||
1304 | HttpStatus: 504 | ||
1305 | |||
1306 | Value: 1936 | ||
1307 | Name: EXCHANGE_KYC_GENERIC_PROVIDER_UNEXPECTED_REPLY | ||
1308 | Description: The KYC provider responded with a status that was completely unexpected by the KYC logic of the exchange. | ||
1309 | HttpStatus: 502 | ||
1310 | |||
1311 | Value: 1937 | ||
1312 | Name: EXCHANGE_KYC_GENERIC_PROVIDER_RATE_LIMIT_EXCEEDED | ||
1313 | Description: The rate limit of the exchange at the KYC provider has been exceeded. Trying much later might work. | ||
1314 | HttpStatus: 503 | ||
1315 | |||
1316 | Value: 1938 | ||
1317 | Name: EXCHANGE_KYC_WEBHOOK_UNAUTHORIZED | ||
1318 | Description: The request to the webhook lacked proper authorization or authentication data. | ||
1319 | HttpStatus: 401 | ||
1320 | |||
1321 | |||
1322 | |||
1056 | Value: 1950 | 1323 | Value: 1950 |
1057 | Name: EXCHANGE_CONTRACTS_UNKNOWN | 1324 | Name: EXCHANGE_CONTRACTS_UNKNOWN |
1058 | Description: The exchange does not know a contract under the given contract public key. | 1325 | Description: The exchange does not know a contract under the given contract public key. |
@@ -1083,6 +1350,18 @@ Name: EXCHANGE_PURSE_DEPOSIT_COIN_SIGNATURE_INVALID | |||
1083 | Description: A coin signature for a deposit into the purse is invalid. | 1350 | Description: A coin signature for a deposit into the purse is invalid. |
1084 | HttpStatus: 403 | 1351 | HttpStatus: 403 |
1085 | 1352 | ||
1353 | Value: 1976 | ||
1354 | Name: EXCHANGE_PURSE_DEPOSIT_DECIDED_ALREADY | ||
1355 | Description: It is too late to deposit coins into the purse. | ||
1356 | HttpStatus: 410 | ||
1357 | |||
1358 | |||
1359 | |||
1360 | Value: 1980 | ||
1361 | Name: EXCHANGE_TOTP_KEY_INVALID | ||
1362 | Description: TOTP key is not valid. | ||
1363 | HttpStatus: 0 | ||
1364 | |||
1086 | 1365 | ||
1087 | 1366 | ||
1088 | 1367 | ||
@@ -1100,19 +1379,9 @@ Description: The start and end-times in the wire fee structure leave a hole. Thi | |||
1100 | HttpStatus: 0 | 1379 | HttpStatus: 0 |
1101 | 1380 | ||
1102 | Value: 2002 | 1381 | Value: 2002 |
1103 | Name: MERCHANT_GENERIC_RESERVE_PUB_MALFORMED | 1382 | Name: MERCHANT_GENERIC_EXCHANGE_WIRE_REQUEST_FAILED |
1104 | Description: The reserve key of given to a /reserves/ handler was malformed. | 1383 | Description: The merchant was unable to obtain a valid answer to /wire from the exchange. |
1105 | HttpStatus: 400 | 1384 | HttpStatus: 502 |
1106 | |||
1107 | Value: 2003 | ||
1108 | Name: MERCHANT_GENERIC_FAILED_TO_LOAD_TEMPLATE | ||
1109 | Description: The backend could not locate a required template to generate an HTML reply. | ||
1110 | HttpStatus: 406 | ||
1111 | |||
1112 | Value: 2004 | ||
1113 | Name: MERCHANT_GENERIC_FAILED_TO_EXPAND_TEMPLATE | ||
1114 | Description: The backend could not expand the template to generate an HTML reply. | ||
1115 | HttpStatus: 500 | ||
1116 | 1385 | ||
1117 | Value: 2005 | 1386 | Value: 2005 |
1118 | Name: MERCHANT_GENERIC_ORDER_UNKNOWN | 1387 | Name: MERCHANT_GENERIC_ORDER_UNKNOWN |
@@ -1125,8 +1394,8 @@ Description: The order provided to the backend could not be completed, because a | |||
1125 | HttpStatus: 404 | 1394 | HttpStatus: 404 |
1126 | 1395 | ||
1127 | Value: 2007 | 1396 | Value: 2007 |
1128 | Name: MERCHANT_GENERIC_TIP_ID_UNKNOWN | 1397 | Name: MERCHANT_GENERIC_REWARD_ID_UNKNOWN |
1129 | Description: The tip ID is unknown. This could happen if the tip has expired. | 1398 | Description: The reward ID is unknown. This could happen if the reward has expired. |
1130 | HttpStatus: 404 | 1399 | HttpStatus: 404 |
1131 | 1400 | ||
1132 | Value: 2008 | 1401 | Value: 2008 |
@@ -1179,6 +1448,40 @@ Name: MERCHANT_GENERIC_TRANSFER_UNKNOWN | |||
1179 | Description: The backend could not find the inbound wire transfer specified in the request. | 1448 | Description: The backend could not find the inbound wire transfer specified in the request. |
1180 | HttpStatus: 404 | 1449 | HttpStatus: 404 |
1181 | 1450 | ||
1451 | Value: 2018 | ||
1452 | Name: MERCHANT_GENERIC_TEMPLATE_UNKNOWN | ||
1453 | Description: The backend could not find the template(id) because it is not exist. | ||
1454 | HttpStatus: 404 | ||
1455 | |||
1456 | Value: 2019 | ||
1457 | Name: MERCHANT_GENERIC_WEBHOOK_UNKNOWN | ||
1458 | Description: The backend could not find the webhook(id) because it is not exist. | ||
1459 | HttpStatus: 404 | ||
1460 | |||
1461 | Value: 2020 | ||
1462 | Name: MERCHANT_GENERIC_PENDING_WEBHOOK_UNKNOWN | ||
1463 | Description: The backend could not find the webhook(serial) because it is not exist. | ||
1464 | HttpStatus: 404 | ||
1465 | |||
1466 | Value: 2021 | ||
1467 | Name: MERCHANT_GENERIC_OTP_DEVICE_UNKNOWN | ||
1468 | Description: The backend could not find the OTP device(id) because it is not exist. | ||
1469 | HttpStatus: 404 | ||
1470 | |||
1471 | Value: 2022 | ||
1472 | Name: MERCHANT_GENERIC_ACCOUNT_UNKNOWN | ||
1473 | Description: The account is not known to the backend. | ||
1474 | HttpStatus: 404 | ||
1475 | |||
1476 | Value: 2023 | ||
1477 | Name: MERCHANT_GENERIC_H_WIRE_MALFORMED | ||
1478 | Description: The wire hash was malformed. | ||
1479 | HttpStatus: 400 | ||
1480 | |||
1481 | Value: 2024 | ||
1482 | Name: MERCHANT_GENERIC_CURRENCY_MISMATCH | ||
1483 | Description: The currency specified in the operation does not work with the current state of the given resource. | ||
1484 | HttpStatus: 409 | ||
1182 | 1485 | ||
1183 | # 2100-2499: public API | 1486 | # 2100-2499: public API |
1184 | # 2100-2149: get orders endpoint | 1487 | # 2100-2149: get orders endpoint |
@@ -1188,7 +1491,6 @@ Name: MERCHANT_GET_ORDERS_EXCHANGE_TRACKING_FAILURE | |||
1188 | Description: The exchange failed to provide a valid answer to the tracking request, thus those details are not in the response. | 1491 | Description: The exchange failed to provide a valid answer to the tracking request, thus those details are not in the response. |
1189 | HttpStatus: 200 | 1492 | HttpStatus: 200 |
1190 | 1493 | ||
1191 | |||
1192 | Value: 2103 | 1494 | Value: 2103 |
1193 | Name: MERCHANT_GET_ORDERS_ID_EXCHANGE_REQUEST_FAILURE | 1495 | Name: MERCHANT_GET_ORDERS_ID_EXCHANGE_REQUEST_FAILURE |
1194 | Description: The merchant backend failed to construct the request for tracking to the exchange, thus tracking details are not in the response. | 1496 | Description: The merchant backend failed to construct the request for tracking to the exchange, thus tracking details are not in the response. |
@@ -1239,12 +1541,12 @@ HttpStatus: 400 | |||
1239 | Value: 2155 | 1541 | Value: 2155 |
1240 | Name: MERCHANT_POST_ORDERS_ID_PAY_INSUFFICIENT_DUE_TO_FEES | 1542 | Name: MERCHANT_POST_ORDERS_ID_PAY_INSUFFICIENT_DUE_TO_FEES |
1241 | Description: 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. | 1543 | Description: 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. |
1242 | HttpStatus: 406 | 1544 | HttpStatus: 400 |
1243 | 1545 | ||
1244 | Value: 2156 | 1546 | Value: 2156 |
1245 | Name: MERCHANT_POST_ORDERS_ID_PAY_PAYMENT_INSUFFICIENT | 1547 | Name: MERCHANT_POST_ORDERS_ID_PAY_PAYMENT_INSUFFICIENT |
1246 | Description: Even if we do not consider deposit and wire fees, the payment is insufficient to satisfy the required amount for the contract. | 1548 | Description: Even if we do not consider deposit and wire fees, the payment is insufficient to satisfy the required amount for the contract. |
1247 | HttpStatus: 406 | 1549 | HttpStatus: 400 |
1248 | 1550 | ||
1249 | Value: 2157 | 1551 | Value: 2157 |
1250 | Name: MERCHANT_POST_ORDERS_ID_PAY_COIN_SIGNATURE_INVALID | 1552 | Name: MERCHANT_POST_ORDERS_ID_PAY_COIN_SIGNATURE_INVALID |
@@ -1331,7 +1633,43 @@ Name: MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_HASH_MISSING | |||
1331 | Description: 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. | 1633 | Description: 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. |
1332 | HttpStatus: 400 | 1634 | HttpStatus: 400 |
1333 | 1635 | ||
1334 | # 2200-2249: post orders ID paid endpoint | 1636 | Value: 2175 |
1637 | Name: MERCHANT_POST_ORDERS_ID_PAY_WIRE_METHOD_UNSUPPORTED | ||
1638 | Description: 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. | ||
1639 | HttpStatus: 409 | ||
1640 | |||
1641 | Value: 2176 | ||
1642 | Name: MERCHANT_POST_ORDERS_ID_PAY_CHOICE_INDEX_MISSING | ||
1643 | Description: The payment requires the wallet to select a choice from the choices array and pass it in the 'choice_index' field of the request. | ||
1644 | HttpStatus: 400 | ||
1645 | |||
1646 | Value: 2177 | ||
1647 | Name: MERCHANT_POST_ORDERS_ID_PAY_CHOICE_INDEX_OUT_OF_BOUNDS | ||
1648 | Description: The 'choice_index' field is invalid. | ||
1649 | HttpStatus: 400 | ||
1650 | |||
1651 | Value: 2178 | ||
1652 | Name: MERCHANT_POST_ORDERS_ID_PAY_INPUT_TOKENS_MISMATCH | ||
1653 | Description: The provided 'tokens' array does not match with the required input tokens of the order. | ||
1654 | HttpStatus: 400 | ||
1655 | |||
1656 | Value: 2179 | ||
1657 | Name: MERCHANT_POST_ORDERS_ID_PAY_TOKEN_ISSUE_SIG_INVALID | ||
1658 | Description: Invalid token issue signature (blindly signed by merchant) for provided token. | ||
1659 | HttpStatus: 400 | ||
1660 | |||
1661 | Value: 2180 | ||
1662 | Name: MERCHANT_POST_ORDERS_ID_PAY_TOKEN_USE_SIG_INVALID | ||
1663 | Description: Invalid token use signature (EdDSA, signed by wallet) for provided token. | ||
1664 | HttpStatus: 400 | ||
1665 | |||
1666 | Value: 2181 | ||
1667 | Name: MERCHANT_POST_ORDERS_ID_PAY_TOKEN_COUNT_MISMATCH | ||
1668 | Description: The provided number of tokens does not match the required number. | ||
1669 | HttpStatus: 400 | ||
1670 | |||
1671 | |||
1672 | # 2200-2224: post orders ID paid endpoint | ||
1335 | 1673 | ||
1336 | Value: 2200 | 1674 | Value: 2200 |
1337 | Name: MERCHANT_POST_ORDERS_ID_PAID_CONTRACT_HASH_MISMATCH | 1675 | Name: MERCHANT_POST_ORDERS_ID_PAID_CONTRACT_HASH_MISMATCH |
@@ -1343,8 +1681,20 @@ Name: MERCHANT_POST_ORDERS_ID_PAID_COIN_SIGNATURE_INVALID | |||
1343 | Description: The signature of the merchant is not valid for the given contract hash. | 1681 | Description: The signature of the merchant is not valid for the given contract hash. |
1344 | HttpStatus: 403 | 1682 | HttpStatus: 403 |
1345 | 1683 | ||
1346 | # 2250-2299: post orders ID abort endpoint | 1684 | # 2225-2249: token families endpoints |
1347 | 1685 | ||
1686 | Value: 2225 | ||
1687 | Name: MERCHANT_POST_TOKEN_FAMILY_CONFLICT | ||
1688 | Description: A token family with this ID but conflicting data exists. | ||
1689 | HttpStatus: 409 | ||
1690 | |||
1691 | Value: 2226 | ||
1692 | Name: MERCHANT_PATCH_TOKEN_FAMILY_NOT_FOUND | ||
1693 | Description: The backend is unaware of a token family with the given ID. | ||
1694 | HttpStatus: 404 | ||
1695 | |||
1696 | |||
1697 | # 2250-2256: post orders ID abort endpoint | ||
1348 | 1698 | ||
1349 | Value: 2251 | 1699 | Value: 2251 |
1350 | Name: MERCHANT_POST_ORDERS_ID_ABORT_EXCHANGE_REFUND_FAILED | 1700 | Name: MERCHANT_POST_ORDERS_ID_ABORT_EXCHANGE_REFUND_FAILED |
@@ -1376,6 +1726,44 @@ Name: MERCHANT_POST_ORDERS_ID_ABORT_COINS_ARRAY_EMPTY | |||
1376 | Description: The array of coins cannot be empty. | 1726 | Description: The array of coins cannot be empty. |
1377 | HttpStatus: 400 | 1727 | HttpStatus: 400 |
1378 | 1728 | ||
1729 | Value: 2258 | ||
1730 | Name: MERCHANT_EXCHANGE_TRANSFERS_AWAITING_KEYS | ||
1731 | Description: We are waiting for the exchange to provide us with key material before checking the wire transfer. | ||
1732 | HttpStatus: 202 | ||
1733 | |||
1734 | Value: 2259 | ||
1735 | Name: MERCHANT_EXCHANGE_TRANSFERS_AWAITING_LIST | ||
1736 | Description: We are waiting for the exchange to provide us with the list of aggregated transactions. | ||
1737 | HttpStatus: 202 | ||
1738 | |||
1739 | |||
1740 | Value: 2260 | ||
1741 | Name: MERCHANT_EXCHANGE_TRANSFERS_FATAL_NO_EXCHANGE | ||
1742 | Description: The endpoint indicated in the wire transfer does not belong to a GNU Taler exchange. | ||
1743 | HttpStatus: 200 | ||
1744 | |||
1745 | Value: 2261 | ||
1746 | Name: MERCHANT_EXCHANGE_TRANSFERS_FATAL_NOT_FOUND | ||
1747 | Description: The exchange indicated in the wire transfer claims to know nothing about the wire transfer. | ||
1748 | HttpStatus: 0 | ||
1749 | |||
1750 | Value: 2262 | ||
1751 | Name: MERCHANT_EXCHANGE_TRANSFERS_RATE_LIMITED | ||
1752 | Description: The interaction with the exchange is delayed due to rate limiting. | ||
1753 | HttpStatus: 202 | ||
1754 | |||
1755 | Value: 2263 | ||
1756 | Name: MERCHANT_EXCHANGE_TRANSFERS_TRANSIENT_FAILURE | ||
1757 | Description: We experienced a transient failure in our interaction with the exchange. | ||
1758 | HttpStatus: 202 | ||
1759 | |||
1760 | Value: 2264 | ||
1761 | Name: MERCHANT_EXCHANGE_TRANSFERS_HARD_FAILURE | ||
1762 | Description: The response from the exchange was unacceptable and should be reviewed with an auditor. | ||
1763 | HttpStatus: 200 | ||
1764 | |||
1765 | |||
1766 | |||
1379 | # 2300-2349: post orders ID claim endpoint | 1767 | # 2300-2349: post orders ID claim endpoint |
1380 | 1768 | ||
1381 | Value: 2300 | 1769 | Value: 2300 |
@@ -1400,38 +1788,38 @@ Name: MERCHANT_POST_ORDERS_ID_REFUND_SIGNATURE_FAILED | |||
1400 | Description: The backend failed to sign the refund request. | 1788 | Description: The backend failed to sign the refund request. |
1401 | HttpStatus: 0 | 1789 | HttpStatus: 0 |
1402 | 1790 | ||
1403 | # 2400-2449: tip pickup endpoint | 1791 | # 2400-2449: reward pickup endpoint |
1404 | 1792 | ||
1405 | Value: 2400 | 1793 | Value: 2400 |
1406 | Name: MERCHANT_TIP_PICKUP_UNBLIND_FAILURE | 1794 | Name: MERCHANT_REWARD_PICKUP_UNBLIND_FAILURE |
1407 | Description: The client failed to unblind the signature returned by the merchant. | 1795 | Description: The client failed to unblind the signature returned by the merchant. |
1408 | HttpStatus: 0 | 1796 | HttpStatus: 0 |
1409 | 1797 | ||
1410 | 1798 | ||
1411 | 1799 | ||
1412 | Value: 2403 | 1800 | Value: 2403 |
1413 | Name: MERCHANT_TIP_PICKUP_EXCHANGE_ERROR | 1801 | Name: MERCHANT_REWARD_PICKUP_EXCHANGE_ERROR |
1414 | Description: The exchange returned a failure code for the withdraw operation. | 1802 | Description: The exchange returned a failure code for the withdraw operation. |
1415 | HttpStatus: 502 | 1803 | HttpStatus: 502 |
1416 | 1804 | ||
1417 | 1805 | ||
1418 | Value: 2404 | 1806 | Value: 2404 |
1419 | Name: MERCHANT_TIP_PICKUP_SUMMATION_FAILED | 1807 | Name: MERCHANT_REWARD_PICKUP_SUMMATION_FAILED |
1420 | Description: The merchant failed to add up the amounts to compute the pick up value. | 1808 | Description: The merchant failed to add up the amounts to compute the pick up value. |
1421 | HttpStatus: 500 | 1809 | HttpStatus: 500 |
1422 | 1810 | ||
1423 | Value: 2405 | 1811 | Value: 2405 |
1424 | Name: MERCHANT_TIP_PICKUP_HAS_EXPIRED | 1812 | Name: MERCHANT_REWARD_PICKUP_HAS_EXPIRED |
1425 | Description: The tip expired. | 1813 | Description: The reward expired. |
1426 | HttpStatus: 410 | 1814 | HttpStatus: 410 |
1427 | 1815 | ||
1428 | Value: 2406 | 1816 | Value: 2406 |
1429 | Name: MERCHANT_TIP_PICKUP_AMOUNT_EXCEEDS_TIP_REMAINING | 1817 | Name: MERCHANT_REWARD_PICKUP_AMOUNT_EXCEEDS_REWARD_REMAINING |
1430 | Description: The requested withdraw amount exceeds the amount remaining to be picked up. | 1818 | Description: The requested withdraw amount exceeds the amount remaining to be picked up. |
1431 | HttpStatus: 400 | 1819 | HttpStatus: 400 |
1432 | 1820 | ||
1433 | Value: 2407 | 1821 | Value: 2407 |
1434 | Name: MERCHANT_TIP_PICKUP_DENOMINATION_UNKNOWN | 1822 | Name: MERCHANT_REWARD_PICKUP_DENOMINATION_UNKNOWN |
1435 | Description: The merchant did not find the specified denomination key in the exchange's key set. | 1823 | Description: The merchant did not find the specified denomination key in the exchange's key set. |
1436 | HttpStatus: 409 | 1824 | HttpStatus: 409 |
1437 | 1825 | ||
@@ -1442,39 +1830,54 @@ HttpStatus: 409 | |||
1442 | 1830 | ||
1443 | Value: 2500 | 1831 | Value: 2500 |
1444 | Name: MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE | 1832 | Name: MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE |
1445 | Description: The backend lacks a wire transfer method configuration option for the given instance. Thus, this instance is unavailable (not findable for creating new orders). | 1833 | Description: The merchant instance has no active bank accounts configured. However, at least one bank account must be available to create new orders. |
1446 | HttpStatus: 404 | 1834 | HttpStatus: 404 |
1447 | 1835 | ||
1448 | Value: 2501 | 1836 | Value: 2501 |
1449 | Name: MERCHANT_PRIVATE_POST_ORDERS_NO_LOCALTIME | 1837 | Name: MERCHANT_PRIVATE_POST_ORDERS_NO_LOCALTIME |
1450 | Description: The proposal had no timestamp and the backend failed to obtain the local time. Likely to be an internal error. | 1838 | Description: The proposal had no timestamp and the merchant backend failed to obtain the current local time. |
1451 | HttpStatus: 500 | 1839 | HttpStatus: 500 |
1452 | 1840 | ||
1453 | Value: 2502 | 1841 | Value: 2502 |
1454 | Name: MERCHANT_PRIVATE_POST_ORDERS_PROPOSAL_PARSE_ERROR | 1842 | Name: MERCHANT_PRIVATE_POST_ORDERS_PROPOSAL_PARSE_ERROR |
1455 | Description: The order provided to the backend could not be parsed, some required fields were missing or ill-formed. | 1843 | Description: The order provided to the backend could not be parsed; likely some required fields were missing or ill-formed. |
1456 | HttpStatus: 400 | 1844 | HttpStatus: 400 |
1457 | 1845 | ||
1458 | Value: 2503 | 1846 | Value: 2503 |
1459 | Name: MERCHANT_PRIVATE_POST_ORDERS_ALREADY_EXISTS | 1847 | Name: MERCHANT_PRIVATE_POST_ORDERS_ALREADY_EXISTS |
1460 | Description: The backend encountered an error: the proposal already exists. | 1848 | Description: A conflicting order (sharing the same order identifier) already exists at this merchant backend instance. |
1461 | HttpStatus: 409 | 1849 | HttpStatus: 409 |
1462 | 1850 | ||
1463 | Value: 2504 | 1851 | Value: 2504 |
1464 | Name: MERCHANT_PRIVATE_POST_ORDERS_REFUND_AFTER_WIRE_DEADLINE | 1852 | Name: MERCHANT_PRIVATE_POST_ORDERS_REFUND_AFTER_WIRE_DEADLINE |
1465 | Description: The request is invalid: the wire deadline is before the refund deadline. | 1853 | Description: The order creation request is invalid because the given wire deadline is before the refund deadline. |
1466 | HttpStatus: 400 | 1854 | HttpStatus: 400 |
1467 | 1855 | ||
1468 | Value: 2505 | 1856 | Value: 2505 |
1469 | Name: MERCHANT_PRIVATE_POST_ORDERS_DELIVERY_DATE_IN_PAST | 1857 | Name: MERCHANT_PRIVATE_POST_ORDERS_DELIVERY_DATE_IN_PAST |
1470 | Description: The request is invalid: a delivery date was given, but it is in the past. | 1858 | Description: The order creation request is invalid because the delivery date given is in the past. |
1471 | HttpStatus: 400 | 1859 | HttpStatus: 400 |
1472 | 1860 | ||
1473 | Value: 2506 | 1861 | Value: 2506 |
1474 | Name: MERCHANT_PRIVATE_POST_ORDERS_WIRE_DEADLINE_IS_NEVER | 1862 | Name: MERCHANT_PRIVATE_POST_ORDERS_WIRE_DEADLINE_IS_NEVER |
1475 | Description: The request is invalid: the wire deadline for the order would be "never". | 1863 | Description: The order creation request is invalid because a wire deadline of "never" is not allowed. |
1476 | HttpStatus: 400 | 1864 | HttpStatus: 400 |
1477 | 1865 | ||
1866 | Value: 2507 | ||
1867 | Name: MERCHANT_PRIVATE_POST_ORDERS_PAY_DEADLINE_IN_PAST | ||
1868 | Description: The order creation request is invalid because the given payment deadline is in the past. | ||
1869 | HttpStatus: 400 | ||
1870 | |||
1871 | Value: 2508 | ||
1872 | Name: MERCHANT_PRIVATE_POST_ORDERS_REFUND_DEADLINE_IN_PAST | ||
1873 | Description: The order creation request is invalid because the given refund deadline is in the past. | ||
1874 | HttpStatus: 400 | ||
1875 | |||
1876 | Value: 2509 | ||
1877 | Name: MERCHANT_PRIVATE_POST_ORDERS_NO_EXCHANGES_FOR_WIRE_METHOD | ||
1878 | Description: 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. | ||
1879 | HttpStatus: 409 | ||
1880 | |||
1478 | Value: 2510 | 1881 | Value: 2510 |
1479 | Name: MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT | 1882 | Name: MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT |
1480 | Description: One of the paths to forget is malformed. | 1883 | Description: One of the paths to forget is malformed. |
@@ -1487,7 +1890,7 @@ HttpStatus: 409 | |||
1487 | 1890 | ||
1488 | Value: 2520 | 1891 | Value: 2520 |
1489 | Name: MERCHANT_PRIVATE_DELETE_ORDERS_AWAITING_PAYMENT | 1892 | Name: MERCHANT_PRIVATE_DELETE_ORDERS_AWAITING_PAYMENT |
1490 | Description: The order provided to the backend could not be deleted, our offer is still valid and awaiting payment. | 1893 | Description: 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. |
1491 | HttpStatus: 409 | 1894 | HttpStatus: 409 |
1492 | 1895 | ||
1493 | Value: 2521 | 1896 | Value: 2521 |
@@ -1497,19 +1900,24 @@ HttpStatus: 409 | |||
1497 | 1900 | ||
1498 | Value: 2530 | 1901 | Value: 2530 |
1499 | Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_INCONSISTENT_AMOUNT | 1902 | Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_INCONSISTENT_AMOUNT |
1500 | Description: 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. | 1903 | Description: 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. |
1501 | HttpStatus: 409 | 1904 | HttpStatus: 409 |
1502 | 1905 | ||
1503 | Value: 2531 | 1906 | Value: 2531 |
1504 | Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_ORDER_UNPAID | 1907 | Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_ORDER_UNPAID |
1505 | Description: The frontend gave an unpaid order id to issue the refund to. | 1908 | Description: Only paid orders can be refunded, and the frontend specified an unpaid order to issue a refund for. |
1506 | HttpStatus: 409 | 1909 | HttpStatus: 409 |
1507 | 1910 | ||
1508 | Value: 2532 | 1911 | Value: 2532 |
1509 | Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_NOT_ALLOWED_BY_CONTRACT | 1912 | Name: MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_NOT_ALLOWED_BY_CONTRACT |
1510 | Description: The refund delay was set to 0 and thus no refunds are allowed for this order. | 1913 | Description: The refund delay was set to 0 and thus no refunds are ever allowed for this order. |
1511 | HttpStatus: 403 | 1914 | HttpStatus: 403 |
1512 | 1915 | ||
1916 | Value: 2533 | ||
1917 | Name: MERCHANT_PRIVATE_POST_ORDERS_TOKEN_FAMILY_SLUG_UNKNOWN | ||
1918 | Description: The token family slug provided in this order could not be found in the merchant database. | ||
1919 | HttpStatus: 404 | ||
1920 | |||
1513 | 1921 | ||
1514 | 1922 | ||
1515 | # 2550-2599: transfer operations | 1923 | # 2550-2599: transfer operations |
@@ -1554,6 +1962,11 @@ Name: MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_SUBMISSION | |||
1554 | Description: 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. | 1962 | Description: 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. |
1555 | HttpStatus: 409 | 1963 | HttpStatus: 409 |
1556 | 1964 | ||
1965 | Value: 2563 | ||
1966 | Name: MERCHANT_EXCHANGE_TRANSFERS_CONFLICTING_TRANSFERS | ||
1967 | Description: The amount transferred differs between what was submitted and what the exchange claimed. | ||
1968 | HttpStatus: 0 | ||
1969 | |||
1557 | 1970 | ||
1558 | # 2600-2649: instance operations | 1971 | # 2600-2649: instance operations |
1559 | 1972 | ||
@@ -1582,6 +1995,16 @@ Name: MERCHANT_PRIVATE_PATCH_INSTANCES_PURGE_REQUIRED | |||
1582 | Description: The merchant backend cannot update an instance under the given identifier, the previous one was deleted but must be purged first. | 1995 | Description: The merchant backend cannot update an instance under the given identifier, the previous one was deleted but must be purged first. |
1583 | HttpStatus: 409 | 1996 | HttpStatus: 409 |
1584 | 1997 | ||
1998 | Value: 2626 | ||
1999 | Name: MERCHANT_PRIVATE_ACCOUNT_DELETE_UNKNOWN_ACCOUNT | ||
2000 | Description: The bank account referenced in the requested operation was not found. | ||
2001 | HttpStatus: 404 | ||
2002 | |||
2003 | Value: 2627 | ||
2004 | Name: MERCHANT_PRIVATE_ACCOUNT_EXISTS | ||
2005 | Description: The bank account specified in the request already exists at the merchant. | ||
2006 | HttpStatus: 409 | ||
2007 | |||
1585 | 2008 | ||
1586 | # 2650-2699: product operations | 2009 | # 2650-2699: product operations |
1587 | 2010 | ||
@@ -1627,31 +2050,36 @@ Name: MERCHANT_PRIVATE_POST_RESERVES_UNSUPPORTED_WIRE_METHOD | |||
1627 | Description: The requested wire method is not supported by the exchange. | 2050 | Description: The requested wire method is not supported by the exchange. |
1628 | HttpStatus: 409 | 2051 | HttpStatus: 409 |
1629 | 2052 | ||
2053 | Value: 2701 | ||
2054 | Name: MERCHANT_PRIVATE_POST_RESERVES_REWARDS_NOT_ALLOWED | ||
2055 | Description: The requested exchange does not allow rewards. | ||
2056 | HttpStatus: 409 | ||
2057 | |||
1630 | Value: 2710 | 2058 | Value: 2710 |
1631 | Name: MERCHANT_PRIVATE_DELETE_RESERVES_NO_SUCH_RESERVE | 2059 | Name: MERCHANT_PRIVATE_DELETE_RESERVES_NO_SUCH_RESERVE |
1632 | Description: The reserve could not be deleted because it is unknown. | 2060 | Description: The reserve could not be deleted because it is unknown. |
1633 | HttpStatus: 404 | 2061 | HttpStatus: 404 |
1634 | 2062 | ||
1635 | # 2750-2799: tip authorization | 2063 | # 2750-2799: reward authorization |
1636 | 2064 | ||
1637 | Value: 2750 | 2065 | Value: 2750 |
1638 | Name: MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_RESERVE_EXPIRED | 2066 | Name: MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_EXPIRED |
1639 | Description: The reserve that was used to fund the tips has expired. | 2067 | Description: The reserve that was used to fund the rewards has expired. |
1640 | HttpStatus: 410 | 2068 | HttpStatus: 410 |
1641 | 2069 | ||
1642 | Value: 2751 | 2070 | Value: 2751 |
1643 | Name: MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_RESERVE_UNKNOWN | 2071 | Name: MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_UNKNOWN |
1644 | Description: The reserve that was used to fund the tips was not found in the DB. | 2072 | Description: The reserve that was used to fund the rewards was not found in the DB. |
1645 | HttpStatus: 503 | 2073 | HttpStatus: 503 |
1646 | 2074 | ||
1647 | Value: 2752 | 2075 | Value: 2752 |
1648 | Name: MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_INSUFFICIENT_FUNDS | 2076 | Name: MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_INSUFFICIENT_FUNDS |
1649 | Description: 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. | 2077 | Description: 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. |
1650 | HttpStatus: 0 | 2078 | HttpStatus: 0 |
1651 | 2079 | ||
1652 | Value: 2753 | 2080 | Value: 2753 |
1653 | Name: MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_RESERVE_NOT_FOUND | 2081 | Name: MERCHANT_PRIVATE_POST_REWARD_AUTHORIZE_RESERVE_NOT_FOUND |
1654 | Description: The backend failed to find a reserve needed to authorize the tip. | 2082 | Description: The backend failed to find a reserve needed to authorize the reward. |
1655 | HttpStatus: 503 | 2083 | HttpStatus: 503 |
1656 | 2084 | ||
1657 | Value: 2800 | 2085 | Value: 2800 |
@@ -1659,6 +2087,53 @@ Name: MERCHANT_PRIVATE_GET_ORDERS_ID_AMOUNT_ARITHMETIC_FAILURE | |||
1659 | Description: The merchant backend encountered a failure in computing the deposit total. | 2087 | Description: The merchant backend encountered a failure in computing the deposit total. |
1660 | HttpStatus: 200 | 2088 | HttpStatus: 200 |
1661 | 2089 | ||
2090 | # 2850-2899: template and OTP device operations | ||
2091 | |||
2092 | Value: 2850 | ||
2093 | Name: MERCHANT_PRIVATE_POST_TEMPLATES_CONFLICT_TEMPLATE_EXISTS | ||
2094 | Description: The template ID already exists. | ||
2095 | HttpStatus: 409 | ||
2096 | |||
2097 | Value: 2851 | ||
2098 | Name: MERCHANT_PRIVATE_POST_OTP_DEVICES_CONFLICT_OTP_DEVICE_EXISTS | ||
2099 | Description: The OTP device ID already exists. | ||
2100 | HttpStatus: 409 | ||
2101 | |||
2102 | Value: 2860 | ||
2103 | Name: MERCHANT_POST_USING_TEMPLATES_AMOUNT_CONFLICT_TEMPLATES_CONTRACT_AMOUNT | ||
2104 | Description: Amount given in the using template and in the template contract. There is a conflict. | ||
2105 | HttpStatus: 409 | ||
2106 | |||
2107 | Value: 2861 | ||
2108 | Name: MERCHANT_POST_USING_TEMPLATES_SUMMARY_CONFLICT_TEMPLATES_CONTRACT_SUBJECT | ||
2109 | Description: Subject given in the using template and in the template contract. There is a conflict. | ||
2110 | HttpStatus: 409 | ||
2111 | |||
2112 | Value: 2862 | ||
2113 | Name: MERCHANT_POST_USING_TEMPLATES_NO_AMOUNT | ||
2114 | Description: Amount not given in the using template and in the template contract. There is a conflict. | ||
2115 | HttpStatus: 409 | ||
2116 | |||
2117 | Value: 2863 | ||
2118 | Name: MERCHANT_POST_USING_TEMPLATES_NO_SUMMARY | ||
2119 | Description: Subject not given in the using template and in the template contract. There is a conflict. | ||
2120 | HttpStatus: 409 | ||
2121 | |||
2122 | |||
2123 | |||
2124 | # 2900-2949: webhook operations | ||
2125 | |||
2126 | Value: 2900 | ||
2127 | Name: MERCHANT_PRIVATE_POST_WEBHOOKS_CONFLICT_WEBHOOK_EXISTS | ||
2128 | Description: The webhook ID elready exists. | ||
2129 | HttpStatus: 409 | ||
2130 | |||
2131 | Value: 2910 | ||
2132 | Name: MERCHANT_PRIVATE_POST_PENDING_WEBHOOKS_CONFLICT_PENDING_WEBHOOK_EXISTS | ||
2133 | Description: The webhook serial elready exists. | ||
2134 | HttpStatus: 409 | ||
2135 | |||
2136 | |||
1662 | 2137 | ||
1663 | 2138 | ||
1664 | 2139 | ||
@@ -1675,6 +2150,16 @@ Name: AUDITOR_EXCHANGE_SIGNING_KEY_REVOKED | |||
1675 | Description: The exchange key used for the signature on the deposit confirmation was revoked. | 2150 | Description: The exchange key used for the signature on the deposit confirmation was revoked. |
1676 | HttpStatus: 410 | 2151 | HttpStatus: 410 |
1677 | 2152 | ||
2153 | Value: 3102 | ||
2154 | Name: AUDITOR_RESOURCE_NOT_FOUND | ||
2155 | Description: The requested resource could not be found. | ||
2156 | HttpStatus: 404 | ||
2157 | |||
2158 | Value: 3103 | ||
2159 | Name: AUDITOR_URI_MISSING_PATH_COMPONENT | ||
2160 | Description: The URI is missing a path component. | ||
2161 | HttpStatus: 400 | ||
2162 | |||
1678 | 2163 | ||
1679 | # 5000 - 5999: Reserved for bank | 2164 | # 5000 - 5999: Reserved for bank |
1680 | # 5000 - 5099: Reserved for BANK_GENERIC | 2165 | # 5000 - 5099: Reserved for BANK_GENERIC |
@@ -1691,19 +2176,14 @@ HttpStatus: 409 | |||
1691 | 2176 | ||
1692 | Value: 5103 | 2177 | Value: 5103 |
1693 | Name: BANK_NEGATIVE_NUMBER_AMOUNT | 2178 | Name: BANK_NEGATIVE_NUMBER_AMOUNT |
1694 | Description: Negative number was used (as value and/or fraction) to initiate a Amount object. | 2179 | Description: Negative numbers are not allowed (as value and/or fraction) to instantiate an amount object. |
1695 | HttpStatus: 400 | 2180 | HttpStatus: 400 |
1696 | 2181 | ||
1697 | Value: 5104 | 2182 | Value: 5104 |
1698 | Name: BANK_NUMBER_TOO_BIG | 2183 | Name: BANK_NUMBER_TOO_BIG |
1699 | Description: A number too big was used (as value and/or fraction) to initiate a amount object. | 2184 | Description: A too big number was used (as value and/or fraction) to instantiate an amount object. |
1700 | HttpStatus: 400 | 2185 | HttpStatus: 400 |
1701 | 2186 | ||
1702 | Value: 5105 | ||
1703 | Name: BANK_LOGIN_FAILED | ||
1704 | Description: Could not login for the requested operation. | ||
1705 | HttpStatus: 403 | ||
1706 | |||
1707 | Value: 5106 | 2187 | Value: 5106 |
1708 | Name: BANK_UNKNOWN_ACCOUNT | 2188 | Name: BANK_UNKNOWN_ACCOUNT |
1709 | Description: The bank account referenced in the requested operation was not found. | 2189 | Description: The bank account referenced in the requested operation was not found. |
@@ -1754,6 +2234,155 @@ Name: BANK_ANCIENT_TRANSACTION_GONE | |||
1754 | Description: The client requested a transaction that is so far in the past, that it has been forgotten by the bank. | 2234 | Description: The client requested a transaction that is so far in the past, that it has been forgotten by the bank. |
1755 | HttpStatus: 410 | 2235 | HttpStatus: 410 |
1756 | 2236 | ||
2237 | Value: 5116 | ||
2238 | Name: BANK_ABORT_CONFIRM_CONFLICT | ||
2239 | Description: The client attempted to abort a transaction that was already confirmed. | ||
2240 | HttpStatus: 409 | ||
2241 | |||
2242 | Value: 5117 | ||
2243 | Name: BANK_CONFIRM_ABORT_CONFLICT | ||
2244 | Description: The client attempted to confirm a transaction that was already aborted. | ||
2245 | HttpStatus: 409 | ||
2246 | |||
2247 | Value: 5118 | ||
2248 | Name: BANK_REGISTER_CONFLICT | ||
2249 | Description: The client attempted to register an account with the same name. | ||
2250 | HttpStatus: 409 | ||
2251 | |||
2252 | Value: 5119 | ||
2253 | Name: BANK_POST_WITHDRAWAL_OPERATION_REQUIRED | ||
2254 | Description: The client attempted to confirm a withdrawal operation before the wallet posted the required details. | ||
2255 | HttpStatus: 400 | ||
2256 | |||
2257 | Value: 5120 | ||
2258 | Name: BANK_RESERVED_USERNAME_CONFLICT | ||
2259 | Description: The client tried to register a new account under a reserved username (like 'admin' for example). | ||
2260 | HttpStatus: 409 | ||
2261 | |||
2262 | Value: 5121 | ||
2263 | Name: BANK_REGISTER_USERNAME_REUSE | ||
2264 | Description: The client tried to register a new account with an username already in use. | ||
2265 | HttpStatus: 409 | ||
2266 | |||
2267 | Value: 5122 | ||
2268 | Name: BANK_REGISTER_PAYTO_URI_REUSE | ||
2269 | Description: The client tried to register a new account with a payto:// URI already in use. | ||
2270 | HttpStatus: 409 | ||
2271 | |||
2272 | Value: 5123 | ||
2273 | Name: BANK_ACCOUNT_BALANCE_NOT_ZERO | ||
2274 | Description: The client tried to delete an account with a non null balance. | ||
2275 | HttpStatus: 409 | ||
2276 | |||
2277 | Value: 5124 | ||
2278 | Name: BANK_UNKNOWN_CREDITOR | ||
2279 | Description: The client tried to create a transaction or an operation that credit an unknown account. | ||
2280 | HttpStatus: 409 | ||
2281 | |||
2282 | Value: 5125 | ||
2283 | Name: BANK_UNKNOWN_DEBTOR | ||
2284 | Description: The client tried to create a transaction or an operation that debit an unknown account. | ||
2285 | HttpStatus: 409 | ||
2286 | |||
2287 | Value: 5126 | ||
2288 | Name: BANK_ACCOUNT_IS_EXCHANGE | ||
2289 | Description: The client tried to perform an action prohibited for exchange accounts. | ||
2290 | HttpStatus: 409 | ||
2291 | |||
2292 | Value: 5127 | ||
2293 | Name: BANK_ACCOUNT_IS_NOT_EXCHANGE | ||
2294 | Description: The client tried to perform an action reserved for exchange accounts. | ||
2295 | HttpStatus: 409 | ||
2296 | |||
2297 | Value: 5128 | ||
2298 | Name: BANK_BAD_CONVERSION | ||
2299 | Description: Received currency conversion is wrong. | ||
2300 | HttpStatus: 409 | ||
2301 | |||
2302 | Value: 5129 | ||
2303 | Name: BANK_MISSING_TAN_INFO | ||
2304 | Description: The account referenced in this operation is missing tan info for the chosen channel. | ||
2305 | HttpStatus: 409 | ||
2306 | |||
2307 | Value: 5130 | ||
2308 | Name: BANK_CONFIRM_INCOMPLETE | ||
2309 | Description: The client attempted to confirm a transaction with incomplete info. | ||
2310 | HttpStatus: 409 | ||
2311 | |||
2312 | Value: 5131 | ||
2313 | Name: BANK_TAN_RATE_LIMITED | ||
2314 | Description: The request rate is too high. The server is refusing requests to guard against brute-force attacks. | ||
2315 | HttpStatus: 429 | ||
2316 | |||
2317 | Value: 5132 | ||
2318 | Name: BANK_TAN_CHANNEL_NOT_SUPPORTED | ||
2319 | Description: This TAN channel is not supported. | ||
2320 | HttpStatus: 501 | ||
2321 | |||
2322 | Value: 5133 | ||
2323 | Name: BANK_TAN_CHANNEL_SCRIPT_FAILED | ||
2324 | Description: Failed to send TAN using the helper script. Either script is not found, or script timeout, or script terminated with a non-successful result. | ||
2325 | HttpStatus: 500 | ||
2326 | |||
2327 | Value: 5134 | ||
2328 | Name: BANK_TAN_CHALLENGE_FAILED | ||
2329 | Description: The client's response to the challenge was invalid. | ||
2330 | HttpStatus: 403 | ||
2331 | |||
2332 | Value: 5135 | ||
2333 | Name: BANK_NON_ADMIN_PATCH_LEGAL_NAME | ||
2334 | Description: A non-admin user has tried to change their legal name. | ||
2335 | HttpStatus: 409 | ||
2336 | |||
2337 | Value: 5136 | ||
2338 | Name: BANK_NON_ADMIN_PATCH_DEBT_LIMIT | ||
2339 | Description: A non-admin user has tried to change their debt limit. | ||
2340 | HttpStatus: 409 | ||
2341 | |||
2342 | Value: 5137 | ||
2343 | Name: BANK_NON_ADMIN_PATCH_MISSING_OLD_PASSWORD | ||
2344 | Description: A non-admin user has tried to change their password whihout providing the current one. | ||
2345 | HttpStatus: 409 | ||
2346 | |||
2347 | Value: 5138 | ||
2348 | Name: BANK_PATCH_BAD_OLD_PASSWORD | ||
2349 | Description: Provided old password does not match current password. | ||
2350 | HttpStatus: 409 | ||
2351 | |||
2352 | Value: 5139 | ||
2353 | Name: BANK_PATCH_ADMIN_EXCHANGE | ||
2354 | Description: An admin user has tried to become an exchange. | ||
2355 | HttpStatus: 409 | ||
2356 | |||
2357 | Value: 5140 | ||
2358 | Name: BANK_NON_ADMIN_PATCH_CASHOUT | ||
2359 | Description: A non-admin user has tried to change their cashout account. | ||
2360 | HttpStatus: 409 | ||
2361 | |||
2362 | Value: 5141 | ||
2363 | Name: BANK_NON_ADMIN_PATCH_CONTACT | ||
2364 | Description: A non-admin user has tried to change their contact info. | ||
2365 | HttpStatus: 409 | ||
2366 | |||
2367 | Value: 5142 | ||
2368 | Name: BANK_ADMIN_CREDITOR | ||
2369 | Description: The client tried to create a transaction that credit the admin account. | ||
2370 | HttpStatus: 409 | ||
2371 | |||
2372 | Value: 5143 | ||
2373 | Name: BANK_CHALLENGE_NOT_FOUND | ||
2374 | Description: The referenced challenge was not found. | ||
2375 | HttpStatus: 404 | ||
2376 | |||
2377 | Value: 5144 | ||
2378 | Name: BANK_TAN_CHALLENGE_EXPIRED | ||
2379 | Description: The referenced challenge has expired. | ||
2380 | HttpStatus: 409 | ||
2381 | |||
2382 | Value: 5145 | ||
2383 | Name: BANK_NON_ADMIN_SET_TAN_CHANNEL | ||
2384 | Description: A non-admin user has tried to create an account with 2fa. | ||
2385 | HttpStatus: 409 | ||
1757 | 2386 | ||
1758 | # 6000 - 6999: Reserved for sync | 2387 | # 6000 - 6999: Reserved for sync |
1759 | # 6000 - 6099: Reserved for SYNC_GENERIC | 2388 | # 6000 - 6099: Reserved for SYNC_GENERIC |
@@ -1823,6 +2452,17 @@ Name: SYNC_MISSING_CONTENT_LENGTH | |||
1823 | Description: The "Content-length" field for the upload is missing. | 2452 | Description: The "Content-length" field for the upload is missing. |
1824 | HttpStatus: 400 | 2453 | HttpStatus: 400 |
1825 | 2454 | ||
2455 | Value: 6113 | ||
2456 | Name: SYNC_GENERIC_BACKEND_ERROR | ||
2457 | Description: Sync had problems communicating with its payment backend. | ||
2458 | HttpStatus: 502 | ||
2459 | |||
2460 | Value: 6114 | ||
2461 | Name: SYNC_GENERIC_BACKEND_TIMEOUT | ||
2462 | Description: Sync experienced a timeout communicating with its payment backend. | ||
2463 | HttpStatus: 504 | ||
2464 | |||
2465 | |||
1826 | 2466 | ||
1827 | # 7000 - 7999: Reserved for wallet | 2467 | # 7000 - 7999: Reserved for wallet |
1828 | 2468 | ||
@@ -1907,8 +2547,8 @@ Description: A group of withdrawal operations (typically for the same reserve at | |||
1907 | HttpStatus: 0 | 2547 | HttpStatus: 0 |
1908 | 2548 | ||
1909 | Value: 7016 | 2549 | Value: 7016 |
1910 | Name: WALLET_TIPPING_COIN_SIGNATURE_INVALID | 2550 | Name: WALLET_REWARD_COIN_SIGNATURE_INVALID |
1911 | Description: The signature on a coin by the exchange's denomination key (obtained through the merchant via tipping) is invalid after unblinding it. | 2551 | Description: The signature on a coin by the exchange's denomination key (obtained through the merchant via a reward) is invalid after unblinding it. |
1912 | HttpStatus: 0 | 2552 | HttpStatus: 0 |
1913 | 2553 | ||
1914 | Value: 7017 | 2554 | Value: 7017 |
@@ -1936,7 +2576,82 @@ Name: WALLET_PENDING_OPERATION_FAILED | |||
1936 | Description: A pending operation failed, and thus the request can't be completed. | 2576 | Description: A pending operation failed, and thus the request can't be completed. |
1937 | HttpStatus: 0 | 2577 | HttpStatus: 0 |
1938 | 2578 | ||
1939 | # 8000 - 8999: Reserved for Anastasis | 2579 | Value: 7022 |
2580 | Name: WALLET_PAY_MERCHANT_SERVER_ERROR | ||
2581 | Description: A payment was attempted, but the merchant had an internal server error (5xx). | ||
2582 | HttpStatus: 0 | ||
2583 | |||
2584 | Value: 7023 | ||
2585 | Name: WALLET_CRYPTO_WORKER_ERROR | ||
2586 | Description: The crypto worker failed. | ||
2587 | HttpStatus: 0 | ||
2588 | |||
2589 | Value: 7024 | ||
2590 | Name: WALLET_CRYPTO_WORKER_BAD_REQUEST | ||
2591 | Description: The crypto worker received a bad request. | ||
2592 | HttpStatus: 0 | ||
2593 | |||
2594 | Value: 7025 | ||
2595 | Name: WALLET_WITHDRAWAL_KYC_REQUIRED | ||
2596 | Description: A KYC step is required before withdrawal can proceed. | ||
2597 | HttpStatus: 0 | ||
2598 | |||
2599 | Value: 7026 | ||
2600 | Name: WALLET_DEPOSIT_GROUP_INSUFFICIENT_BALANCE | ||
2601 | Description: The wallet does not have sufficient balance to create a deposit group. | ||
2602 | HttpStatus: 0 | ||
2603 | |||
2604 | Value: 7027 | ||
2605 | Name: WALLET_PEER_PUSH_PAYMENT_INSUFFICIENT_BALANCE | ||
2606 | Description: The wallet does not have sufficient balance to create a peer push payment. | ||
2607 | HttpStatus: 0 | ||
2608 | |||
2609 | Value: 7028 | ||
2610 | Name: WALLET_PEER_PULL_PAYMENT_INSUFFICIENT_BALANCE | ||
2611 | Description: The wallet does not have sufficient balance to pay for an invoice. | ||
2612 | HttpStatus: 0 | ||
2613 | |||
2614 | Value: 7029 | ||
2615 | Name: WALLET_REFRESH_GROUP_INCOMPLETE | ||
2616 | Description: A group of refresh operations has errors and will be tried again later. | ||
2617 | HttpStatus: 0 | ||
2618 | |||
2619 | Value: 7030 | ||
2620 | Name: WALLET_EXCHANGE_BASE_URL_MISMATCH | ||
2621 | Description: The exchange's self-reported base URL does not match the one that the wallet is using. | ||
2622 | HttpStatus: 0 | ||
2623 | |||
2624 | Value: 7031 | ||
2625 | Name: WALLET_ORDER_ALREADY_PAID | ||
2626 | Description: The order has already been paid by another wallet. | ||
2627 | HttpStatus: 0 | ||
2628 | |||
2629 | Value: 7032 | ||
2630 | Name: WALLET_EXCHANGE_UNAVAILABLE | ||
2631 | Description: An exchange that is required for some request is currently not available. | ||
2632 | HttpStatus: 0 | ||
2633 | |||
2634 | Value: 7033 | ||
2635 | Name: WALLET_EXCHANGE_ENTRY_USED | ||
2636 | Description: An exchange entry is still used by the exchange, thus it can't be deleted without purging. | ||
2637 | HttpStatus: 0 | ||
2638 | |||
2639 | Value: 7034 | ||
2640 | Name: WALLET_DB_UNAVAILABLE | ||
2641 | Description: The wallet database is unavailable and the wallet thus is not operational. | ||
2642 | HttpStatus: 0 | ||
2643 | |||
2644 | Value: 7035 | ||
2645 | Name: WALLET_TALER_URI_MALFORMED | ||
2646 | Description: A taler:// URI is malformed and can't be parsed. | ||
2647 | HttpStatus: 0 | ||
2648 | |||
2649 | Value: 7036 | ||
2650 | Name: WALLET_CORE_REQUEST_CANCELLED | ||
2651 | Description: A wallet-core request was cancelled and thus can't provide a response. | ||
2652 | HttpStatus: 0 | ||
2653 | |||
2654 | # 8000 - 8499: Reserved for Anastasis | ||
1940 | 2655 | ||
1941 | Value: 8000 | 2656 | Value: 8000 |
1942 | Name: ANASTASIS_GENERIC_BACKEND_TIMEOUT | 2657 | Name: ANASTASIS_GENERIC_BACKEND_TIMEOUT |
@@ -2278,8 +2993,31 @@ Name: ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED | |||
2278 | Description: The reducer already synchronized with all providers. | 2993 | Description: The reducer already synchronized with all providers. |
2279 | HttpStatus: 0 | 2994 | HttpStatus: 0 |
2280 | 2995 | ||
2996 | # 8500 - 8600: Frosix | ||
2997 | |||
2998 | # 8600 - 8700: Donau | ||
2281 | 2999 | ||
2282 | # 9000 - 9998: LibEuFin. | 3000 | Value: 8607 |
3001 | Name: DONAU_GENERIC_KEYS_MISSING | ||
3002 | Description: 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. | ||
3003 | HttpStatus: 503 | ||
3004 | |||
3005 | Value: 8608 | ||
3006 | Name: DONAU_CHARITY_SIGNATURE_INVALID | ||
3007 | Description: The signature of the charity key is not valid. | ||
3008 | HttpStatus: 403 | ||
3009 | |||
3010 | Value: 8609 | ||
3011 | Name: DONAU_CHARITY_NOT_FOUND | ||
3012 | Description: The charity is unknown. | ||
3013 | HttpStatus: 404 | ||
3014 | |||
3015 | Value: 8610 | ||
3016 | Name: DONAU_EXCEEDING_DONATION_LIMIT | ||
3017 | Description: The donation amount specified in the request exceeds the limit of the charity. | ||
3018 | HttpStatus: 400 | ||
3019 | |||
3020 | # 9000 - 9599: LibEuFin. | ||
2283 | 3021 | ||
2284 | Value: 9000 | 3022 | Value: 9000 |
2285 | Name: LIBEUFIN_NEXUS_GENERIC_ERROR | 3023 | Name: LIBEUFIN_NEXUS_GENERIC_ERROR |
@@ -2301,7 +3039,70 @@ Name: LIBEUFIN_SANDBOX_UNCAUGHT_EXCEPTION | |||
2301 | Description: An uncaught exception happened in the LibEuFin sandbox service. | 3039 | Description: An uncaught exception happened in the LibEuFin sandbox service. |
2302 | HttpStatus: 500 | 3040 | HttpStatus: 500 |
2303 | 3041 | ||
3042 | # 9600 - 9749: Taldir | ||
3043 | Value: 9600 | ||
3044 | Name: TALDIR_METHOD_NOT_SUPPORTED | ||
3045 | Description: This validation method is not supported by the service. | ||
3046 | HttpStatus: 404 | ||
3047 | |||
3048 | Value: 9601 | ||
3049 | Name: TALDIR_REGISTER_RATE_LIMITED | ||
3050 | Description: Number of allowed attempts for initiating a challenge exceeded. | ||
3051 | HttpStatus: 429 | ||
3052 | |||
3053 | # 9750-9999: Challenger | ||
3054 | Value: 9750 | ||
3055 | Name: CHALLENGER_GENERIC_CLIENT_UNKNOWN | ||
3056 | Description: The client is unknown or unauthorized. | ||
3057 | HttpStatus: 404 | ||
3058 | |||
3059 | Value: 9751 | ||
3060 | Name: CHALLENGER_GENERIC_CLIENT_FORBIDDEN_BAD_REDIRECT_URI | ||
3061 | Description: The client is not authorized to use the given redirect URI. | ||
3062 | HttpStatus: 403 | ||
3063 | |||
3064 | Value: 9752 | ||
3065 | Name: CHALLENGER_HELPER_EXEC_FAILED | ||
3066 | Description: The service failed to execute its helper process to send the challenge. | ||
3067 | HttpStatus: 500 | ||
3068 | |||
3069 | Value: 9753 | ||
3070 | Name: CHALLENGER_GRANT_UNKNOWN | ||
3071 | Description: The grant is unknown to the service (it could also have expired). | ||
3072 | HttpStatus: 404 | ||
3073 | |||
3074 | Value: 9754 | ||
3075 | Name: CHALLENGER_CLIENT_FORBIDDEN_BAD_CODE | ||
3076 | Description: The code given is not even well-formed. | ||
3077 | HttpStatus: 403 | ||
3078 | |||
3079 | Value: 9755 | ||
3080 | Name: CHALLENGER_GENERIC_VALIDATION_UNKNOWN | ||
3081 | Description: The service is not aware of the referenced validation process. | ||
3082 | HttpStatus: 404 | ||
3083 | |||
3084 | Value: 9756 | ||
3085 | Name: CHALLENGER_CLIENT_FORBIDDEN_INVALID_CODE | ||
3086 | Description: The code given is not valid. | ||
3087 | HttpStatus: 403 | ||
3088 | |||
3089 | Value: 9757 | ||
3090 | Name: CHALLENGER_TOO_MANY_ATTEMPTS | ||
3091 | Description: Too many attempts have been made, validation is temporarily disabled for this address. | ||
3092 | HttpStatus: 429 | ||
3093 | |||
3094 | Value: 9758 | ||
3095 | Name: CHALLENGER_INVALID_PIN | ||
3096 | Description: The PIN code provided is incorrect. | ||
3097 | HttpStatus: 403 | ||
3098 | |||
3099 | Value: 9759 | ||
3100 | Name: CHALLENGER_MISSING_ADDRESS | ||
3101 | Description: The token cannot be valid as no address was ever provided by the client. | ||
3102 | HttpStatus: 409 | ||
3103 | |||
2304 | 3104 | ||
3105 | # Some of our build systems expect the range to be < 10k, so let's keep it like this for now. | ||
2305 | Value: 9999 | 3106 | Value: 9999 |
2306 | Name: END | 3107 | Name: END |
2307 | Description: End of error code range. | 3108 | Description: 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 @@ | |||
1 | GNU Taler Error Codes | ||
2 | --------------------- | ||
3 | |||
4 | Entries | ||
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 | |||
24 | Contact: oec-taler@kesim.org | 24 | Contact: oec-taler@kesim.org |
25 | References: Design document 24 | 25 | References: Design document 24 |
26 | 26 | ||
27 | Identifier: P2P_PAYMENTS | 27 | Identifier: POLICY_REFUND |
28 | Description: Support for payments directly between wallets. | 28 | Description: Support for refund in payments. |
29 | Critical: false | 29 | Critical: false |
30 | Contact: team@taler.net | 30 | Contact: team@taler.net |
31 | References: Design document 13 | 31 | References: Design document 13 |
32 | 32 | ||
33 | Identifier: POLICY_AUCTION | ||
34 | Description: Auction support via libbrandt | ||
35 | Critical: false | ||
36 | Contact: oec-taler@kesim.org | ||
37 | References: Design document 32 | ||
33 | 38 | ||
39 | Identifier: POLICY_ESCROW | ||
40 | Description: 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. | ||
41 | Critical: false | ||
42 | Contact: oec-taler@kesim.org | ||
43 | References: 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 @@ | |||
1 | GNS 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 | =================== =========================================================== | ||
4 | Suffix {{Name}} | ||
5 | ------------------- ----------------------------------------------------------- | ||
6 | Zone Key {{Key}} | ||
7 | Comment {{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 @@ | |||
1 | all: check | ||
2 | |||
3 | check: 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 | |||
23 | Identifier: BUSINESS_NAME | ||
24 | Description: Full legal name of the business. | ||
25 | Category: business | ||
26 | |||
27 | Identifier: BUSINESS_TAX_ID | ||
28 | Description: Tax identifier of the business. | ||
29 | Category: business | ||
30 | Comment: Format may depend on the country of residence of the business. | ||
31 | |||
32 | Identifier: FULL_NAME | ||
33 | Description: Full legal name of an individual. | ||
34 | Category: individual | ||
35 | |||
36 | Identifier: CONTACT_EMAIL | ||
37 | Description: E-mail address to contact the individual or business. | ||
38 | Category: both | ||
39 | Comment: Can be validated via E-mail with TAN. | ||
40 | |||
41 | Identifier: CONTACT_PHONE | ||
42 | Description: Phone number to contact the individual or business. | ||
43 | Category: both | ||
44 | Comment: Can be validated via SMS-TAN or phone call. | ||
45 | |||
46 | Identifier: CONTACT_DNS_DOMAIN | ||
47 | Description: DNS domain name owned by the individual or business. | ||
48 | Category: both | ||
49 | Comment: Can be validated by having the owner set an appropriate DNS TXT record. | ||
50 | |||
51 | Identifier: CONTACT_WEB_DOMAIN | ||
52 | Description: Web site owned by the individual or business. | ||
53 | Category: both | ||
54 | Comment: Can be validated by having the owner serve an appropriate well-known page. | ||
55 | |||
56 | Identifier: ADDRESS_STREET | ||
57 | Description: Street address (including house number) of the individual or business. | ||
58 | Category: both | ||
59 | |||
60 | Identifier: ADDRESS_CITY | ||
61 | Description: Name of the city where the individual or business resides. | ||
62 | Category: both | ||
63 | |||
64 | Identifier: ADDRESS_COUNTRY | ||
65 | Description: Name of the country where the individual or business resides. | ||
66 | Category: 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 @@ | |||
1 | FILES=gnunet_dht_block_types.h | 1 | FILES=gnunet_dht_block_types.h gnunet_dht_block_types.rst |
2 | all: check $(FILES) | 2 | all: check $(FILES) |
3 | 3 | ||
4 | check: | 4 | check: |
@@ -15,4 +15,14 @@ gnunet_dht_block_types.h.tmp: registry.rec h.template | |||
15 | gnunet_dht_block_types.h: h.header gnunet_dht_block_types.h.tmp h.footer | 15 | gnunet_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 | ||
18 | gnunet_dht_block_types.rst.tmp: registry.rec rst.template | ||
19 | ../format.sh rst.template < registry.rec > $@ | ||
20 | |||
21 | rst.header.tmp: | ||
22 | cat README POLICY rst.header.template > $@ | ||
23 | |||
24 | gnunet_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 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | Developers working on GNUnet or packages based on GNUnet should | ||
5 | feel free to extend this registry. Entries may be deleted if | ||
6 | no code using them is still expected to be in production anywhere. | ||
7 | |||
8 | Updating the name of the package or subsystem is allowed provided | ||
9 | that the code using the signature is being moved, as those fields | ||
10 | are 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 @@ | |||
1 | R5N DHT Block Types | ||
2 | ------------------- | ||
3 | |||
1 | This registry is for GNUnet DHT Block Types. | 4 | This registry is for GNUnet DHT Block Types. |
2 | 5 | ||
3 | DHT Block Types types uniquely identify the different kinds | 6 | DHT Block Types types uniquely identify the different kinds |
@@ -7,3 +10,4 @@ This registry is used to ensure that the names and numeric values | |||
7 | used to identify block types are uniquely defined and to | 10 | used to identify block types are uniquely defined and to |
8 | allow DHT implementors to find out details about the | 11 | allow DHT implementors to find out details about the |
9 | respective semantics and human-readable syntax. | 12 | respective 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. | |||
37 | References: None | 37 | References: None |
38 | 38 | ||
39 | Number: 7 | 39 | Number: 7 |
40 | Name: DHT_HELLO | 40 | Name: LEGACY_HELLO |
41 | Comment: Type of a block that contains a HELLO for a peer. | 41 | Comment: Legacy type of a block that contains a HELLO for a peer. |
42 | References: None | 42 | References: None |
43 | 43 | ||
44 | Number: 8 | 44 | Number: 8 |
@@ -67,9 +67,9 @@ Comment: Block type for a revocation message by which a key is revoked. | |||
67 | References: None | 67 | References: None |
68 | 68 | ||
69 | Number: 13 | 69 | Number: 13 |
70 | Name: DHT_URL_HELLO | 70 | Name: DHT_HELLO |
71 | Comment: Type of a block that contains a DHT-NG HELLO for a peer. | 71 | Comment: Type of a block that contains a DHT-NG HELLO for a peer. |
72 | References: None | 72 | References: LSD-0004 |
73 | 73 | ||
74 | Number: 22 | 74 | Number: 22 |
75 | Name: REGEX | 75 | Name: 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 @@ | |||
1 | Entries | ||
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 @@ | |||
1 | gnunet_error_codes.c | ||
2 | gnunet_error_codes.go | ||
3 | gnunet_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 @@ | |||
1 | FILES=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 | |||
7 | all: check $(FILES) | ||
8 | |||
9 | check: registry.rec | ||
10 | recfix --check registry.rec | ||
11 | |||
12 | distclean: | ||
13 | rm -f *.tmp | ||
14 | |||
15 | clean: | ||
16 | rm -f $(FILES) *.tmp | ||
17 | |||
18 | prep: | ||
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. | ||
25 | combined.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 | |||
29 | combined-escaped.tmp: combined.tmp | ||
30 | sed 's/"/\\"/g' combined.tmp > $@ | ||
31 | |||
32 | length.tmp: combined.tmp | ||
33 | recsel -p "Count(Description):ECS_LENGTH" combined.tmp > $@ | ||
34 | |||
35 | gnunet_error_codes.h.tmp: combined.tmp h.template | ||
36 | ../format.sh h.template < combined.tmp > $@ | ||
37 | |||
38 | gnunet_error_codes.h: h.header gnunet_error_codes.h.tmp h.footer | ||
39 | cat h.header gnunet_error_codes.h.tmp h.footer > $@ | ||
40 | |||
41 | gnunet_error_codes.c.tmp: combined-escaped.tmp c.template | ||
42 | ../format.sh c.template < combined-escaped.tmp > $@ | ||
43 | |||
44 | gnunet_error_codes-length.c.tmp: length.tmp c-length.template | ||
45 | ../format.sh c-length.template < length.tmp > $@ | ||
46 | |||
47 | gnunet_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 | |||
50 | gnunet_error_codes.ts.tmp: combined.tmp ts.template | ||
51 | ../format.sh ts.template < combined.tmp > $@ | ||
52 | |||
53 | gnunet_error_codes.ts: ts.header gnunet_error_codes.ts.tmp ts.footer | ||
54 | cat ts.header gnunet_error_codes.ts.tmp ts.footer > $@ | ||
55 | |||
56 | gnunet_error_codes.go.tmp: combined.tmp go.template | ||
57 | ../format.sh go.template < combined.tmp > $@ | ||
58 | |||
59 | gnunet_error_codes.go: go.header gnunet_error_codes.go.tmp go.footer | ||
60 | cat go.header gnunet_error_codes.go.tmp go.footer > $@ | ||
61 | |||
62 | gnunet_error_codes.rst.tmp: combined.tmp rst.template | ||
63 | ../format.sh rst.template < combined.tmp > $@ | ||
64 | |||
65 | rst.header.tmp: | ||
66 | cat README POLICY rst.header.template > $@ | ||
67 | |||
68 | gnunet_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 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | Developers working on GNUnet or packages based on GNUnet should | ||
5 | feel free to extend this registry. Entries may be deleted if | ||
6 | no code using them is still expected to be in production anywhere. | ||
7 | |||
8 | Updating the name of the package or subsystem is allowed provided | ||
9 | that the code using the signature is being moved, as those fields | ||
10 | are 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 @@ | |||
1 | GNUnet Error Codes | ||
2 | ------------------ | ||
3 | |||
4 | GNUnet 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 | */ | ||
9 | static 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 | |||
4 | const char * | ||
5 | GNUNET_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 | |||
30 | unsigned int | ||
31 | GNUNET_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 | |||
56 | unsigned int | ||
57 | GNUNET_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 | */ | ||
33 | struct 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 | */ | ||
55 | static 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 | |||
21 | package gana | ||
22 | |||
23 | const ( | ||
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 | */ | ||
12 | const char * | ||
13 | GNUNET_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 | */ | ||
22 | unsigned int | ||
23 | GNUNET_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 | */ | ||
34 | unsigned int | ||
35 | GNUNET_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 | ||
30 | extern "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 | */ | ||
42 | enum 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 | |||
22 | Value: 0 | ||
23 | Name: NONE | ||
24 | Description: No error (success). | ||
25 | HttpStatus: 0 | ||
26 | |||
27 | Value: 1 | ||
28 | Name: UNKNOWN | ||
29 | Description: Unknown and unspecified error. | ||
30 | HttpStatus: 500 | ||
31 | |||
32 | Value: 101 | ||
33 | Name: SERVICE_COMMUNICATION_FAILED | ||
34 | Description: Communication with service failed. | ||
35 | HttpStatus: 500 | ||
36 | |||
37 | # IDENTITY Error Codes | ||
38 | |||
39 | Value: 200 | ||
40 | Name: IDENTITY_NOT_FOUND | ||
41 | Description: Ego not found. | ||
42 | HttpStatus: 404 | ||
43 | |||
44 | Value: 201 | ||
45 | Name: IDENTITY_NAME_CONFLICT | ||
46 | Description: Identifier already in use for another ego. | ||
47 | HttpStatus: 409 | ||
48 | |||
49 | Value: 202 | ||
50 | Name: IDENTITY_INVALID | ||
51 | Description: The given ego is invalid or malformed. | ||
52 | HttpStatus: 500 | ||
53 | |||
54 | # NAMESTORE Error Codes | ||
55 | |||
56 | Value: 5000 | ||
57 | Name: NAMESTORE_UNKNOWN | ||
58 | Description: Unknown namestore error. | ||
59 | HttpStatus: 500 | ||
60 | |||
61 | Value: 5001 | ||
62 | Name: NAMESTORE_ITERATION_FAILED | ||
63 | Description: Zone iteration failed. | ||
64 | HttpStatus: 500 | ||
65 | |||
66 | Value: 5002 | ||
67 | Name: NAMESTORE_ZONE_NOT_FOUND | ||
68 | Description: Zone not found. | ||
69 | HttpStatus: 404 | ||
70 | |||
71 | Value: 5003 | ||
72 | Name: NAMESTORE_RECORD_NOT_FOUND | ||
73 | Description: Record not found. | ||
74 | HttpStatus: 404 | ||
75 | |||
76 | Value: 5004 | ||
77 | Name: NAMESTORE_RECORD_DELETE_FAILED | ||
78 | Description: Zone iteration failed. | ||
79 | HttpStatus: 500 | ||
80 | |||
81 | Value: 5005 | ||
82 | Name: NAMESTORE_ZONE_EMPTY | ||
83 | Description: Zone does not contain any records. | ||
84 | HttpStatus: 404 | ||
85 | |||
86 | Value: 5006 | ||
87 | Name: NAMESTORE_LOOKUP_ERROR | ||
88 | Description: Failed to lookup record. | ||
89 | HttpStatus: 500 | ||
90 | |||
91 | Value: 5007 | ||
92 | Name: NAMESTORE_NO_RECORDS_GIVEN | ||
93 | Description: No records given. | ||
94 | HttpStatus: 400 | ||
95 | |||
96 | Value: 5008 | ||
97 | Name: NAMESTORE_RECORD_DATA_INVALID | ||
98 | Description: Record data invalid. | ||
99 | HttpStatus: 400 | ||
100 | |||
101 | Value: 5009 | ||
102 | Name: NAMESTORE_NO_LABEL_GIVEN | ||
103 | Description: No label given. | ||
104 | HttpStatus: 400 | ||
105 | |||
106 | Value: 5010 | ||
107 | Name: NAMESTORE_NO_RESULTS | ||
108 | Description: No results given. | ||
109 | HttpStatus: 404 | ||
110 | |||
111 | Value: 5011 | ||
112 | Name: NAMESTORE_RECORD_EXISTS | ||
113 | Description: Record already exists. | ||
114 | HttpStatus: 409 | ||
115 | |||
116 | Value: 5012 | ||
117 | Name: NAMESTORE_RECORD_TOO_BIG | ||
118 | Description: Record size exceeds maximum limit. | ||
119 | HttpStatus: 500 | ||
120 | |||
121 | Value: 5013 | ||
122 | Name: NAMESTORE_BACKEND_FAILED | ||
123 | Description: There was an error in the database backend. | ||
124 | HttpStatus: 500 | ||
125 | |||
126 | Value: 5014 | ||
127 | Name: NAMESTORE_STORE_FAILED | ||
128 | Description: Failed to store the given records. | ||
129 | HttpStatus: 500 | ||
130 | |||
131 | Value: 5015 | ||
132 | Name: NAMESTORE_LABEL_INVALID | ||
133 | Description: Label invalid or malformed. | ||
134 | HttpStatus: 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 @@ | |||
1 | Entries | ||
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 | |||
21 | export 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 @@ | |||
1 | FILES=gnunet_overlay_protocols.h gnunet_overlay_protocols.rst | ||
2 | all: check $(FILES) | ||
3 | |||
4 | check: | ||
5 | recfix --check registry.rec | ||
6 | |||
7 | distclean: | ||
8 | rm -f *.tmp | ||
9 | clean: | ||
10 | rm -f $(FILES) *.tmp | ||
11 | |||
12 | gnunet_overlay_protocols.h.tmp: registry.rec h.template | ||
13 | ../format.sh h.template < registry.rec > $@ | ||
14 | |||
15 | gnunet_overlay_protocols.h: h.header gnunet_overlay_protocols.h.tmp h.footer | ||
16 | cat h.header gnunet_overlay_protocols.h.tmp h.footer > $@ | ||
17 | |||
18 | gnunet_overlay_protocols.rst.tmp: registry.rec rst.template | ||
19 | ../format.sh rst.template < registry.rec > $@ | ||
20 | |||
21 | rst.header.tmp: | ||
22 | cat rst.header.template README POLICY > $@ | ||
23 | echo "Entries" >> $@ | ||
24 | echo "^^^^^^^" >> $@ | ||
25 | |||
26 | gnunet_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 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | Each registry entry should contain three values: the "Number" of the | ||
5 | protocol, which must be above 255 (to avoid conflicts with legacy | ||
6 | Internet protocols), the "Name" of the protocol, and a "Reference" with links | ||
7 | to further information about the record type. | ||
8 | |||
9 | The "Name" must be unique in the entire registry. The value must be a | ||
10 | case insensitive ASCII string and is restricted to alphanumeric | ||
11 | characters. | ||
12 | |||
13 | Adding protocols is possible after expert review, using a | ||
14 | first-come-first-served policy for unique "Name" allocation. | ||
15 | Experts are responsible to ensure that the chosen "Name" is | ||
16 | appropriate for the record type. | ||
17 | |||
18 | The current contact(s) for expert review are reachable at | ||
19 | gns-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 @@ | |||
1 | This registry is for overlay protocols. | ||
2 | |||
3 | Overlay protocol numbers uniquely identify the different kinds | ||
4 | of protocols implemented to realize overlay service communication. | ||
5 | |||
6 | This registry is used to ensure that the names and numeric values | ||
7 | used to identify the protocols are uniquely defined and to | ||
8 | allow implementors to find out details about the respective semantics and | ||
9 | specifications. | ||
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 | |||
20 | Number: 256 | ||
21 | Name: CADET | ||
22 | Comment: CADET protocol. | ||
23 | References: 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 @@ | |||
1 | GNUnet 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 | =================== =========================================================== | ||
4 | Name GNUNET_OVERLAY_PROTOCOL_{{Name}} | ||
5 | ------------------- ----------------------------------------------------------- | ||
6 | Number {{Number}} | ||
7 | Comment {{Comment}} | ||
8 | References {{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 @@ | |||
1 | FILES=gnunet_signatures.h | 1 | FILES=gnunet_signatures.h gnunet_signatures.rst |
2 | all: check $(FILES) | 2 | all: check $(FILES) |
3 | check: | 3 | check: |
4 | recfix --check registry.rec | 4 | recfix --check registry.rec |
@@ -12,4 +12,14 @@ gnunet_signatures.h.tmp: registry.rec h.template | |||
12 | gnunet_signatures.h: h.header gnunet_signatures.h.tmp h.footer | 12 | gnunet_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 | ||
15 | gnunet_signatures.rst.tmp: registry.rec rst.template | ||
16 | ../format.sh rst.template 'Package = "GNUnet"' < registry.rec > $@ | ||
17 | |||
18 | rst.header.tmp: | ||
19 | cat README POLICY rst.header.template > $@ | ||
20 | |||
21 | gnunet_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 @@ | |||
1 | Policy | ||
2 | ^^^^^^ | ||
3 | |||
4 | Developers working on GNUnet or packages based on GNUnet should | ||
5 | feel free to extend this registry. Entries may be deleted if | ||
6 | no code using them is still expected to be in production anywhere. | ||
7 | |||
8 | Updating the name of the package or subsystem is allowed provided | ||
9 | that the code using the signature is being moved, as those fields | ||
10 | are 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 @@ | |||
1 | GNUnet Signature Purposes | ||
2 | ------------------------- | ||
3 | |||
1 | GNUnet signature purpose registry. | 4 | GNUnet signature purpose registry. |
2 | 5 | ||
3 | Every time a signature is created or verified with libgnunetutil's | 6 | Every time a signature is created or verified with libgnunetutil's |
@@ -5,3 +8,4 @@ signature functions, the signer must provide a "purpose" that provides | |||
5 | the context for the signature. By signing over the "purpose", it is | 8 | the context for the signature. By signing over the "purpose", it is |
6 | not possible for an adversary to use a signature made in one context | 9 | not possible for an adversary to use a signature made in one context |
7 | in another context. | 10 | in 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 | |||
39 | Subsystem: GNUnet-TRANSPORT | 39 | Subsystem: GNUnet-TRANSPORT |
40 | 40 | ||
41 | Number: 3 | 41 | Number: 3 |
42 | Name: REVOCATION | 42 | Name: GNS_REVOCATION |
43 | Comment: Signature for confirming a key revocation. | 43 | Comment: GNS zone key revocation |
44 | Package: GNUnet | 44 | Package: GNUnet |
45 | Subsystem: GNUnet-Revocation | 45 | Subsystem: GNS |
46 | 46 | ||
47 | Number: 4 | 47 | Number: 4 |
48 | Name: NAMESPACE_ADVERTISEMENT | 48 | Name: NAMESPACE_ADVERTISEMENT |
@@ -94,9 +94,9 @@ Subsystem: GNUnet-NSE | |||
94 | 94 | ||
95 | Number: 15 | 95 | Number: 15 |
96 | Name: GNS_RECORD_SIGN | 96 | Name: GNS_RECORD_SIGN |
97 | Comment: Signature of a gnunet naming system record block | 97 | Comment: GNS record set signature |
98 | Package: GNUnet | 98 | Package: GNUnet |
99 | Subsystem: GNUnet-GNSRECORD | 99 | Subsystem: GNS |
100 | 100 | ||
101 | Number: 16 | 101 | Number: 16 |
102 | Name: SET_ECC_KEY | 102 | Name: SET_ECC_KEY |
@@ -219,12 +219,27 @@ Package: GNUnet | |||
219 | Subsystem: GNUnet-TRANSPORT-TCP | 219 | Subsystem: 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 | ||
228 | Number: 1017 | ||
229 | Name: MASTER_AML_KEY | ||
230 | Comment: Initialize or update the status of an AML key for an AML officer | ||
231 | Package: GNU Taler | ||
232 | |||
233 | Number: 1018 | ||
234 | Name: MASTER_DRAIN_PROFIT | ||
235 | Comment: Affirm wiring of exchange profits to operator account. | ||
236 | Package: GNU Taler | ||
237 | |||
238 | Number: 1019 | ||
239 | Name: MASTER_PARTNER_DETAILS | ||
240 | Comment: Signature affirming a partner configuration for wads. | ||
241 | Package: GNU Taler | ||
242 | |||
228 | Number: 1020 | 243 | Number: 1020 |
229 | Name: MASTER_SIGNING_KEY_REVOKED | 244 | Name: MASTER_SIGNING_KEY_REVOKED |
230 | Comment: The given revocation key was revoked and must no longer be used. | 245 | Comment: The given revocation key was revoked and must no longer be used. |
@@ -285,10 +300,6 @@ Name: MASTER_EXTENSION | |||
285 | Comment: Set the configuration of an extension (age-restriction or peer2peer) | 300 | Comment: Set the configuration of an extension (age-restriction or peer2peer) |
286 | Package: GNU Taler | 301 | Package: GNU Taler |
287 | 302 | ||
288 | Number: 1048 | ||
289 | Name: MASTER_PARTNER_DETAILS | ||
290 | Comment: Signature affirming a partner configuration for wads. | ||
291 | Package: 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 | |||
374 | Comment: Purpose for the state of a purse, signed by the exchange's signing key. | 385 | Comment: Purpose for the state of a purse, signed by the exchange's signing key. |
375 | Package: GNU Taler | 386 | Package: GNU Taler |
376 | 387 | ||
388 | Number: 1048 | ||
389 | Name: EXCHANGE_RESERVE_ATTEST_DETAILS | ||
390 | Comment: Signature by which the exchange attests identity attributes of a particular reserve owner. | ||
391 | Package: GNU Taler | ||
392 | |||
393 | Number: 1049 | ||
394 | Name: EXCHANGE_CONFIRM_PURSE_REFUND | ||
395 | Comment: Signature by which the exchange confirms that a purse expired and a coin was refunded. | ||
396 | Package: GNU Taler | ||
397 | |||
398 | Number: 1050 | ||
399 | Name: EXCHANGE_CONFIRM_AGE_WITHDRAW | ||
400 | Comment: Signature where the Exchange confirms an age-withdraw. | ||
401 | Package: GNU Taler | ||
402 | |||
377 | # | 403 | # |
378 | # Auditor signatures | 404 | # Auditor signatures |
379 | # | 405 | # |
@@ -418,7 +444,7 @@ Package: GNU Taler | |||
418 | 444 | ||
419 | Number: 1200 | 445 | Number: 1200 |
420 | Name: WALLET_RESERVE_WITHDRAW | 446 | Name: WALLET_RESERVE_WITHDRAW |
421 | Comment: Signature where the reserve key confirms a withdraw request. | 447 | Comment: Signature where the reserve key confirms a withdraw request. Signed with the reserve private key. |
422 | Package: GNU Taler | 448 | Package: GNU Taler |
423 | 449 | ||
424 | Number: 1201 | 450 | Number: 1201 |
@@ -428,17 +454,17 @@ Package: GNU Taler | |||
428 | 454 | ||
429 | Number: 1202 | 455 | Number: 1202 |
430 | Name: WALLET_COIN_MELT | 456 | Name: WALLET_COIN_MELT |
431 | Comment: Signature using a coin key confirming the melting of a coin. | 457 | Comment: Signature using a coin key confirming the melting of a coin. Signed with the coin's private key. |
432 | Package: GNU Taler | 458 | Package: GNU Taler |
433 | 459 | ||
434 | Number: 1203 | 460 | Number: 1203 |
435 | Name: WALLET_COIN_RECOUP | 461 | Name: WALLET_COIN_RECOUP |
436 | Comment: Signature using a coin key requesting recoup. | 462 | Comment: Signature using a coin key requesting recoup. Signed with the coin's private key. |
437 | Package: GNU Taler | 463 | Package: GNU Taler |
438 | 464 | ||
439 | Number: 1204 | 465 | Number: 1204 |
440 | Name: WALLET_COIN_LINK | 466 | Name: WALLET_COIN_LINK |
441 | Comment: Signature using a coin key authenticating link data. | 467 | Comment: Signature using a coin key authenticating link data. Signed with the old coin's private key. |
442 | Package: GNU Taler | 468 | Package: GNU Taler |
443 | 469 | ||
444 | Number: 1205 | 470 | Number: 1205 |
@@ -448,7 +474,7 @@ Package: GNU Taler | |||
448 | 474 | ||
449 | Number: 1206 | 475 | Number: 1206 |
450 | Name: WALLET_COIN_RECOUP_REFRESH | 476 | Name: WALLET_COIN_RECOUP_REFRESH |
451 | Comment: Signature using a coin key requesting recoup-refresh. | 477 | Comment: Signature using a coin key requesting recoup-refresh. Signed with the coin private key. |
452 | Package: GNU Taler | 478 | Package: GNU Taler |
453 | 479 | ||
454 | Number: 1207 | 480 | Number: 1207 |
@@ -458,47 +484,72 @@ Package: GNU Taler | |||
458 | 484 | ||
459 | Number: 1208 | 485 | Number: 1208 |
460 | Name: WALLET_RESERVE_HISTORY | 486 | Name: WALLET_RESERVE_HISTORY |
461 | Comment: Request full reserve history and pay for it. | 487 | Comment: Request full or partial reserve history. Signed with the reserve private key. |
462 | Package: GNU Taler | 488 | Package: GNU Taler |
463 | 489 | ||
464 | Number: 1209 | 490 | Number: 1209 |
465 | Name: WALLET_RESERVE_STATUS | 491 | Name: WALLET_COIN_HISTORY |
466 | Comment: Request detailed account status (for free). | 492 | Comment: Request full or partial coin history. Signed with the coin private key. |
467 | Package: GNU Taler | 493 | Package: GNU Taler |
468 | 494 | ||
469 | Number: 1210 | 495 | Number: 1210 |
470 | Name: WALLET_PURSE_CREATE | 496 | Name: WALLET_PURSE_CREATE |
471 | Comment: Request purse creation (without reserve). | 497 | Comment: Request purse creation (without reserve). Signed by the purse private key. |
472 | Package: GNU Taler | 498 | Package: GNU Taler |
473 | 499 | ||
474 | Number: 1211 | 500 | Number: 1211 |
475 | Name: WALLET_PURSE_DEPOSIT | 501 | Name: WALLET_PURSE_DEPOSIT |
476 | Comment: Request coin to be deposited into a purse. | 502 | Comment: Request coin to be deposited into a purse. Signed with the coin private key. |
477 | Package: GNU Taler | 503 | Package: GNU Taler |
478 | 504 | ||
479 | Number: 1212 | 505 | Number: 1212 |
480 | Name: WALLET_PURSE_STATUS | 506 | Name: WALLET_PURSE_STATUS |
481 | Comment: Request purse status. | 507 | Comment: Request purse status. Signed with the purse private key. |
482 | Package: GNU Taler | 508 | Package: GNU Taler |
483 | 509 | ||
484 | Number: 1213 | 510 | Number: 1213 |
485 | Name: WALLET_PURSE_MERGE | 511 | Name: WALLET_PURSE_MERGE |
486 | Comment: Request purse to be merged with a reserve (by purse). | 512 | Comment: Request purse to be merged with a reserve. Signed with the purse private key. |
487 | Package: GNU Taler | 513 | Package: GNU Taler |
488 | 514 | ||
489 | Number: 1214 | 515 | Number: 1214 |
490 | Name: WALLET_ACCOUNT_MERGE | 516 | Name: WALLET_ACCOUNT_MERGE |
491 | Comment: Request purse to be merged with a reserve (by account). | 517 | Comment: Request purse to be merged with a reserve. Signed by the reserve private key. |
492 | Package: GNU Taler | 518 | Package: GNU Taler |
493 | 519 | ||
494 | Number: 1215 | 520 | Number: 1215 |
495 | Name: WALLET_RESERVE_CLOSE | 521 | Name: WALLET_RESERVE_CLOSE |
496 | Comment: Request account to be closed. | 522 | Comment: Request account to be closed. Signed with the reserve private key. |
497 | Package: GNU Taler | 523 | Package: GNU Taler |
498 | 524 | ||
499 | Number: 1216 | 525 | Number: 1216 |
500 | Name: WALLET_PURSE_ECONTRACT | 526 | Name: WALLET_PURSE_ECONTRACT |
501 | Comment: Associates encrypted contract with a purse. | 527 | Comment: Associates encrypted contract with a purse. Signed with the purse private key. |
528 | Package: GNU Taler | ||
529 | |||
530 | Number: 1217 | ||
531 | Name: WALLET_RESERVE_OPEN | ||
532 | Comment: Request reserve to be kept open. Signed with the reserve private key. | ||
533 | Package: GNU Taler | ||
534 | |||
535 | Number: 1218 | ||
536 | Name: WALLET_RESERVE_OPEN_DEPOSIT | ||
537 | Comment: Request coin to be used to pay for reserve to be kept open. Signed with the coin private key. | ||
538 | Package: GNU Taler | ||
539 | |||
540 | Number: 1219 | ||
541 | Name: WALLET_RESERVE_ATTEST_DETAILS | ||
542 | Comment: Request attestation about reserve owner. Signed by the reserve private key. | ||
543 | Package: GNU Taler | ||
544 | |||
545 | Number: 1220 | ||
546 | Name: WALLET_PURSE_DELETE | ||
547 | Comment: Signature by which a wallet requests a purse to be deleted. | ||
548 | Package: GNU Taler | ||
549 | |||
550 | Number: 1221 | ||
551 | Name: WALLET_RESERVE_AGE_WITHDRAW | ||
552 | Comment: Signature where the reserve key confirms an age-withdraw request. Signed with the reserve private key. | ||
502 | Package: GNU Taler | 553 | Package: GNU Taler |
503 | 554 | ||
504 | # | 555 | # |
@@ -535,7 +586,22 @@ Comment: EdDSA test signature. | |||
535 | Package: GNU Taler | 586 | Package: GNU Taler |
536 | 587 | ||
537 | # | 588 | # |
538 | # Anastasis signatures | 589 | # AML officer signatures |
590 | # | ||
591 | |||
592 | Number: 1350 | ||
593 | Name: AML_DECISION | ||
594 | Comment: Signature by which an AML officer signs an AML decision. | ||
595 | Package: GNU Taler | ||
596 | |||
597 | Number: 1351 | ||
598 | Name: AML_QUERY | ||
599 | Comment: Signature by which an AML officer requests AML data. | ||
600 | Package: GNU Taler | ||
601 | |||
602 | |||
603 | # | ||
604 | # GNU Anastasis signatures, >= 1400 | ||
539 | # | 605 | # |
540 | 606 | ||
541 | Number: 1400 | 607 | Number: 1400 |
@@ -544,10 +610,25 @@ Comment: EdDSA signature for a policy upload. | |||
544 | Package: GNU Taler | 610 | Package: GNU Taler |
545 | 611 | ||
546 | # | 612 | # |
547 | # Sync signatures | 613 | # Sync signatures, >= 1450 |
548 | # | 614 | # |
549 | 615 | ||
550 | Number: 1450 | 616 | Number: 1450 |
551 | Name: SYNC_BACKUP_UPLOAD | 617 | Name: SYNC_BACKUP_UPLOAD |
552 | Comment: EdDSA signature for a backup upload. | 618 | Comment: EdDSA signature for a backup upload. |
553 | Package: GNU Taler | 619 | Package: GNU Taler |
620 | |||
621 | |||
622 | # | ||
623 | # Donau signatures, >= 1500 | ||
624 | # | ||
625 | |||
626 | Number: 1500 | ||
627 | Name: DONAU_DONATION_STATEMENT | ||
628 | Comment: 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. | ||
629 | Package: Donau | ||
630 | |||
631 | Number: 1501 | ||
632 | Name: CHARITY_DONATION_CONFIRMATION | ||
633 | Comment: 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. | ||
634 | Package: 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 @@ | |||
1 | Entries | ||
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! |
7 | iana.tmp: http-status-codes-1.csv | 7 | iana.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 |
11 | iana-extended.tmp: iana.tmp | 11 | iana-extended.tmp: iana.tmp |
12 | ./extend.sh $@ $^ | 12 | ./extend.sh $@ iana.tmp |
13 | 13 | ||
14 | registry.rec: types.rec iana-extended.tmp extras.rec | 14 | registry.rec: types.rec iana-extended.tmp extras.rec |
15 | cat $^ > $@ | 15 | cat types.rec iana-extended.tmp extras.rec > $@ |
16 | 16 | ||
17 | distclean: | 17 | distclean: |
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 | ||
27 | http-status-codes.h: h.header http-status-codes.h.tmp h.footer | 27 | http-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 @@ | |||
1 | The main registry is populated from the IANA registry. | ||
2 | |||
3 | The 'extras.rec' may be populated with additional status | ||
4 | codes that have significant usage and do not conflict with | ||
5 | IANA 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} | |||
12 | TMPDIR=`pwd` | 12 | TMPDIR=`pwd` |
13 | export TMPDIR | 13 | export TMPDIR |
14 | 14 | ||
15 | for n in `seq 100 599` | 15 | n=100 |
16 | while [ "$n" -le 599 ] | ||
16 | do | 17 | do |
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` | ||
20 | done | 22 | done |
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 | |||
39 | 410,Gone,"[RFC7231, Section 6.5.9]" | 39 | 410,Gone,"[RFC7231, Section 6.5.9]" |
40 | 411,Length Required,"[RFC7231, Section 6.5.10]" | 40 | 411,Length Required,"[RFC7231, Section 6.5.10]" |
41 | 412,Precondition Failed,"[RFC7232, Section 4.2][RFC8144, Section 3.2]" | 41 | 412,Precondition Failed,"[RFC7232, Section 4.2][RFC8144, Section 3.2]" |
42 | 413,Payload Too Large,"[RFC7231, Section 6.5.11]" | 42 | 413,Content Too Large,"[RFC9110, Section 15.5.14]" |
43 | 414,URI Too Long,"[RFC7231, Section 6.5.12]" | 43 | 414,URI Too Long,"[RFC7231, Section 6.5.12]" |
44 | 415,Unsupported Media Type,"[RFC7231, Section 6.5.13][RFC7694, Section 3]" | 44 | 415,Unsupported Media Type,"[RFC7231, Section 6.5.13][RFC7694, Section 3]" |
45 | 416,Range Not Satisfiable,"[RFC7233, Section 4.4]" | 45 | 416,Range Not Satisfiable,"[RFC7233, Section 4.4]" |
46 | 417,Expectation Failed,"[RFC7231, Section 6.5.14]" | 46 | 417,Expectation Failed,"[RFC7231, Section 6.5.14]" |
47 | 418-420,Unassigned, | 47 | 418-420,Unassigned, |
48 | 421,Misdirected Request,"[RFC7540, Section 9.1.2]" | 48 | 421,Misdirected Request,"[RFC7540, Section 9.1.2]" |
49 | 422,Unprocessable Entity,[RFC4918] | 49 | 422,Unprocessable Content,"[RFC9110, Sectio 15.5.21]" |
50 | 423,Locked,[RFC4918] | 50 | 423,Locked,[RFC4918] |
51 | 424,Failed Dependency,[RFC4918] | 51 | 424,Failed Dependency,[RFC4918] |
52 | 425,Too Early,[RFC8470] | 52 | 425,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 | ############################################ | ||
2 | The 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 @@ | |||
1 | FILES=payto_payment_target_types.rst | ||
2 | all: check $(FILES) | ||
3 | |||
4 | |||
1 | check: | 5 | check: |
2 | recfix --check registry.rec | 6 | recfix --check registry.rec |
7 | |||
8 | distclean: | ||
9 | rm -f *.tmp | ||
10 | |||
11 | clean: | ||
12 | rm -f $(FILES) *.tmp | ||
13 | |||
14 | payto_payment_target_types.rst.tmp: registry.rec rst.template | ||
15 | ../format.sh rst.template < registry.rec > $@ | ||
16 | |||
17 | payto_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 | |||
5 | Name: eth | ||
6 | |||
7 | Description: 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 | |||
36 | Syntax: | ||
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 | |||
52 | Examples: | ||
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 | |||
75 | Motivation - not normative | ||
76 | |||
77 | This syntax is modeled after the ERC-681 URL format | ||
78 | for transaction requests, commonly used in Ethereum | ||
79 | wallets and DApps. The function and function parameters | ||
80 | are not included in this URI type, since they are not | ||
81 | needed for payment requests. | ||
82 | |||
83 | The chain ID is included in the URI, to prevent replay | ||
84 | attacks between different chains. The checksum address | ||
85 | is included in the URI, to prevent typos and other | ||
86 | errors in the address. The checksum address is also | ||
87 | included in the URI, to prevent phishing attacks by | ||
88 | displaying the address in a different case than the | ||
89 | one used to create the address. | ||
90 | |||
91 | The currency is included in the URI, to allow payments | ||
92 | to be made in any ERC-20 token. Three-letter currency | ||
93 | codes are not included, since they are not valid ERC-20 | ||
94 | token addresses. Should sending traditional currencies | ||
95 | be desired, Stablecoins are often ERC-20 tokens, and are | ||
96 | therefore valid currencies for this URI type. | ||
97 | |||
98 | |||
99 | Contact: <gavinnjohn@gmail.com> | ||
100 | |||
101 | |||
102 | Normative 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 | |||
116 | Informative 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 | |||
37 | Name: ldap | 37 | Name: ldap |
38 | Reference: ldap.txt | 38 | Reference: ldap.txt |
39 | Contact: ietf@pep.security | 39 | Contact: ietf@pep.security |
40 | |||
41 | Name: eth | ||
42 | Reference: eth.txt | ||
43 | Contact: gavinnjohn@gmail.com | ||
44 | |||
45 | Name: interac-etransfer | ||
46 | Reference: TBD | ||
47 | Contact: singpolyma@singpolyma.net | ||
48 | |||
49 | Name: wallee-transaction | ||
50 | Reference: wallee-transaction.txt | ||
51 | Contact: 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 @@ | |||
1 | GNU Taler Payment Target Types | ||
2 | ------------------------------ | ||
3 | |||
4 | Entries | ||
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 | |||
5 | Name: wallee-transaction | ||
6 | |||
7 | Description: 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 | |||
18 | Syntax: | ||
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 | |||
26 | Examples: | ||
27 | |||
28 | payto://wallee-transaction/18446744073709551616 | ||
29 | payto://wallee-transaction/13434452243525552616 | ||
30 | |||
31 | |||
32 | Contact: <mailto:habej2@bfh.ch> | ||
33 | |||
34 | |||
35 | Normative References | ||
36 | |||
37 | * [RFC 8905] The 'payto' URI Scheme for Payments | ||
38 | <https://tools.ietf.org/html/rfc8905> | ||
39 | |||
40 | Informative 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 @@ | |||
1 | Registries | ||
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 | ||