-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
359 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
.PHONY: build run test jenkinstest cov testclean distclean clean | ||
|
||
RM = rm -rf | ||
|
||
# `pytest` and `python -m pytest` are equivalent, except that the latter will | ||
# add the current working directory to sys.path. We don't want that; we want | ||
# to test against the _installed_ package(s), not against any python sources | ||
# that are (accidentally) in our CWD. | ||
PYTEST = pytest | ||
|
||
# The ?= operator below assigns only if the variable isn't defined yet. This | ||
# allows the caller to override them:: | ||
# | ||
# TESTS=other_tests make test | ||
# | ||
#PYTEST_OPTS ?= --loop uvloop -p no:cacheprovider --verbose --exitfirst --capture=no --cov=src --cov-report=term --no-cov-on-fail | ||
PYTEST_OPTS ?= --loop uvloop -p no:cacheprovider --verbose --exitfirst | ||
PYTEST_COV_OPTS ?= --loop uvloop -p no:cacheprovider --verbose --cov=src --cov-report=term --no-cov-on-fail | ||
TESTS ?= tests | ||
|
||
YAML2JSON = python -c 'import json, sys, yaml; json.dump(yaml.load(sys.stdin), sys.stdout, indent=" ")' | ||
JSON2YAML = python -c 'import json, sys, yaml; yaml.dump(json.load(sys.stdin), sys.stdout, default_flow_style=False)' | ||
CONFIG = 'config' | ||
SCHEMA = 'web/datacatalog/config_schema' | ||
|
||
json: | ||
$(YAML2JSON) <$(CONFIG).yml >$(CONFIG).json | ||
$(YAML2JSON) <$(SCHEMA).yml >$(SCHEMA).json | ||
|
||
yaml: | ||
$(JSON2YAML) <$(CONFIG).json >$(CONFIG).yml | ||
$(JSON2YAML) <$(SCHEMA).json >$(SCHEMA).yml | ||
|
||
run: | ||
cp -af $(OPENAPI_PATH) \ | ||
swagger-ui/dist/openapi.yml && \ | ||
authz_admin | ||
|
||
|
||
schema schema_jenkins schema_acc: | ||
$(MAKE) -C alembic $@ | ||
|
||
|
||
test: schema | ||
$(PYTEST) $(PYTEST_OPTS) $(TESTS) | ||
|
||
|
||
jenkinstest: schema_jenkins | ||
$(PYTEST) $(PYTEST_OPTS) $(TESTS) | ||
|
||
|
||
cov: schema | ||
$(PYTEST) $(PYTEST_COV_OPTS) $(TESTS) | ||
|
||
|
||
testclean: | ||
@$(RM) .cache .coverage | ||
|
||
|
||
# @evert waar komt dit eigenlijk vandaan? [--PvB] | ||
distclean: | ||
@$(RM) \ | ||
dist/ \ | ||
bin/ \ | ||
develop-eggs/ \ | ||
eggs/ \ | ||
parts/ \ | ||
MANIFEST \ | ||
htmlcov/ \ | ||
.installed.cfg | ||
|
||
clean: testclean distclean | ||
@$(RM) build *.egg-info .eggs dist | ||
@find . -not -path "./.venv/*" -and \( \ | ||
-name "*.pyc" -or \ | ||
-name "__pycache__" -or \ | ||
-name "*.pyo" -or \ | ||
-name "*.so" -or \ | ||
-name "*.o" -or \ | ||
-name "*~" -or \ | ||
-name "._*" -or \ | ||
-name "*.swp" -or \ | ||
-name "Desktop.ini" -or \ | ||
-name "Thumbs.db" -or \ | ||
-name "__MACOSX__" -or \ | ||
-name ".DS_Store" \ | ||
\) -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,47 @@ | ||
datacatalog: {} | ||
|
||
postgres: | ||
host: ${DB_HOST:-localhost} | ||
port: ${DB_PORT:-5432} | ||
user: ${DB_USER:-datacatalog} | ||
password: ${DB_PASS:-datacatalog} | ||
dbname: ${DB_DATABASE:-datacatalog} | ||
|
||
logging: | ||
version: 1 | ||
formatters: | ||
default: | ||
format: '%(asctime)s authz_admin %(levelname)-8s %(module)s:%(lineno)d: %(message)s' | ||
handlers: | ||
aiohttp.access: | ||
class: logging.StreamHandler | ||
console: | ||
class: logging.StreamHandler | ||
formatter: default | ||
aiohttp.access: | ||
class: logging.StreamHandler | ||
loggers: | ||
datacatalog: | ||
level: ${LOGLEVEL:-DEBUG} | ||
handlers: [console] | ||
propagate: false | ||
aiohttp: | ||
propagate: true | ||
aiohttp.*: | ||
propagate: true | ||
aiohttp.access: | ||
handlers: | ||
- aiohttp.access | ||
level: ${LOGLEVEL:-DEBUG} | ||
handlers: [aiohttp.access] | ||
propagate: false | ||
aiohttp: | ||
propagate: true | ||
# aiohttp.*: | ||
# propagate: true | ||
aiohttp_extras: | ||
handlers: | ||
- console | ||
level: ${LOGLEVEL:-DEBUG} | ||
handlers: [console] | ||
propagate: false | ||
config_loader: | ||
handlers: | ||
- console | ||
level: ${LOGLEVEL:-DEBUG} | ||
propagate: false | ||
datacatalog: | ||
handlers: | ||
- console | ||
level: ${LOGLEVEL:-DEBUG} | ||
handlers: [console] | ||
propagate: false | ||
root: | ||
handlers: | ||
- console | ||
level: ${LOGLEVEL:-WARNING} | ||
handlers: [console] | ||
version: 1 | ||
postgres: | ||
dbname: ${DB_DATABASE:-datacatalog} | ||
host: ${DB_HOST:-localhost} | ||
password: ${DB_PASS:-datacatalog} | ||
port: ${DB_PORT:-5432} | ||
user: ${DB_USER:-datacatalog} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://json-schema.org/draft-07/schema#", | ||
"title": "Core schema meta-schema", | ||
"definitions": { | ||
"schemaArray": { | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { "$ref": "#" } | ||
}, | ||
"nonNegativeInteger": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"nonNegativeIntegerDefault0": { | ||
"allOf": [ | ||
{ "$ref": "#/definitions/nonNegativeInteger" }, | ||
{ "default": 0 } | ||
] | ||
}, | ||
"simpleTypes": { | ||
"enum": [ | ||
"array", | ||
"boolean", | ||
"integer", | ||
"null", | ||
"number", | ||
"object", | ||
"string" | ||
] | ||
}, | ||
"stringArray": { | ||
"type": "array", | ||
"items": { "type": "string" }, | ||
"uniqueItems": true, | ||
"default": [] | ||
} | ||
}, | ||
"type": ["object", "boolean"], | ||
"properties": { | ||
"$id": { | ||
"type": "string", | ||
"format": "uri-reference" | ||
}, | ||
"$schema": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"$ref": { | ||
"type": "string", | ||
"format": "uri-reference" | ||
}, | ||
"$comment": { | ||
"type": "string" | ||
}, | ||
"title": { | ||
"type": "string" | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"default": true, | ||
"readOnly": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"examples": { | ||
"type": "array", | ||
"items": true | ||
}, | ||
"multipleOf": { | ||
"type": "number", | ||
"exclusiveMinimum": 0 | ||
}, | ||
"maximum": { | ||
"type": "number" | ||
}, | ||
"exclusiveMaximum": { | ||
"type": "number" | ||
}, | ||
"minimum": { | ||
"type": "number" | ||
}, | ||
"exclusiveMinimum": { | ||
"type": "number" | ||
}, | ||
"maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, | ||
"minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, | ||
"pattern": { | ||
"type": "string", | ||
"format": "regex" | ||
}, | ||
"additionalItems": { "$ref": "#" }, | ||
"items": { | ||
"anyOf": [ | ||
{ "$ref": "#" }, | ||
{ "$ref": "#/definitions/schemaArray" } | ||
], | ||
"default": true | ||
}, | ||
"maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, | ||
"minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, | ||
"uniqueItems": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"contains": { "$ref": "#" }, | ||
"maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, | ||
"minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, | ||
"required": { "$ref": "#/definitions/stringArray" }, | ||
"additionalProperties": { "$ref": "#" }, | ||
"definitions": { | ||
"type": "object", | ||
"additionalProperties": { "$ref": "#" }, | ||
"default": {} | ||
}, | ||
"properties": { | ||
"type": "object", | ||
"additionalProperties": { "$ref": "#" }, | ||
"default": {} | ||
}, | ||
"patternProperties": { | ||
"type": "object", | ||
"additionalProperties": { "$ref": "#" }, | ||
"propertyNames": { "format": "regex" }, | ||
"default": {} | ||
}, | ||
"dependencies": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"anyOf": [ | ||
{ "$ref": "#" }, | ||
{ "$ref": "#/definitions/stringArray" } | ||
] | ||
} | ||
}, | ||
"propertyNames": { "$ref": "#" }, | ||
"const": true, | ||
"enum": { | ||
"type": "array", | ||
"items": true, | ||
"minItems": 1, | ||
"uniqueItems": true | ||
}, | ||
"type": { | ||
"anyOf": [ | ||
{ "$ref": "#/definitions/simpleTypes" }, | ||
{ | ||
"type": "array", | ||
"items": { "$ref": "#/definitions/simpleTypes" }, | ||
"minItems": 1, | ||
"uniqueItems": true | ||
} | ||
] | ||
}, | ||
"format": { "type": "string" }, | ||
"contentMediaType": { "type": "string" }, | ||
"contentEncoding": { "type": "string" }, | ||
"if": {"$ref": "#"}, | ||
"then": {"$ref": "#"}, | ||
"else": {"$ref": "#"}, | ||
"allOf": { "$ref": "#/definitions/schemaArray" }, | ||
"anyOf": { "$ref": "#/definitions/schemaArray" }, | ||
"oneOf": { "$ref": "#/definitions/schemaArray" }, | ||
"not": { "$ref": "#" } | ||
}, | ||
"default": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.