Skip to content

Commit 1b89be7

Browse files
committed
Merge branch 'feature/account_verification_status' into feature/profile_nudge
2 parents ddf3723 + c05c8ba commit 1b89be7

File tree

6 files changed

+19
-1
lines changed

6 files changed

+19
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ The following parameters can be set in config files or in env variables:
2828
- GROUPS_API_URL: Groups API URL
2929
- AMAZON.AWS_ACCESS_KEY_ID: The Amazon certificate key to use when connecting. Use local dynamodb you can set fake value
3030
- AMAZON.AWS_SECRET_ACCESS_KEY: The Amazon certificate access key to use when connecting. Use local dynamodb you can set fake value
31+
- AMAZON.AWS.SESSION_TOKEN: The user session token, used when developing locally against the TC dev AWS services
3132
- AMAZON.AWS_REGION: The Amazon certificate region to use when connecting. Use local dynamodb you can set fake value
3233
- AMAZON.IS_LOCAL_DB: Use Amazon DynamoDB Local or server.
3334
- AMAZON.DYNAMODB_URL: The local url if using Amazon DynamoDB Local

config/default.js

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module.exports = {
3232
AMAZON: {
3333
AWS_ACCESS_KEY_ID: process.env.AWS_ACCESS_KEY_ID,
3434
AWS_SECRET_ACCESS_KEY: process.env.AWS_SECRET_ACCESS_KEY,
35+
AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN,
3536
AWS_REGION: process.env.AWS_REGION || 'us-east-1',
3637
IS_LOCAL_DB: process.env.IS_LOCAL_DB ? process.env.IS_LOCAL_DB === 'true' : false,
3738
DYNAMODB_URL: process.env.DYNAMODB_URL || 'http://localhost:7777',

docs/swagger.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ paths:
237237
238238
+ updatedBy - Select the field updatedBy
239239
240+
+ verified - Select the field verified
240241
241242
The following fields are secured, without a valid token will not be in response
242243
@@ -1400,6 +1401,8 @@ definitions:
14001401
type: string
14011402
status:
14021403
type: string
1404+
verified:
1405+
type: boolean
14031406
addresses:
14041407
type: array
14051408
items:

src/models/Member.js

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ const schema = new Schema({
3030
name: 'email-index'
3131
}]
3232
},
33+
verified: {
34+
type: Boolean,
35+
required: false
36+
},
3337
maxRating: {
3438
type: Object,
3539
required: false

src/models/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@
44

55
const config = require('config')
66
const dynamoose = require('dynamoose')
7+
const AWS = require('aws-sdk')
78

89
const awsConfig = {
910
region: config.AMAZON.AWS_REGION
1011
}
12+
//Support AWS session token for local development against dev servers
1113
if (config.AMAZON.AWS_ACCESS_KEY_ID && config.AMAZON.AWS_SECRET_ACCESS_KEY) {
14+
let credentials = new AWS.Credentials(config.AMAZON.AWS_ACCESS_KEY_ID,
15+
config.AMAZON.AWS_SECRET_ACCESS_KEY,
16+
config.AMAZON.AWS_SESSION_TOKEN)
17+
awsConfig.credentials=credentials
18+
}
19+
else if (config.AMAZON.AWS_ACCESS_KEY_ID && config.AMAZON.AWS_SECRET_ACCESS_KEY) {
1220
awsConfig.accessKeyId = config.AMAZON.AWS_ACCESS_KEY_ID
1321
awsConfig.secretAccessKey = config.AMAZON.AWS_SECRET_ACCESS_KEY
1422
}

src/services/MemberService.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const constants = require('../../app-constants')
1616
const esClient = helper.getESClient()
1717

1818
const MEMBER_FIELDS = ['userId', 'handle', 'handleLower', 'firstName', 'lastName', 'tracks', 'status',
19-
'addresses', 'description', 'email', 'homeCountryCode', 'competitionCountryCode', 'photoURL', 'maxRating',
19+
'addresses', 'description', 'email', 'homeCountryCode', 'competitionCountryCode', 'photoURL', 'verified', 'maxRating',
2020
'createdAt', 'createdBy', 'updatedAt', 'updatedBy', 'emsiSkills']
2121

2222
const INTERNAL_MEMBER_FIELDS = ['newEmail', 'emailVerifyToken', 'emailVerifyTokenDate', 'newEmailVerifyToken',
@@ -235,6 +235,7 @@ updateMember.schema = {
235235
stateCode: Joi.string().allow(''),
236236
type: Joi.string()
237237
})),
238+
verified: Joi.bool(),
238239
homeCountryCode: Joi.string(),
239240
competitionCountryCode: Joi.string(),
240241
photoURL: Joi.string().uri().allow('').allow(null),

0 commit comments

Comments
 (0)