Skip to content

Commit

Permalink
Release attestation service v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eelanagaraj authored and martinvol committed May 13, 2022
1 parent d752156 commit 38c753f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .env.alfajores
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ AZURE_ORACLE_CENTRALUS_FULL_NODES_WS_PORT="8546"

# Temporarily point to celo-org repository to consume patched image.
GETH_NODE_DOCKER_IMAGE_REPOSITORY="us.gcr.io/celo-org/geth"
GETH_NODE_DOCKER_IMAGE_TAG="1.5.0-beta.1"
GETH_NODE_DOCKER_IMAGE_TAG="1.5.0"

GETH_BOOTNODE_DOCKER_IMAGE_REPOSITORY="us.gcr.io/celo-org/geth-all"
GETH_BOOTNODE_DOCKER_IMAGE_TAG="1.3.2"
Expand Down
52 changes: 4 additions & 48 deletions packages/attestation-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,13 @@

A service run by validators on the Celo network to send SMS messages, enabling attestations of user phone numbers and their accounts on the Celo network.

### Configuration
## Validators

You can use the following environment variables to configure the attestation service:
Please see [the Celo docs](https://docs.celo.org/validator-guide/attestation-service#configuration) for information on configuring and running an attestation service.

- `DATABASE_URL` - The URL under which your database is accessible, currently supported are `postgres://`, `mysql://` and `sqlite://`
- `CELO_PROVIDER` - The URL under which a celo blockchain node is reachable. This node should also have the `ATTESTATION_SIGNER_ADDRESS` unlocked for signing of the attestations themselves.
- `CELO_VALIDATOR_ADDRESS` - The address of the validator on the `Accounts` smart contract
- `ATTESTATION_SIGNER_ADDRESS` - The address of the key with which attestations should be signed.
- `SMS_PROVIDERS` - A comma-separated list of providers you want to configure, we currently support:
## Developers

`nexmo`

- `NEXMO_KEY` - The API key to the Nexmo API
- `NEXMO_SECRET` - The API secret to the Nexmo API
- `NEXMO_BLACKLIST` - A comma-sperated list of country codes you do not want to serve

`twilio`

- `TWILIO_ACCOUNT_SID` - The SID of your Twilio account
- `TWILIO_MESSAGE_SERVICE_SID` - The SID of the messaging service you want to use. The messaging service should have at least 1 phone number associated with it.
- `TWILIO_AUTH_TOKEN` - The auth token for your Twilio account
More information about error codes and configuration parameters can be found in [the Celo docs](https://docs.celo.org/validator-guide/attestation-service).

### Operations

Expand All @@ -46,33 +32,3 @@ yarn run db:migrate:dev
You will also have to set the environment variables in `.env.development`

Then start the service with `yarn run dev` (you'll have to add the appropriate credentials for the text providers)

### Error Responses

Here is a list of the error codes and messages returned by the Attestation Service and what they mean. In addition to the error codes listed below, the service also returns `500` for `Unknown Error`.

#### 422, Unprocessable Entity

- `Mismatching issuer, I am ${address}` - The attestation request references an issuer address that does not match that of the AS that actually received the request.
- `NO_INCOMPLETE_ATTESTATION_FOUND_ERROR / 'No incomplete attestation found'` - The Attestations contract has no record that this AS was randomly assigned as an issuer for the given account/identifier pair.
- `ATTESTATION_ERROR / 'Valid attestation could not be provided'` - A call to validateAttestationCode in the Attestations contract has failed. This method checks that (1) there is a non-expired incomplete attestation assigned to the issuer whose signature constitutes the given attestation code.
- `'Invalid securityCodePrefix'` - A security code prefix with an incorrect length was provided in the attestation request.
- `'Invalid smsRetrieverAppSig'` - The provided smsRetrieverAppSig does not match the regex `'^[\\w+]{5,12}$'`
- `'Attestation can no longer be re-requested'` - The user is re-requesting an attestation that the AS thinks was completed too long ago for it to accept the re-request.
- `'Delivery attempts exceeded'` - The AS has attempted to deliver this attestation to the user too many times and will not try again.
- `ErrorMessages.NO_PROVIDER_SETUP / 'No provider was setup for this phone number'` - The AS has not setup an SMS provider
- `ErrorMessages.INVALID_SIGNATURE / 'Invalid signature provided'` - The signature provided in a `AttestationServiceTestRequest` was not generated by either the AS's account address or attestation signer address.

#### 404, Not Found

- `'Attestation not found'` - The attestation the user is attempting to complete could not be found in the AS's database.

#### 403, Forbidden

- `'Security code attempts exceeded'` - The user has attempted to complete the attestation with an incorrect security code too many times. The attestation can no longer be completed.
- `'Invalid security code'` - The user has attempted to complete the attestation with an incorrect security code.

#### 401, Unauthorized

- `'Missing authentication'` - the authentication header is missing from the request
- `'Invalid signature'` - The authentication header failed signature verification. It should be signed by either the account's DEK or wallet key.
2 changes: 1 addition & 1 deletion packages/attestation-service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@celo/attestation-service",
"version": "1.5.0-dev",
"version": "1.5.0",
"description": "Issues attestation messages for Celo's identity protocol",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down

0 comments on commit 38c753f

Please sign in to comment.