Skip to content

Commit 6531c98

Browse files
authored
Merge pull request #258 from neo4j/release-prep-for-7.x
Release prep for 7.x
2 parents de1ac18 + 6a7d417 commit 6531c98

14 files changed

+477
-7
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
5757
* *Products*
5858
59+
* xref:aura-graphql/index.adoc[]
60+
** xref:aura-graphql/prerequisites.adoc[]
61+
** xref:aura-graphql/deploy-and-operate.adoc[]
62+
** xref:aura-graphql/authentication-providers.adoc[]
63+
** xref:aura-graphql/using-your-api.adoc[]
64+
5965
* xref:introspector.adoc[Introspector]
6066
6167
* *Frameworks and integrations*
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
[[auth-providers]]
2+
= Authentication providers
3+
4+
GraphQL for Neo4j AuraDB allows you to use an API key, JWT token from an external identity provider or both for authentication and switch between them as needed.
5+
The authentication method is stored as an authentication provider.
6+
7+
There are advantages and disadvantages to both types.
8+
API keys are quickly set up but do not allow for access control and should not be used within a user-facing client application.
9+
JWKS (JSON Web Key Sets) authentication providers require an external identity provider but do allow for fine-grained rules around authentication/authorization.
10+
11+
[NOTE]
12+
====
13+
`--data-api-id` is used with the `aura-cli` when working with authentication providers rather than `--graphql-api-id` as you might have expected.
14+
Conceptually a GraphQL API is a type of data API and there may be other types in the future.
15+
Using `--data-api-id` allows for flexibility for potential future development work in this area.
16+
====
17+
18+
== Creating a JWKS authentication provider
19+
20+
Before using JWKS authentication providers, you must set up and configure an identity provider that:
21+
22+
* manages users and their credentials securely,
23+
* issues JWTs to authenticated users
24+
* hosts a JWKS endpoint that can be used to validate JWTs by the GraphQL API.
25+
26+
There are several 3rd parties who provide this type of service, e.g. Ping, Okta, Auth0 and any of the main cloud service providers.
27+
Configuration of identity providers is beyond the scope of this guide.
28+
29+
If you do use a JWKS authentication provider, you can take advantage of fine-grained access controls using the xref:security/authentication.adoc[`@authentication`] and xref:security/authorization.adoc[`@authorization`] directives of GraphQL for Neo4j AuraDB.
30+
31+
[NOTE]
32+
====
33+
If you make use of `@authentication` or `@authorization` rules, they are also applied to requests made with API keys.
34+
We do not currently support adding claims to API keys so it is unlikely they are able to meet the rules you specify.
35+
====
36+
37+
The aura-cli is used to create a new JWKS authentication provider.
38+
You will need the JWKS URL to do this along with the ID of the GraphQL API with its associated AuraDB ID.
39+
40+
At a command prompt, type the following, swapping out the UPPERCASE values for your own:
41+
42+
[source, bash, indent=0]
43+
----
44+
aura-cli data-api graphql auth-provider create --data-api-id YOUR_GRAPHQL_DATA_API_ID --instance-id YOUR_AURA_INSTANCE_ID --name AUTH_PROVIDER_FRIENDLY_NAME --type jwks --url JWKS_URL
45+
----
46+
47+
On success, the command responds with details about the newly created JWKS provider.
48+
49+
== Creating an API Key Authentication Provider
50+
51+
[WARNING]
52+
====
53+
If you use an API key authentication provider in a user-facing client application, you risk leaking the API key to your users.
54+
This can give them full access to your GraphQL API.
55+
We recommend you to use JWKS authentication providers in user-facing client applications.
56+
====
57+
58+
When a new GraphQL API is created via the aura-cli, an API key authentication provider is the default.
59+
However, if you require a new one, the following command allows you to create a new API Key.
60+
61+
At a command prompt, type the following, swapping out the UPPERCASE values for your own:
62+
63+
[source, bash, indent=0]
64+
----
65+
aura-cli data-api graphql auth-provider create --data-api-id YOUR_GRAPHQL_DATA_API_ID --instance-id YOUR_AURA_INSTANCE_ID --name AUTH_PROVIDER_FRIENDLY_NAME --type api-key
66+
----
67+
68+
On success, the command will respond with details about the newly created API Key.
69+
70+
[NOTE]
71+
====
72+
Make sure to record the API key shown in the response as it will not be displayed again.
73+
====
74+
75+
== Listing authentication providers
76+
77+
To see the list of authentication providers for a given GraphQL API use the following, exchanging UPPERCASE values for your own.
78+
79+
[source, bash, indent=0]
80+
----
81+
aura-cli data-api graphql auth-provider list --data-api-id YOUR_GRAPHQL_DATA_API_ID --instance-id YOUR_AURA_INSTANCE_ID
82+
----
83+
84+
== Deleting an authentication provider
85+
86+
An authentication provider for a GraphQL API can be removed by deleting it.
87+
At least one enabled authentication provider is required for a GraphQL API.
88+
89+
. Find the API authentication provider ID.
90+
+
91+
[source, bash, indent=0]
92+
----
93+
aura-cli data-api graphql auth-provider list --data-api-id YOUR_GRAPHQL_DATA_API_ID --instance-id YOUR_AURA_INSTANCE_ID --output table
94+
----
95+
+
96+
. From the table, locate the ID for the authentication provider that you wish to delete.
97+
. Delete the API key provider with the following aura-cli statement.
98+
+
99+
[source, bash, indent=0]
100+
----
101+
aura-cli data-api graphql auth-provider delete AUTH-PROVIDER-ID --data-api-id YOUR_GRAPHQL_DATA_API_ID --instance-id YOUR_AURA_INSTANCE_ID
102+
----
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
= Deploy and operate
2+
3+
== Deploy a GraphQL API
4+
5+
6+
Before you deploy a GraphQL API, complete the steps in xref::/aura-graphql/prerequisites.adoc[Prerequisites].
7+
Make sure that you have:
8+
9+
* The ID, username and password for the AuraDB.
10+
* A file containing the type definitions.
11+
12+
You are now ready to create the GraphQL API with the Aura CLI.
13+
Substitute the values in `CAPITALS` to match your setup:
14+
15+
[source, bash, indent=0]
16+
----
17+
aura-cli data-api graphql create --name YOUR_FRIENDLY_NAME --instance-id YOUR_AURA_INSTANCE_ID --instance-username YOUR_AURA_INSTANCE_USER --instance-password YOUR_AURA_INSTANCE_PASSWORD --type-definitions-file
18+
FULL_PATH_TO_YOUR_TYPE_DEFS --await
19+
----
20+
21+
[NOTE]
22+
====
23+
Make sure to record the API key shown in the response as it will not be displayed again.
24+
If the API key is lost, a new one can be created by following the steps to create a new API key auth provider in xref::/aura-graphql/authentication-providers.adoc[Authentication providers].
25+
====
26+
27+
There are other items of note in the response:
28+
29+
* `id`: unique identifier for the GraphQL API
30+
* `status`: tells you if the GraphQL API is ready to receive requests
31+
* `url`: the connection address to access the GraphQL API
32+
33+
To check if the GraphQL API is ready for requests, use the Aura CLI again, changing `YOUR_AURA_INSTANCE_ID` for the ID of your aura instance.
34+
35+
[source, bash, indent=0]
36+
----
37+
aura-cli data-api graphql list --instance-id YOUR_AURA_INSTANCE_ID
38+
----
39+
40+
When the status changes to `ready`, the GraphQL API is available for servicing requests.
41+
42+
== Modifying an existing GraphQL API
43+
44+
It is possible to change the configuration of an existing GraphQL API.
45+
The following properties can be modified:
46+
47+
* Friendly name of the GraphQL API
48+
* Username and/or password for the associated Aura instance
49+
* Type definitions
50+
51+
To do this, use the Aura CLI update command which requires IDs of the GraphQL API and its linked AuraDB instance.
52+
The format of this Aura CLI command is as follows:
53+
54+
[source, bash, indent=0]
55+
----
56+
aura-cli data-api graphql update YOUR_GRAPHQL_API_ID --instance-id YOUR_AURA_INSTANCE_ID <flags>
57+
----
58+
59+
As the change takes a few moments to apply, check the status of the GraphQL API after performing this operation.
60+
If the status is `updating` then the change is still being processed.
61+
When the change is committed, the status will return to `ready`.
62+
63+
Additionally, it is possible to modify the authentication providers of GraphQL APIs.
64+
To learn more, see xref::/aura-graphql/authentication-providers.adoc[Authentication providers].
65+
66+
== Deleting a GraphQL API
67+
68+
When you no longer require the GraphQL API then delete it by using the Aura CLI delete command.
69+
This requires the Aura instance ID and the ID of the GraphQL API.
70+
71+
The format of this command is as follows:
72+
73+
[source, bash, indent=0]
74+
----
75+
aura-cli data-api graphql delete YOUR_GRAPHQL_API_ID --instance-id YOUR_AURA_INSTANCE_ID
76+
----
77+
78+
[CAUTION]
79+
====
80+
There is no additional confirmation - the GraphQL API will start to be deleted as soon as you execute the command.
81+
====
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
= GraphQL for Neo4j AuraDB Beta
2+
3+
Welcome to the beta release of GraphQL for Neo4j AuraDB.
4+
5+
Your feedback and insights help us refine and evolve the product and meet the needs of our users.
6+
7+
The beta release is designed to give you a first look at GraphQL for Neo4j AuraDB.
8+
You may encounter suboptimal behavior.
9+
10+
You can help us get GraphQL for Neo4j AuraDB ready for production:
11+
12+
- *Dive in*: Explore and test its features.
13+
- *Test the product limits*: We'd rather discover weak areas at this stage.
14+
- *Share your experience*: Tell us what works, what doesn't, and what you'd like to see in the future.
15+
- *Provide feedback*: Use our `#graphql` channel on our link:https://discord.gg/M8mTADEJ[Discord Community], or our link:https://community.neo4j.com/c/drivers-stacks/graphql/33[forums] to report issues, suggest improvements, or ask questions.
16+

0 commit comments

Comments
 (0)