Documentation ¶
Overview ¶
Package jwt provides a helper function used to access ArangoDB servers using a JWT secret.
Authenticating with a JWT secret results in "super-user" access to the database.
To use a JWT secret to access your database, use code like this:
// Create an HTTP connection to the database conn, err := http.NewConnection(http.ConnectionConfig{ Endpoints: []string{"http://localhost:8529"}, }) if err != nil { // Handle error } // Prepare authentication hdr, err := CreateArangodJwtAuthorizationHeader("yourJWTSecret", "yourUniqueServerID") if err != nil { // Handle error } auth := driver.RawAuthentication(hdr) // Create a client c, err := driver.NewClient(driver.ClientConfig{ Connection: conn, Authentication: auth, }) if err != nil { // Handle error }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateArangodJwtAuthorizationHeader ¶
CreateArangodJwtAuthorizationHeader calculates a JWT authorization header, for authorization of a request to an arangod server, based on the given secret. If the secret is empty, nothing is done. Use the result of this function as input for driver.RawAuthentication.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.