Skip to content

Commit

Permalink
Add stage to Signed API
Browse files Browse the repository at this point in the history
  • Loading branch information
Siegrift committed Dec 4, 2023
1 parent 7ba8b6d commit 1c3b93a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ or
"allowedAirnodes": ["0xB47E3D8734780430ee6EfeF3c5407090601Dcd15"]
```

##### `stage`

An identifier of the deployment stage. This is used to distinguish between different deployments of Signed API, for
example `dev`, `staging` or `production`. The stage value can have 256 characters at maximum and can only include
lowercase alphanumeric characters and hyphens.

## API

The API provides the following endpoints:
Expand Down
3 changes: 2 additions & 1 deletion packages/api/config/signed-api.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"delaySeconds": 15
}
],
"allowedAirnodes": ["0xbF3137b0a7574563a23a8fC8badC6537F98197CC"]
"allowedAirnodes": ["0xbF3137b0a7574563a23a8fC8badC6537F98197CC"],
"stage": "local"
}
3 changes: 3 additions & 0 deletions packages/api/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export const configSchema = z.strictObject({
endpoints: endpointsSchema,
cache: cacheSchema.optional(),
allowedAirnodes: allowedAirnodesSchema,
stage: z
.string()
.regex(/^[\da-z-]{1,256}$/, 'Only lowercase letters, numbers and hyphens are allowed (max 256 characters)'),
});

export type Config = z.infer<typeof configSchema>;
Expand Down
3 changes: 2 additions & 1 deletion packages/e2e/src/signed-api/signed-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"delaySeconds": 10
}
],
"allowedAirnodes": ["0xbF3137b0a7574563a23a8fC8badC6537F98197CC"]
"allowedAirnodes": ["0xbF3137b0a7574563a23a8fC8badC6537F98197CC"],
"stage": "e2e-test"
}

0 comments on commit 1c3b93a

Please sign in to comment.