@getjones/test-infra 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getjones/test-infra",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Providing internal and openapi interface",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,4 +1,9 @@
1
1
  const accountsAPI = require('./accounts.openapi.api');
2
+ const crypto = require('crypto');
3
+
4
+ const generateApiKeyValue = accountName => {
5
+ return crypto.createHash('sha256').update(accountName).digest('base64');
6
+ };
2
7
 
3
8
  const createApiKey = async (accountId, apiKeyValue, context) => {
4
9
  const data = { apiKeyValue, accountId };
@@ -39,5 +44,6 @@ module.exports = {
39
44
  getApiKeyDetails,
40
45
  deleteApiKey,
41
46
  getOrCreateApiKey,
42
- initializeApiKeyOnAws
47
+ initializeApiKeyOnAws,
48
+ generateApiKeyValue
43
49
  };