https://github.com/jcnelson/blockstack-auth-test-app
Test application for various versions of Blockstack authentication tokens
https://github.com/jcnelson/blockstack-auth-test-app
Last synced: 11 months ago
JSON representation
Test application for various versions of Blockstack authentication tokens
- Host: GitHub
- URL: https://github.com/jcnelson/blockstack-auth-test-app
- Owner: jcnelson
- License: mit
- Created: 2018-07-27T19:26:05.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-09T23:26:47.000Z (almost 8 years ago)
- Last Synced: 2025-03-05T04:41:38.700Z (over 1 year ago)
- Language: JavaScript
- Size: 513 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# blockstack-auth-test-app
Test application for various versions of Blockstack authentication tokens.
## Setup
Different versions of `blockstack.js` are tested by different branches of this
project. They are labeled `test/blockstack-$VERSION.x` (for example,
`test/blockstack-18.x`).
To test a particular version, check out the relative test branch and run
```bash
$ npm run start
```
Each test branch runs on a different port number so you can run multiple
instances on the same host. The convention for selecting a port number is
to use `${VERSION}00`. For example, `test/blockstack-18.x` will serve on port
1800, whereas `test/blockstack-19.x` will serve on port 1900.
### Setting up a Gaia Hub
In newer versions of `blockstack.js`, you can specify different Gaia hub write
endpoints in the `authResponse` token generated by your authenticator. To test
this functionality, this package comes with a simple Gaia read endpoint located
at `bin/gaia-read.py`. In addition, this package comes with a sample
`gaia.conf` file that will cause the Gaia hub to store data to `/tmp/gaia-hub/`.
To run the read endpoint, simply run:
```bash
$ ./bin/gaia-read.py ./bin/gaia.conf
```
To run the Gaia hub itself, install the `develop` branch of
[Gaia](https://github.com/blockstack/gaia/tree/develop) and run:
```bash
$ blockstack-gaia-hub ./bin/gaia.conf
```
## Trying It Out
You should have up to four processes running:
* Your authenticator
* The test app
* (optional) the Gaia hub
* (optional) the Gaia read enpoint
You should be able to log in with Blockstack, and upon sign-in, you should see:
* the `authResponse` token version
* the `authResponse` hub URL, if given
* the `authResponse` Blockstack Core URL
* the `authResponse` metadata field, if present
* the `authResponse` `gaiaAssociationToken` JWT, if given
The application tracks how many times you use it, and it stores a counter in all
four possible ways: encrypted/sigend, encrypted only, signed only, and neither.
These counts will also be displayed.