1
0
Fork 0
Commit Graph

80 Commits

Author SHA1 Message Date
Alan Plum e8b7e1860a Bug fix/unbreak foxx security (#9042)
* Unbreak aardvark when --foxx.api false

The easiest way to disable the aardvark foxx routes is to just skip the
import and mount altogether. The previous approach caused the service to
throw an error because the module doesn't actually export anything.
There's no need to prevent the export if we just don't import the module
to begin with.

* Add an error code for service api disabled

* Throw an actual error when accessing Foxx API routes

* Throw an error when using legacy Foxx API

There's no easy way to use a catch-all here so disable them one by one. No new routes will be added to this API and it'll go away in 4.0 so there's no risk of forgetting to add the throw-check in new routes.

* Render subnav without delay

The subnav doesn't need the perm check results but we need the subnav to exist so we can populate it in other parts of the app. This fixes the subnav not showing up when reloading certain views (e.g. install service via upload).

* Hide ONLY the Foxx store when it is disabled

We still want to allow installing and upgrading/replacing services. We just don't want to show the store.

* Hide Foxx services in frontend if Foxx API is disabled

* Build aardvark

* fixed typo in disable check, fixed tests
2019-05-21 14:45:23 +02:00
Frank Celler 148ba5f288 Revert "Fix Foxx security (#9020)"
This reverts commit a57b6b86ef.
2019-05-18 09:55:13 +02:00
Frank Celler de566b405d Revert "fixed typo in disable check, fixed tests"
This reverts commit 068bbc9143.
2019-05-18 09:54:49 +02:00
Frank Celler 068bbc9143 fixed typo in disable check, fixed tests 2019-05-18 09:42:11 +02:00
Alan Plum a57b6b86ef Fix Foxx security (#9020)
* Unbreak aardvark when --foxx.api false

The easiest way to disable the aardvark foxx routes is to just skip the
import and mount altogether. The previous approach caused the service to
throw an error because the module doesn't actually export anything.
There's no need to prevent the export if we just don't import the module
to begin with.

* Add an error code for service api disabled

* Throw an actual error when accessing Foxx API routes

* Throw an error when using legacy Foxx API

There's no easy way to use a catch-all here so disable them one by one. No new routes will be added to this API and it'll go away in 4.0 so there's no risk of forgetting to add the throw-check in new routes.

* Hide Foxx services in frontend if Foxx API is disabled

* Render subnav without delay

The subnav doesn't need the perm check results but we need the subnav to exist so we can populate it in other parts of the app. This fixes the subnav not showing up when reloading certain views (e.g. install service via upload).

* Hide ONLY the Foxx store when it is disabled

We still want to allow installing and upgrading/replacing services. We just don't want to show the store.

* Build aardvark
2019-05-17 16:41:34 +02:00
Jan Christoph Uhde 677a79026c Foxx Security (#8845) 2019-04-25 09:56:29 +02:00
Alan Plum 6144459dee Expose "filter" attribute for running Foxx tests (#8700)
* Expose foxx test "filter" option in HTTP API

* Typo sucessful -> successful

* CHANGELOG
2019-04-09 15:32:12 +02:00
Alan Plum 4e25350f6b Fix Foxx API handling of broken services (#6459)
* Add tests for service failing on mount

* Don't install broken services

* Restore error page for broken services

* Prefer JSON error pages

* Expose service upsert in API

* Add Foxx fixes to CHANGELOG

* Update CHANGELOG

Typo
2018-10-23 13:05:03 +02:00
Alan Plum cfa0e0db55 Better foxx errors (#6264)
* Fix codeFrame formatting

Pushing the codeFrame first results in ugly line breaks or extra spaces.

* Include cause in MODULE_FAILURE message

The error is always a wrapper for an underlying cause so it should be easier to determine what caused it.

* Add a codeFrame for failed _install

We normally only want this in dev mode but service CRUD should always provide detailed info.

* Expose codeFrame in Foxx CRUD

The codeFrame can only come from a failed _install, so let's make it visible to Foxx CLI and friends.

* Add codeFrame to runScript

Scripts can also only be executed with access to the Foxx API so we can provide the same info as during CRUD.

* Trim codeFrame fileName to basePath

If we have a basePath, we don't need to expose the full path to the user for the codeFrame to be meaningful.

* Fix getReadableName

Previously 'catch-fire' would become 'Catch  Ire'.

* Add to changelog
2018-08-28 14:36:33 +02:00
Alan Plum 1f69cb6d9d Fix Foxx CRUD errors (#5876)
* Fix off-by-2 error for SyntaxError line nums

* Actually log Foxx HTTP API errors

* Fix line wrap when logging error stacks
2018-08-17 10:09:12 +02:00
Tobias Gödderz de4f5587ae Gharial rewrite in C++ (#5631)
* Built a C++ skeleton REST handler for gharial, with fallback to the JS handler

* Moved aql::Graph to graph::Graph

* Added complete edge definitions to Graph

Also:
- some cleanup
- used forward-declarations in headers
- use Graph in graph rest handler

* Handle graph lookup failures according to the test suite

* Added GET vertex

* Bugfixes in ResultT

- Added missing #include
- Fixed move semantics

* Move central code of readVertex to GraphOperations

* ResultT fixes and complements

* Implemented a graph cache

* Added and used graph cache to the rest handler

* Added GET edge

* Added DELETE edge

* Extracted some code

* Added PATCH and PUT for both edge and vertex

* Moved update/replace transaction code to GraphOperations

* Added stub routes for POST and a TODO note

* Added a test checking that deleting a vertex removes all incident edges as well

* Added a test checking that deleting a vertex does not remove edges in non-graph collections

* fixed compiler warnings and errors

* Began work on DELETE vertex

For this, added a V8Context to allow for AQL queries to use subtransactions

* Continued work on DELETE vertex (still WIP)

* prep for graph post routes

* fixed removeVertex operation (aql)

* added post vertex and post edge gharial routes

* wasSynchronoues flag changed

* gharial post c++ handler, naming conventions

* added gharial tests

* temporary disabled cache (because not completed), added graph property read functions

* added c++ gharial list vertex collections

* added c++ gharial graph config

* added c++ gharial list graphs

* added graph manager class

* first implementation of create graph in c++, WIP

* changed error messages

* added etag to create graph api, still multiple edge definition check missing

* finished POST /_api/gharial/<graph>

* WIP - DELETE /_api/gharial/<graphName>

* added DELETE /_api/gharial/<graphName> validation, still missing correct response

* gharial delete

* fixed delete gharial lock

* finished DELETE /_api/gharial/<graphName>

* added routes for graph based vertices and edge definitions

* improved delete route

* added add new edge definition to existing graph

* patch edge definition in a graph, still <WIP>

* finished edit edge definition route

* code changes due to devel code changes

* added remove edge definition route

* added vertex delete function

* added todo note regarding one drop collection issue

* add oprhan collection to graph route implemented

* Added a test

* Updated a comment

* Several minor changes

* Minor changes during review

* Changes during review

* Changes during review

* Bugfix: orphans may be null or omitted

* Bugfix: resolve externals

* minor code changes

* seperated graph class to independent component classes

* seperated graph class to independent component classes

* removed log output

* fixed create collection behaviour in a cluster environment

* fixed enterprise graphs behaviour in c++ gharial api

* removed log output

* formatting

* improved error handling, fixed a linux compile bug

* more result refactoring

* more result type cleanup

* fixed wrongly defined test

* result handling

* error handling

* more refactoring

* Bugfix: avoid race condition in cluster when creating collections

* updated graph documentation

* added graph related static strings

* static strings, new method to create options for gharial created collections

* Some minor cleanup

* more use of static strings

* minor code changes, review

* added missing parseint

* removed gharial foxx, added js common module, added v8 general graph module

* correct use of virtual method

* more v8, js general graph, broken state

* more v8 graph functions

* fixed editEdgeDefinition, added drop function

* fixed drop behaviour

* added _list, _exists

* added c++ rename graph collections, added v8 + graph module function

* Added a regression test

* added graph._deleteEdgeDefinition, v8, server

* more v8g

* added _removeVertexCollection

* added _extendEditDefinitions

* todo, need to add a helper sort method for a local defined relation

* fixed test

* fixed lots of tests, added more client functions, _addVertexCollection on client module is still broken

* added more client graph functions, all tests green

* more client functions

* add del edge def route

* Fix use after move

* Minor changes in client general-graph.js module

* Make a copy before sorting (don't touch the argument)

* Minor changes and some additional asserts in graph tests

* Consistently set parameter defaults

* Renamed static strings

* Remove superfluous function

* Made comment more verbose

* Minor changes in general-graph-common.js

* Added missing template arguments

* Fixed community build

* Cleanup in editEdgeDefinition

* Regression test & bugfix: comparison of edge definitions didn' order from and to

* Fixed errors introduced by merge

* Minor changes in v8-general-graph.cpp

* Fixed test failure due to wrong error code in CE

* added missing id field

* Added permission checks for graph._create

* Removed assertion that is no longer valid

* Moved removeGraph from GraphOperations to GraphManager

* Allow C++ implementation of graph._drop to handle smart graphs

* Flush js client db cache after creating/dropping collections via the general graph module

* Added _deleteEdgeDefinition to the general graph client module

* WIP: Added permission checks for drop graph

* Fixed permission checks for drop graph

* Added permission checks for other graph operations

* Bugfix: assert edge definitions are returned in order

* Some cleanup

* Removed unused method

* Minor improvements in GraphManager

* Fixed a type in general-graph common module

* Most useful fix of all times ever: Do not auto cast from bool to int and alternate error/noerror by this

* Added the initial keyword to StaticStrings

* Added a new error code, used whenever a user tries to inject a documentcollection as a relation into the graph, which is invalid

* Some GraphManager/Ops/Graph cleanup. Less Slice parsing, more usage of GraphObjects

* Test edgeDefinitions in graphs with a defined ordering

* GraphClass Layout cleanup

* Do not test error messages, use codes instead

* Recreated backwards compatibility of Graph Creation Permission errors

* Changed error-code if edgedefinition is used twice

* Added a StaticString for the GraphName

* Renamed graphToVpack => graphForClient

* Partly fixed graph-api test to work with better error messages. Still red: The edgeDefinitions are now sorted, the test is supposed to sort his own list, but appearently does not do so. Under investigation

* Added a new error code that rejects injection of differently sharded smart collection into smartgraph. Should be more helpful to our users

* graph createCollectionOptions now require an open object to be cross-called from enterprise. Made enterprise switch for creation of graph more elegant.

* Updated graphs.cpp

* Massive refactoring. Made Factories for graphs to make SmartGraph much more transparent. Also reduced amount of multiple implementations of the same stuff. Killed vocbase/graphs use GraphManager instead. Removed usage of GraphCache, was not completely implemented anyway and only partially used, which is bad at the moment. Option for later improvement never the less

* Adapted JS code to now really use c++ variants. ALso included 3 Classes: Graph, SmartGraph and GraphModule.

* Fixed undefined behaviour in Remove Vertex. Fixed smartgraph sharding if one collection already exists.

* Removed DEBUG output

* Removed DEBUG logs

* Removed dead code

* Fixed Graph EdgeDefinition test, they now have a different ordering.

* Added a test when adding a vertexCollection that it is actually valid in the graph

* Client Graph API now correctly sends `orphanCollections` and not `orphans`

* Let GraphOperations modify the graph in-place. It should now properly handle edgeDefinitions.

* Added initial cid StaticString

* Included the vocbase in fromPersistence creation of Graphs. Only required to enhance 3.3 SmartGraphs on the fly.

* Fixed internal error message

* Fixed compiler isses originiated from merging

* Removed unused imports

* Regenerated generated file
2018-08-09 09:30:04 +02:00
Mark 435523167f Bug-fix Foxx empty json request body (#5304) 2018-05-16 16:54:38 +02:00
jsteemann 3586be974c fix jslint warnings 2018-05-09 23:08:46 +02:00
Heiko 65d1434b4d performance optimization gharial post (#5291)
* performance optimization

* fixed badly behavior in api gharial while replaced the document with exists function
2018-05-09 12:50:28 +02:00
Heiko 0ba82969f4 fix ruby tests and api gharial err behaviour (#5208) 2018-04-27 17:06:38 +02:00
Heiko bcd33b8ea1 Bug fix/issue 3811 (#4984)
* now checking existence of _from and _to vertices during edge creation
2018-04-25 14:24:24 +02:00
Andrey Abramov 294c36f778 use ERROR_ARANGO_DATA_SOURCE_NOT_FOUND instead of ERROR_ARANGO_COLLECTION_NOT_FOUND/ERROR_ARANGO_VIEW_NOT_FOUND in js part too 2018-03-19 13:55:25 +03:00
Mark cd97787adf Fix Foxx API (#4614) 2018-02-20 10:22:27 +01:00
Jan 42dd337152
allow using `returnOld` and `returnNew` attributes in HTTP REST APIs … (#4479) 2018-02-09 14:50:56 +01:00
Mark 599da158b5 Bugfix Foxx API tests (#4446) 2018-02-05 11:31:27 +01:00
Alan Plum 05d0c81d7d More consistent config/deps output in Foxx API (devel) (#3792)
* Correctly expose parsed/raw config

This makes accessing the configuration more consistent by distinguishing between the raw (assigned) and parsed (validated/default) values.
Previously there was no way to recognise default values for unset config options and the "current" value did not actually reflect what the service sees.

* Add minimal option to config/deps routes

The default values are backwards compatible with the existing behaviour but can be overridden to consistently get more/less output.

* Actually merge warnings into non-mininal response
2018-01-30 16:50:36 +01:00
Heiko 3390462cba ui: added replicationFactor option during SmartGraph creation. (#3267) 2017-09-17 22:07:47 +02:00
Mark d611414682 Fix HTTP Foxx API Json parsing (#3129) 2017-08-28 14:55:13 +02:00
Heiko d5e85bf987 general graph module and UI now supporting sharded and replicated graph (#2825) 2017-07-19 12:49:04 +02:00
Alan Plum 7f585af4c3 Explicitly return 204 status code on commit (#2694) 2017-06-29 15:13:09 +02:00
Alan Plum bf9c018f7b Add idiomatic flag to Foxx tests (#2693) 2017-06-29 15:12:58 +02:00
Alan Plum bbca34b210 Allow passing plain JSON data for config/deps (#2688) 2017-06-28 14:08:54 +02:00
Mark 50ad6fbd76 Foxx service CRUD optimizations (#2657)
* Pass config/deps on _install so setup can see them

* Only register service when install succeeded

* Don't throw after point of no return: breaky install is breaky

* Delete service files during install if service validation fail

* Delete service files during install if service execution fails

* Fix commitLocalState with invalide services

* Remove deprecated test
2017-06-26 09:28:59 +02:00
Alan Plum 4b4b9f8c55 Fix Foxx API error (#2517)
* Fix Foxx API error
* Manager should distinguish between errors and services
* Foxx API should not require service to exist for uninstall
  if force option is used
* Respect options.force in FM _install
2017-06-01 11:59:04 +02:00
Mark f832dd0388 Implement endpoint "commit coordinator state" (#2513)
Implement endpoint "commit coordinator state" (also see #2479)
2017-05-31 18:21:50 +02:00
Alan Plum cceccf59da Simplified Foxx self healing (#2511)
* Implement new self-heal
* Add error codes for 503, service missing/outdated
* Detect changes to service via rev
* Pretty print incoming response object in log
2017-05-30 18:27:32 +02:00
Alan Plum 30524bbb84
No more need to wrap legacy errors in new Foxx HTTP API 2017-05-17 13:22:11 +02:00
Alan Plum 5d017d733c Improve Foxx cluster resilience (#2479)
* Improve Foxx cluster resilience

Fixes #2083
Fixes #2384
Fixes #2408
Addresses #1892

* Port old Foxx API

* Implement single-file services

* Add console.errorStack/warnStack/infoStack helpers

* Simplify serviceInfo validation

* Extract github/upload logic into Aardvark and old FM API
* Move generator logic into Aardvark
* Move zip/js buffer logic into FM core

* Add Foxxmanager tests

* Send empty response when no README

* Disambiguate script arg format

Historically we allow passing an array of positional arguments or an arbitrary first argument.
This is surprising behaviour, so we should just always treat the value as a first argument.

* Rebuild bundle in development mode

* Nicer HTTP docs formatting

* Create Foxx HTTP docs

* Simplify service upload handling

* Remove inline swagger docs

* Implement public download route

* Consistency

* Rebuild aardvark

* Move bundle route into /_api/foxx/_local

* Rebuild Swagger API docs

* Add changes to CHANGELOG

* More docs
2017-05-16 17:41:29 +02:00
Alan Plum c8d03dd4e1
Provide ljson output for Foxx stream reporter 2017-03-15 20:09:33 +01:00
Alan Plum 4920ef8b41
Implement tap/xunit reporters in Foxx 2017-03-15 20:09:31 +01:00
jsteemann b55cf1b12a make smartGraphAttribute optional 2017-02-14 09:15:12 +01:00
Alan Plum cd98d53ec4
Add swagger route to Foxx API 2016-12-12 02:32:49 +01:00
Alan Plum 04d70bbfe8
Add development option to Foxx API install 2016-11-17 11:29:53 +01:00
Alan Plum 5978461ffe
Add download route to Foxx API 2016-11-16 18:49:56 +01:00
Alan Plum c0a3f5a8a1
Better Foxx API error handling 2016-11-12 22:33:07 +01:00
Alan Plum 0779b99d99
Fix Foxx development mode HTTP API 2016-11-08 13:23:24 +01:00
Alan Plum 41c0f6928d
Allow passing config & deps on install/upgrade/replace 2016-10-31 16:13:32 +01:00
Alan Plum a999dee906
Add scripts route to Foxx API 2016-10-26 11:41:08 +02:00
Michael Hackstein e092c4a4b3 Fixed smartGraph frontend issues 2016-10-21 15:10:15 +02:00
Alan Plum 245819ea9c
Add Foxx HTTP API 2016-10-20 15:09:36 +02:00
Alan Plum f271774e59
Fix manifest license SPDX format 2016-10-20 15:04:09 +02:00
Michael Hackstein b096b09e85 Fixed JS syntax bug in gharial module 2016-10-13 13:10:43 +01:00
Michael Hackstein a5e51e5459 Further fixes in gharial for SmartGraph support. 2016-10-13 10:22:07 +01:00
Michael Hackstein 13dc4915f8 Added a new isEnterprise function in js internal module. Started to make gharial aware of SmartGraphs 2016-10-12 13:25:56 +02:00
Mark f0c0359e47 changed default for keepNull of modifyVertex/modifyEdge to true in Gharial 2016-09-07 10:51:16 +02:00