Commit Graph

1768 Commits

Author SHA1 Message Date
Rakesh Emmadi
d52bfcda4e
backend only insert permissions (rfc #4120) (#4224)
* move user info related code to Hasura.User module

* the RFC #4120 implementation; insert permissions with admin secret

* revert back to old RoleName based schema maps

An attempt made to avoid duplication of schema contexts in types
if any role doesn't possess any admin secret specific schema

* fix compile errors in haskell test

* keep 'user_vars' for session variables in http-logs

* no-op refacto

* tests for admin only inserts

* update docs for admin only inserts

* updated CHANGELOG.md

* default behaviour when admin secret is not set

* fix x-hasura-role to X-Hasura-Role in pytests

* introduce effective timeout in actions async tests

* update docs for admin-secret not configured case

* Update docs/graphql/manual/api-reference/schema-metadata-api/permission.rst

Co-Authored-By: Marion Schleifer <marion@hasura.io>

* Apply suggestions from code review

Co-Authored-By: Marion Schleifer <marion@hasura.io>

* a complete iteration

backend insert permissions accessable via 'x-hasura-backend-privilege'
session variable

* console changes for backend-only permissions

* provide tooltip id; update labels and tooltips;

* requested changes

* requested changes

- remove className from Toggle component
- use appropriate function name (capitalizeFirstChar -> capitalize)

* use toggle props from definitelyTyped

* fix accidental commit

* Revert "introduce effective timeout in actions async tests"

This reverts commit b7a59c19d6.

* generate complete schema for both 'default' and 'backend' sessions

* Apply suggestions from code review

Co-Authored-By: Marion Schleifer <marion@hasura.io>

* remove unnecessary import, export Toggle as is

* update session variable in tooltip

* 'x-hasura-use-backend-only-permissions' variable to switch

* update help texts

* update docs

* update docs

* update console help text

* regenerate package-lock

* serve no backend schema when backend_only: false and header set to true

- Few type name refactor as suggested by @0x777

* update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* fix a merge bug where a certain entity didn't get removed

Co-authored-by: Marion Schleifer <marion@hasura.io>
Co-authored-by: Rishichandra Wawhal <rishi@hasura.io>
Co-authored-by: rikinsk <rikin.kachhia@gmail.com>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-24 14:40:53 +05:30
Rakesh Emmadi
6f100e0009
improve debug information in actions errors response (close #4031) (#4432)
* config options for internal errors for non-admin role, close #4031

More detailed action debug info is added in response 'internal' field

* add docs

* update CHANGELOG.md

* set admin graphql errors option in ci tests, minor changes to docs

* fix tests

Don't use any auth for sync actions error tests. The request body
changes based on auth type in session_variables (x-hasura-auth-mode)

* Apply suggestions from code review

Co-Authored-By: Marion Schleifer <marion@hasura.io>

* use a new sum type to represent the inclusion of internal errors

As suggested in review by @0x777
-> Move around few modules in to specific API folder
-> Saperate types from Init.hs

* fix tests

Don't use any auth for sync actions error tests. The request body
changes based on auth type in session_variables (x-hasura-auth-mode)

* move 'HttpResponse' to 'Hasura.HTTP' module

* update change log with breaking change warning

* Update CHANGELOG.md

Co-authored-by: Marion Schleifer <marion@hasura.io>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-24 13:25:51 +05:30
Karthikeyan Chinnakonda
a8affc2cda
fix intermittent errors occur when query actions used with variables (#4527)
* don't add query actions to the plan cache

Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com>
2020-04-24 11:39:00 +05:30
Rakesh Emmadi
b51a8ece4d
fix creating relationships for custom object types with fields reusing Postgres scalars (fix #4447) (#4455)
* fix creating relationships for custom object types with fields reusing Postgres scalars, close #4447

* fix changelog entry

* rearrange entries

Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-24 10:58:42 +05:30
Rishichandra Wawhal
2e7e54fc2e
console: preserve the returning field set in a derived action (#4530) 2020-04-23 18:27:42 +05:30
Marion Schleifer
b3d814e56f
docs: add mapping of hasura operators - pg operators (close #4056) (#4502) 2020-04-23 17:36:54 +05:30
Karthikeyan Chinnakonda
f3558d5278
make arguments field optional in ActionDefinition (#4521) 2020-04-23 16:06:33 +05:30
Shraddha Agrawal
eb7acdbd71
docs: add reference docs for cli (fix #4327) (#4408)
Co-Authored-By: Marion Schleifer <marion@hasura.io>
2020-04-23 11:27:45 +05:30
Shraddha Agrawal
e07761eb33
cli: validate endpoint using ParseRequestURI (fix #4407) (#4416) 2020-04-23 08:40:24 +05:30
Shraddha Agrawal
75d35ac2f6
cli: add suport for .env file (fix #4129) (#4454) 2020-04-23 08:17:51 +05:30
Karthikeyan Chinnakonda
246a0b7ab8
server: Improve queryModifiesSchemaCache check for run_sql (#4283)
The previous check was too conservative and acquired a lock on the
schema cache in situations where it was unnecessary. This change
exposes the logic run_sql uses to determine whether to use the
metadata check to make the check more precise.
2020-04-22 16:03:23 -05:00
Toan Nguyen
2e8234f1b6
fix nested errors array in ws-server response log (#3971) 2020-04-22 15:33:51 -05:00
Aleksandra Sikora
447aac3692
console: allow adding post-update checks in update permissions (close #4142) (#4313) 2020-04-22 17:55:10 +05:30
Aravind Shankar
455b78552d
cli(test): refactor integration test metadata directory (#4491) 2020-04-22 16:58:02 +05:30
ryo
ae11e9b557
console: migrate checkbox, icon and radio button to TypeScript (#4373) 2020-04-22 16:47:10 +05:30
Aravind Shankar
2a693be553
cli(test): fix cli init test to use initDir from subtest group (#4490) 2020-04-22 15:54:24 +05:30
Aravind Shankar
0513fd39bf
ci: add force flag while creating pull request using hub (#4431) 2020-04-22 15:53:47 +05:30
Aravind Shankar
2ee6328d0d
cli: add check_metadata_consistency for v2 workflow migrations (#4392) 2020-04-22 15:52:02 +05:30
Aravind Shankar
aca11f0944
cli: spinner bug, add cli_environment in global config (#4459)
close #4456
close #4436
close #4496
2020-04-22 14:45:42 +05:30
Avi Moondra
a9051b3e59
fix typo in jsonb query filters to match operator api (#4505)
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-22 11:53:25 +05:30
Rakesh Emmadi
e983b1596e
fix recreating action's permission, fix #4377 (#4495)
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
2020-04-22 11:29:14 +05:30
Auke Booij
fac2d18d6f
Add a hint on avoiding recompilation during typical dev workflow (#4427) 2020-04-21 21:03:35 +02:00
Rikin Kachhia
11dde1b31b
console: prevent trailing spaces while creating new role (close #3871) (#4497) 2020-04-21 21:40:19 +05:30
Rikin Kachhia
20c3beeea0
console: prevent trailing spaces while creating new role (close #3871) (#4497) 2020-04-21 21:36:21 +05:30
Auke Booij
b2ad3ee2ee
server: avoid integer overflows (fix #576) (fix #4368) (#4435)
* Update graphql-parser-hs and hence use `Scientific` directly

The new version of graphql-parser-hs returns Scientific and Integer
rather than Double and Int32, respectively.  So we now need to do less
work in graphql-engine, and we can process larger numbers.

In practice, this means that when inserting a bigint, we no longer
need to specify the inserted integer as text.  This is also
represented in the updated tests.

* Generate int overflow error on insert

* Document bigint insertion support in changelog
2020-04-21 15:56:15 +02:00
Rikin Kachhia
a9bca2383f
console miscellaneous fixes (#4433)
* format row count in data browser for readablity
* move pre-release notification tooltip msg to top
* remove extra localPresets key from migrations (close #3976)
* make nullable and unique labels for columns clickable in insert and modify
* fix row delete for relationships in data browser
2020-04-21 18:41:44 +05:30
Auke Booij
cd2e09c6ad
server: add support for timestamps without timezone to graphql-engine (fix #1217) (#4452)
* Add support for timestamps without timezone to graphql-engine

* Add tests for aggregations on timestamps without timezones
2020-04-21 14:30:48 +02:00
Aleksandra Sikora
386786f57c
console: fix columns reordering for relationship tables in data browser (#4483) 2020-04-21 16:46:24 +05:30
Rakesh Emmadi
9b7781ee6b
introduce effective timeout in actions async tests (#4363)
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-21 15:55:56 +05:30
Auke Booij
82cdad1556
Link to pytest docs in the server test suite READMEs (#4425) 2020-04-21 11:29:16 +02:00
Karthikeyan Chinnakonda
ced6275ff0
add additional tests for testing claims_namespace_path in JWT tokens (#4481)
* add additional tests for testing claims_namespace_path in JWT tokens

- add tests for at root level and at a nested level

* modify the JWT tests

* combine the claims_namespace_path tests together in test-server.sh

* change the order of the claims_namespace_path tests

* change the order of the claims_namespace_path tests
2020-04-21 14:54:35 +05:30
Marco Pegoraro
dc88d1727b
Add API docs for webhook_from_env (#4462)
* Add API docs for `webhook_from_env`

fixes #4419

* add changelog

* Fixes PR required change

* Improve create_trigger api doc

* Update docs/graphql/manual/api-reference/schema-metadata-api/event-triggers.rst

Co-Authored-By: Marion Schleifer <marion@hasura.io>

* Update docs/graphql/manual/api-reference/schema-metadata-api/event-triggers.rst

Co-Authored-By: Marion Schleifer <marion@hasura.io>

Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
Co-authored-by: Marion Schleifer <marion@hasura.io>
2020-04-21 14:04:39 +05:30
Toan Nguyen
5f84669568
server: support single $ as root json path (#4482)
* support single $ json path

* support sql query with root json path

* update changelog

* update changelog

Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-21 13:36:11 +05:30
Rikin Kachhia
3517b3c73b
community: fix blog link in realtime chat app readme (#4494) 2020-04-21 12:38:19 +05:30
Areski Belaid
a4a7b760db
refresh the sample app realtime-poll (#4337)
* [fix](realtime-poll) refresh project realtime-poll

* remove comment lines

Co-authored-by: Praveen Durairaju <praveend.web@gmail.com>
Co-authored-by: Praveen Durairaju <praveen@hasura.io>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-21 12:24:51 +05:30
Auke Booij
be28a3b95c
Move changelog entry to the right section (#4493) 2020-04-21 12:06:30 +05:30
Jigyasu Arya
e991180f43
console: change react ace editor theme to eclipse (close #4437) (#4443) 2020-04-20 18:12:45 +05:30
Toan Nguyen
15c0ebf1ef
allow special characters in json path's property name (close #3890) (#3892)
* allow underscore prefix and special characters in json path

* server: Rewrite/refactor JSONPath parser

The JSONPath parser is also rewritten, the previous implementation
was written in a very explicitly “recursive descent” style, but the whole
point of using attoparsec is to be able to backtrack! Taking advantage
of the combinators makes for a much simpler parser.

Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
Co-authored-by: Alexis King <lexi.lambda@gmail.com>
Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com>
Co-authored-by: Shahidh K Muhammed <shahidh@hasura.io>
2020-04-20 14:25:09 +05:30
Rishichandra Wawhal
3603af19d0
docs: update sample action handler URLs (#4450) 2020-04-20 11:48:00 +05:30
Rikin Kachhia
3c9d1f2330
ci: skip server tests in PRs if there are no server changes (#4412) 2020-04-17 13:18:40 -05:00
ShahAnuj2610
bf719cbf34
console: surround string type column default value with quotes (close #4371) (#4423) 2020-04-17 21:32:13 +05:30
Auke Booij
b2d65d16d3
server: _inc for non-integer numeric types (fix #3573) (#4429)
* Allow `_inc` to update other numeric types in addition to integers

* Add support for PostgreSQL's `money` field type

* Add support for _inc on money types

* Add note of generalized `_inc` support to changelog
2020-04-17 11:32:09 +02:00
Shahidh K Muhammed
da3220f3fa
tag release v1.2.0-beta.4 (#4428)
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-17 13:05:18 +05:30
Aleksandra Sikora
550de3e8a0
console: add possible undefined check (#4445) 2020-04-17 11:58:47 +05:30
Marion Schleifer
6b2d525dd6
docs: fix bug in query actions docs (#4434) 2020-04-16 19:30:03 +05:30
Tirumarai Selvan
c0a51d5d05
small fixes (#4430) 2020-04-16 16:39:01 +05:30
Rishichandra Wawhal
8a5cc73ae6
cli, console: actions dx improvements (close #4306, #4311) (#4308) 2020-04-16 13:40:47 +05:30
Karthikeyan Chinnakonda
5116e16e18
server(actions): add support for queries (close #4032) (#4309)
* add support for action queries

* a new parameter `type` is added in the ArgumentDefinition, its value
  can be either `query` or `mutation` and it defaults to the latter

* throw 400 when a query action is tried to explain

* update the actions docs to include query actions

* refactor the ToJSON and ToOrdJSON of ActionDefinition

Co-authored-by: Rishichandra Wawhal <rishi@hasura.io>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-16 12:55:19 +05:30
Karthikeyan Chinnakonda
a26bc80496
accept a new argument claims_namespace_path in JWT config (#4365)
* add new optional field `claims_namespace_path` in JWT config

* return value when empty array is found in executeJSONPath

* update the docs related to claims_namespace_path

* improve encodeJSONPath, add property tests for parseJSONPath

* throw error if both claims_namespace_path and claims_namespace are set

* refactor the Data.Parser.JsonPath to Data.Parser.JSONPathSpec

* update the JWT docs

Co-Authored-By: Marion Schleifer <marion@hasura.io>

Co-authored-by: Marion Schleifer <marion@hasura.io>
Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com>
2020-04-16 12:15:21 +05:30
Sitian Liu
2aa971ae83
community: fix typo in event trigger doc (#4426) 2020-04-16 06:57:58 +05:30