Version: v0.0.0-...-821bc58 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 19 Imported by: 0


Run keystored in development

Generate the certificate and the private key pair for localhost if you haven't done so:


Simply choose all the default options. This will create three files: tls/server.crt, tls/server.key, and tls/server.csr.

We will only be using server.crt and server.key.

Install the keystored command:

go install ./cmd/keystored

Set up keystore Postgres database locally:

createdb keystore
keystored migrate up

You can undo all migrations by running

keystored migrate down

You can redo the last migration by running

keystored migrate redo

You can check whether there is any unapplied migrations by running

keystored migrate status

Run keystored in development with authentication disabled:

You might want to set the KEYSTORE_LISTENER_PORT environment variable for the keystored listener. Otherwise, the default value is port 8000.

keystored -tls-cert=tls/server.crt -tls-key=tls/server.key -auth=false serve

Before you have a valid endpoint that can handle your auth token and return a user id in plaintext, you might want to disable authentication for testing.

Run keystored in production with authentication disabled:

There are four environment variables used for starting keystored: KEYSTORE_DATABASE_URL, DB_MAX_IDLE_CONNS, DB_MAX_OPEN_CONNS, KEYSTORE_AUTHFORWARDING_URL.

  • DB_MAX_IDLE_CONNS and DB_MAX_OPEN_CONNS are default to 5.
  • KEYSTORE_AUTHFORWARDING_URL is ignored when authentication is turned off.
keystored -tls-cert=PATH_TO_TLS_CERT -tls-key=PATH_TO_TLS_KEY -auth=false serve


You can put the log messages in a designated file with the -log-file flag as well as determine the log severity level with the -log-level flag:

keystored -log-file=PATH_TO_YOUR_LOG_FILE -log-level=[debug|info|warn|error] serve


The Go Gopher

There is no documentation for this package.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL