allow to pass arguments to hooks, transformers and checkers via configuration file

Description

we want to specify arguments in conf file, eg:

1 2 3 4 5 6 7 8 9 10 11 12 13 - group: hooks interface: org.restheart.metadata.hooks.Hook singletons: - name: snooper class: org.restheart.metadata.hooks.SnooperHook args: string: foo number: 1 obj: array: - a - b - c

and get them in the singleton method, eg for hooks

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 /** * * @param exchange the server exchange * @param context the request context * @param args the args sepcified in the collection metadata via args property * @param confArgs args specified in the configuration file via args property * @return true if completed successfully */ default boolean hook( HttpServerExchange exchange, RequestContext context, BsonValue args, BsonDocument confArgs) { return hook(exchange, context, args); }

Environment

None

Status

Assignee

Andrea Di Cesare

Reporter

Andrea Di Cesare

Labels

None

Fix versions

Affects versions

3.0.3

Priority

Major
Configure