https://github.com/alexkravets/devices
Token validation service for iOS devices.
https://github.com/alexkravets/devices
aws device ios serverless token validation
Last synced: about 1 year ago
JSON representation
Token validation service for iOS devices.
- Host: GitHub
- URL: https://github.com/alexkravets/devices
- Owner: alexkravets
- Created: 2021-05-28T09:45:39.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-19T06:34:45.000Z (almost 5 years ago)
- Last Synced: 2024-10-06T04:02:37.784Z (over 1 year ago)
- Topics: aws, device, ios, serverless, token, validation
- Language: JavaScript
- Homepage: https://api.dev.devices.kra.vc/v1/
- Size: 186 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @kravc/devices
Device token validation service for iOS wrapped into `AWS Serverless` function
that relies on `AWS Secrets Manager` to store private key.
API Reference: https://api.dev.devices.kra.vc/v1/#/
## Configuration
Update `url` value to where the service is going to be hosted in configuration
files:
- `config/serverless-dev.yaml`
- `config/serverless-prd.yaml`
Create secret via AWS secret manager to include:
```json
{
"devices": {
"keyId": "KEY_ID",
"teamId": "TEAM_ID",
"privateKey": "PRIVATE_KEY"
}
}
```
NOTE: Check the tutorial on how to get secret values:
https://fluffy.es/devicecheck-tutorial/#serverside
Update `serverless.custom.secrets` value to include secret path (`kravc/dev` and
`kravc/prd` has to be replace with custom values):
- `config/serverless-dev.yaml`
- `config/serverless-prd.yaml`
Update `aws.region` and `aws.profile` to match your deployment preferences.
## Build, Test, Deploy
Install dependencies:
```sh
npm install
```
Run test:
```sh
npm run test
```
Run service locally:
```sh
npm run start
```
Deploy service to `dev` (`prd`) environment:
```sh
npx deploy dev
```
Show service logs from `dev` (`prd`) environment:
```sh
npx logs dev
```
Show service details from `dev` (`prd`) environment:
```sh
npx info dev
```
---
Author: [Alexander Kravets](mailto:a@kra.vc)
Revision: June 19, 2021