profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/spl/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

leanprover-community/mathlib 949

Lean mathematical components library

leanprover-fork/mathlib-backup 6

Lean standard library

spl/alpha-conversion-is-easy 4

Lean proof of alpha-conversion is easy

lambdacats/lambdacats 3

Lambdacats

spl/basic-category-theory 3

Source for Basic Category Theory by Tom Leinster

ahead-fop/ahead 1

Read-only mirror of the AHEAD Tool Suite, Java-based tools that allow you to implement compositional programming and build extensible Java preprocessors for feature-oriented programming (FOP)

ahead-fop/frabbuccino 1

An extensible compiler for Java and AspectJ built with the AHEAD Tool Suite

issue openedgrafana/k6-jslib-expect

Add check for regular expression match

It would be useful to add to Funk a function that checked if the left-hand side matched a regular expression. This would take care of many string-oriented checks that aren't handled by the current collection of functions.

created time in 2 days

issue commentgrafana/k6-jslib-expect

toHaveValidJson() doesn't respect preceding as()

This would indeed be nice!

mikesigs

comment created time in 2 days

PR opened terminusdb/terminusdb

Improve errors for unknown database
  • Change database_does_not_exist to unknown_database
  • Fix resolve_absolute_descriptor when given a name and _meta
  • Use input path instead of modified path for invalid_absolute_path
  • Use api:not_found instead of api:failure
  • Improve branch errors for db and desc
  • Fixes #567

I have integration tests:

  describe('bad descriptor', (t) => {
    const r = http.get('/api/remote/unknowndesc')
    t.expect(r.status).as('status').toEqual(400)
      .and(r).toHaveValidJson()
      .and(r.json('@type')).as('@type').toEqual('api:RemoteErrorResponse')
      .and(r.json('api:status')).as('api:status').toEqual('api:failure')
      .and(r.json('api:error.@type')).as('api:error.@type').toEqual('api:BadAbsoluteDescriptor')
      .and(r.json('api:error.api:absolute_descriptor')).as('api:error.api:absolute_descriptor').toEqual('unknowndesc')
  })

  describe('unknown database', (t) => {
    const r = http.get('/api/remote/unknownorg/unknowndb')
    t.expect(r.status).as('status').toEqual(404)
      .and(r).toHaveValidJson()
      .and(r.json('@type')).as('@type').toEqual('api:RemoteErrorResponse')
      .and(r.json('api:status')).as('api:status').toEqual('api:not_found')
      .and(r.json('api:error.@type')).as('api:error.@type').toEqual('api:UnknownDatabase')
      .and(r.json('api:error.api:organization_name')).as('api:error.api:organization_name').toEqual('unknownorg')
      .and(r.json('api:error.api:database_name')).as('api:error.api:database_name').toEqual('unknowndb')
  })
+51 -41

0 comment

7 changed files

pr created time in 2 days

push eventterminusdb/terminusdb

Luke Feeney

commit sha 7ee722daa03d6c15ff626a33a2d1c3df1f5ae57c

Update README.md

view details

Sean Leather

commit sha b981ca380e774e7fd9a10fe5875c39d10c443e5a

Improve errors for unknown database * Change database_does_not_exist to unknown_database * Fix resolve_absolute_descriptor when given a name and _meta * Use input path instead of modified path for invalid_absolute_path * Use api:not_found instead of api:failure * Improve branch errors for db and desc * Fixes #567

view details

push time in 2 days

issue commentterminusdb/terminusdb

POST & DELETE /api/db with no auth reveals existence of organization

I'm pushing this down the line. I think it requires a discussion about authorization. I don't know what is intended by it in the big picture.

First, in this case, should anonymous even be allowed to create/delete a database? Perhaps we should do an authorization check for anonymous before even doing anything else. Of course, that still leaves non-anonymous users the ability to learn information like the existence of an organization.

Second, in the general case, after at assert_auth_action_scope and src/core/account/capabilities.pl, it seems like authorization works on the existence of specific scopes. So, here we are doing:

do_or_die(organization_name_uri(System_Context, Organization, Organization_Uri),
          error(unknown_organization(Organization), _)),
assert_auth_action_scope(System_Context, Auth, '@schema':'Action/create_database', Organization_Uri),

That tells the client:

  • if the organization exists and/or
  • if the client has the appropriate access to it.

But, if either of those is false, I think we should probably be telling the client only that the request is forbidden without revealing exactly why.

For POST, PUT, and DELETE, it might make sense to return 403 Forbidden for any operation with correct inputs but referring to entities which either do not exist or are not accessible. For GET, any operation with correct inputs but referring to entities which either do not exist are or not accessible should probably be 404.

The unfortunate aspect of the current fine-grained authorization checking is that the responses reveal the existence of scopes, and that information could potentially be used wrongly in some way.

spl

comment created time in 2 days

push eventterminusdb/terminusdb

Sean Leather

commit sha e2fd189c69d8f9dd804525828700993a40d343d2

Fix, improve branch errors for db and desc

view details

push time in 2 days

push eventterminusdb/terminusdb

Sean Leather

commit sha 92dea34fb88fe21f29477ad9408e84994ad0233b

Fix test

view details

push time in 2 days

create barnchterminusdb/terminusdb

branch : fix-567

created branch time in 3 days

issue commentterminusdb/terminusdb

documentation property is not cardinality checked

Agreed. Done.

matko

comment created time in 3 days

issue commentterminusdb/terminusdb

documentation property is not cardinality checked

In the following script, I create a database, insert a type with @documentation (POST), and replace that type with a new @documentation (PUT).

#!/bin/bash
set -ex

xh 'http://admin:root@localhost:6363/api/db/admin/tdb' label=l comment=c

xh 'http://admin:root@localhost:6363/api/document/admin/tdb' graph_type==schema author==a message==m <<EOF
{
  "@id": "D",
  "@type": "Class",
  "@documentation": {
    "@comment": "comment 1"
  }
}
EOF

xh PUT 'http://admin:root@localhost:6363/api/document/admin/tdb' graph_type==schema author==a message==m <<EOF
{
  "@id": "D",
  "@type": "Class",
  "@documentation": {
    "@comment": "comment 2"
  }
}
EOF

xh 'http://admin:root@localhost:6363/api/document/admin/tdb' graph_type==schema

Output from the last command:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 160
Content-Type: application/json; stream=true; charset=UTF-8
Date: Tue, 21 Sep 2021 09:02:15 GMT

{"@base":"terminusdb:///data/", "@schema":"terminusdb:///schema#", "@type":"@context"}
{"@documentation": {"@comment":"comment 2"}, "@id":"D", "@type":"Class"}

The @documentation is the one from the PUT.

I also dump the triples for the schema:

xh 'http://admin:root@localhost:6363/api/triples/admin/tdb/local/branch/main/schema'
@base <terminusdb:///schema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix woql: <http://terminusdb.com/schema/woql#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix xdd: <http://terminusdb.com/schema/xdd#> .
@prefix vio: <http://terminusdb.com/schema/vio#> .
@prefix sys: <http://terminusdb.com/schema/sys#> .
@prefix api: <http://terminusdb.com/schema/api#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix doc: <data/> .

<schema#D>
  a sys:Class ;
  sys:documentation <schema#D/documentation/Documentation> .

<schema#D/documentation/Documentation>
  a sys:Documentation ;
  sys:comment "comment 2" .

<terminusdb://context>
  a sys:Context ;
  sys:base "terminusdb:///data/" ;
  sys:schema "terminusdb:///schema#" .

I believe this is what we'd expect.

matko

comment created time in 3 days

push eventspl/terminusdb

Robin de Rooij

commit sha 0d7a9e089b25af3149e8e7c3c43125533396bd9b

Remove Javscript JSON conversion (#484)

view details

Matthijs van Otterdijk

commit sha b468abd1e317e30a777f210bc40a9a94aaed23a3

changing key strategy now validates existing objects

view details

Gavin Mendel-Gleason

commit sha 97f2457a58df66a096a5fff4a03dff6b7d1d7405

Merge pull request #491 from terminusdb/key_strategy_update changing key strategy now validates existing objects

view details

Sean Leather

commit sha 23c892b4249803c510766b97ea1861e6176d5c7b

Fix graph/graph_filter, DeleteTriple, etc. * Add DeleteTriple tests * Fixes #492

view details

Matthijs van Otterdijk

commit sha a7035f54939f0cf3e3878c0fe3c41d4bb8b62035

raise default max transaction retries to multiple of worker count

view details

Gavin Mendel-Gleason

commit sha 758191e235c2aeceace8d45bf50cff595947364a

Merge pull request #493 from terminusdb/graph-unfiltered Fix graph/graph_filter, DeleteTriple, etc.

view details

Matthijs van Otterdijk

commit sha 3f5ef6d12d154e3ae4e15d48a30e33b31bccee6a

proper list cardinality checking

view details

AstroChelonian

commit sha 5f404b9591b8f3e08e24f670a8b590ae0081c927

create_db: check all prefixes for URI protocol Fixes #453

view details

Matthijs van Otterdijk

commit sha 2997d18eb663d2f702e6fab4cb61587e20308d40

cardinality check for arrays

view details

Matthijs van Otterdijk

commit sha 6b4d6dd639381a9d05fe5827ac905b6e16459706

extract common test setup for cell tests

view details

Matthijs van Otterdijk

commit sha 62164606701c093cb2957b45892bbd6cd509ca91

delete test that tested null element in array

view details

Matthijs van Otterdijk

commit sha 2f137187cdad1a09f15709a64935a8d33497e493

fix tests

view details

Matthijs van Otterdijk

commit sha 5d4ab69f09e1171384d39b7f20cf7fa2bf5131e9

reinsert end_test(json)

view details

Matthijs van Otterdijk

commit sha 31579d88cdc84172f1bdec3a5ee4629bcf1b108f

remove superfluous space

view details

Matthijs van Otterdijk

commit sha 16c2e3c21ed4db2abad950251ddda625eb906372

Merge pull request #494 from terminusdb/raise_transaction_retry_count raise default max transaction retries to multiple of worker count

view details

Matthijs van Otterdijk

commit sha 304583f7e41e6b8f9983971a208a824c2542a4ae

Merge pull request #495 from terminusdb/list_array_cardinality_check proper list and array cardinality checking

view details

Matthijs van Otterdijk

commit sha 0a6fb226ea5b978a59f45de393a48bb367ae87c6

work on new id generation strategy

view details

Gavin Mendel-Gleason

commit sha 8e85cc052c41ff103ac3e0bf4969e133bbd40e22

Enable lexical and hash subdocuments Always expand prefix Lexical and hash should now work Only a test for lexical added, need one for hash. Oops, printing! Add hash key test for subdocuments. json tests passing Additional test block fixes

view details

Gavin Mendel-Gleason

commit sha 998ee69dc8fb3032698db0f5e390982c58503464

Fix access control by adding find_resources for read only

view details

Gavin Mendel-Gleason

commit sha 23c7965c3c4a5607b81bd67d6bcfbb6aec3af549

Fixing resource checking on LT

view details

push time in 3 days

issue openedterminusdb/terminusdb

Stack trace error for duplicate @documentation

This was found while investigating #501.

Script:

#!/bin/bash
set -ex

xh 'http://admin:root@localhost:6363/api/db/admin/tdb' label=l comment=c

xh 'http://admin:root@localhost:6363/api/document/admin/tdb' graph_type==schema author==a message==m <<EOF
{
  "@id": "D",
  "@type": "Class",
  "@documentation": { },
  "@documentation": { }
}
EOF

Output of last command:

HTTP/1.1 500 Internal Server Error
Connection: keep-alive
Content-Length: 3077
Content-Type: application/json
Date: Tue, 21 Sep 2021 07:24:29 GMT

{
    "api:message": "Error: duplicate_key('@documentation')\n  [46] dict_create(_6344,json,['@id'=\"D\",...|...])\n  [43] utils:json_read_dict_stream(<stream>(0x7fde5e8e09a0),_6404) at /Users/leather/projects/terminusdb/terminusdb/src/core/util/utils.pl:900\n  [42] api_document:api_insert_document_(schema,transaction_object{commit_info:commit_info{},descriptor:branch_descriptor{branch_name:\"main\",repository_descriptor: ...},inference_objects:[],instance_objects:[...],parent:transaction_object{descriptor: ...,inference_objects:[],instance_objects: ...,parent: ...,schema_objects: ...},schema_objects:[...]},<stream>(0x7fde5e8e09a0),_6446) at /Users/leather/projects/terminusdb/terminusdb/src/core/api/api_document.pl:174\n  [41] '$bags':findall_loop(_6562,api_document:api_insert_document_(schema,...,<stream>(0x7fde5e8e09a0),_6584),_6566,[]) at /usr/local/Cellar/swi-prolog/8.2.4/libexec/lib/swipl/boot/bags.pl:99\n  [40] setup_call_catcher_cleanup('$bags':'$new_findall_bag','$bags':findall_loop(_6636,...,_6640,[]),_6618,'$bags':'$destroy_findall_bag') at /usr/local/Cellar/swi-prolog/8.2.4/libexec/lib/swipl/boot/init.pl:614\n  [36] '<meta-call>'(api_document:(...;...)) <foreign>\n  [35] database:with_transaction_(query_context{all_witnesses:false,authorization:'terminusdb://system/data/User/admin',bindings:[],commit_info:commit_info{author:a,message:m},default_collection:branch_descriptor{branch_name:\"main\",repository_descriptor: ...},files:[],filter:type_filter{types: ...},prefixes:_6830{'@base':\"terminusdb:///data/\",'@schema':\"terminusdb:///schema#\",'@type':'Context',api:'http://terminusdb.com/schema/api#',owl:'http://www.w3.org/2002/07/owl#',rdf:'http://www.w3.org/1999/02/22-rdf-syntax-ns#',rdfs:'http://www.w3.org/2000/01/rdf-schema#',sys:'http://terminusdb.com/schema/sys#',vio:'http://terminusdb.com/schema/vio#',woql:'http://terminusdb.com/schema/woql#',xdd:'http://terminusdb.com/schema/xdd#',xsd:'http://www.w3.org/2001/XMLSchema#'},selected:[],system:system_descriptor{},transaction_objects:[...],update_guard:_6776,write_graph:branch_graph{branch_name:\"main\",database_name:\"tdb\",organization_name:\"admin\",repository_name:\"local\",type:instance}},api_document:(...;...),_6734) at /Users/leather/projects/terminusdb/terminusdb/src/core/transaction/database.pl:220\n  [34] setup_call_catcher_cleanup(database:true,database:with_transaction_(...,...,_6976),_6954,database:true) at /usr/local/Cellar/swi-prolog/8.2.4/libexec/lib/swipl/boot/init.pl:614\n  [30] '<meta-call>'('<garbage_collected>') <foreign>\n  [29] catch(routes:(...,...),error(duplicate_key('@documentation'),context(...,_7078)),routes:do_or_die(...,...)) at /usr/local/Cellar/swi-prolog/8.2.4/libexec/lib/swipl/boot/init.pl:532\n  [28] catch_with_backtrace('<garbage_collected>','<garbage_collected>','<garbage_collected>') at /usr/local/Cellar/swi-prolog/8.2.4/libexec/lib/swipl/boot/init.pl:582\n\nNote: some frames are missing due to last-call optimization.\nRe-run your program in debug mode (:- debug.) to get more detail.\n\n",
    "api:status": "api:server_error"
}

created time in 3 days

push eventterminusdb/terminusdb

Sean Leather

commit sha 577975a2286fc826dc40e0c0c336bf247ffa8129

Mark tests with external links as fixme Fixes #601

view details

Sean Leather

commit sha dbf4aa3e0f7e1525f3f740ad2ad3af4fde02df08

Merge pull request #602 from terminusdb/rm-tests-with-links Mark tests with external links as fixme

view details

Sean Leather

commit sha 886a6a64c9c15ad3bc453b78f525ae8210fd3af1

Fallback route handler for unknown paths Fixes #469

view details

push time in 4 days

push eventterminusdb/terminusdb

Sean Leather

commit sha 577975a2286fc826dc40e0c0c336bf247ffa8129

Mark tests with external links as fixme Fixes #601

view details

Sean Leather

commit sha dbf4aa3e0f7e1525f3f740ad2ad3af4fde02df08

Merge pull request #602 from terminusdb/rm-tests-with-links Mark tests with external links as fixme

view details

push time in 4 days

delete branch terminusdb/terminusdb

delete branch : rm-tests-with-links

delete time in 4 days

issue closedterminusdb/terminusdb

Tests are failing due to missing links

CI tests are failing because the links below are not found. Can we remove the test dependencies on things that may come or go?

  • https://terminusdb.com/t/data/bike_tutorial.csv
  • https://terminusdb.com/t/data/bikeshare/2011-capitalbikeshare-tripdata.csv

closed time in 4 days

spl

push eventterminusdb/terminusdb

Sean Leather

commit sha 577975a2286fc826dc40e0c0c336bf247ffa8129

Mark tests with external links as fixme Fixes #601

view details

push time in 4 days

PR opened terminusdb/terminusdb

Mark tests with external links as fixme

Fixes #601

+8 -4

0 comment

1 changed file

pr created time in 4 days

create barnchterminusdb/terminusdb

branch : rm-tests-with-links

created branch time in 4 days

issue openedterminusdb/terminusdb

Tests are failing due to missing links

CI tests are failing because the links below are not found. Can we remove the test dependencies on things that may come or go?

  • https://terminusdb.com/t/data/bike_tutorial.csv
  • https://terminusdb.com/t/data/bikeshare/2011-capitalbikeshare-tripdata.csv

created time in 4 days

push eventterminusdb/terminusdb

Sean Leather

commit sha e4bf778495fe02d9f9906332992d418331c65161

Fallback route handler for unknown paths Fixes #469

view details

push time in 4 days

PR opened terminusdb/terminusdb

Fallback route handler for unknown paths

Fixes #469.

I have integration tests:

  describe('paths not found', (t) => {
    const baseUrl = http.baseUrl
    http.batch([
      new Get('/api'),
      new Get('/api/abc'),
      new Get('/api/branch'),
      new Get('/api/clone'),
      new Get('/api/db'),
      new Get('/api/document'),
      new Get('/api/fetch'),
      new Get('/api/optimize'),
      new Get('/api/pack'),
      new Get('/api/prefixes'),
      new Get('/api/pull'),
      new Get('/api/push'),
      new Get('/api/rebase'),
      new Get('/api/reset'),
      new Get('/api/schema'),
      new Get('/api/triples'),
      new Get('/api/unpack'),
    ]).forEach((r) => {
      t.expect(r.status).as('status').toEqual(404)
      t.expect(r).toHaveValidJson()
        .and(r.json('api:status')).as('api:status').toEqual('api:not_found')
        .and(r.json('api:path')).as('api:path').toEqual(r.request.url.replace(baseUrl, ''))
    })
  })
+11 -0

0 comment

1 changed file

pr created time in 4 days

push eventterminusdb/terminusdb

Sean Leather

commit sha e16923542da3f272dba953a5d23856d277db6c79

Fallback route handler for unknown paths Fixes #469

view details

push time in 4 days

push eventterminusdb/terminusdb

Sean Leather

commit sha 1eecf1515ffe4d1dfa090e512991fc553729c9b0

Fallback route handler for unknown paths Fixes #469

view details

push time in 4 days

push eventterminusdb/terminusdb

Sean Leather

commit sha eac1dcfc2326d950148a0a1944658d6a07eb83d9

Fallback route handler for unknown paths Fixes #148

view details

push time in 4 days

create barnchterminusdb/terminusdb

branch : fix-469

created branch time in 4 days

issue commentSWI-Prolog/packages-http

Unexpected redirect for route with variable to same route with slash (/)

Other solutions I see are not to redirect if target handler doesn't end with plain /, i.e., be more restrictive.

That makes sense, I think. How would that work?

We could also mark handlers as "no not redirect to me".

That's an interesting thought. I don't see it being very useful in general, however.

Finally we could add a hook that allows formulating a redirect or not.

Hmm. Maybe it's not needed.

I just realized I could do something like this:

:- http_handler(/, http_404([]), [prefix]).

This seems to prevent the failed handler search, and I don't need to specify the per-path handler.

Also, if I want to do something with a particular path, I can do this:

:- http_handler(/, handle_unknown_path, [prefix]).                                                        
                                                                                                          
handle_unknown_path(Request) :-                                                                           
    member(path(Path), Request),
    ...

So, I guess I can work around the issue without a problem.

spl

comment created time in 4 days

issue commentterminusdb/terminusdb

`DELETE /api/db/admin/d` with `Content-Type: application/json` and empty request body hangs forever

We should find out what the SWI-Prolog HTTP server request timeout is.

spl

comment created time in 4 days