Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
API_VERSION: process.env.API_VERSION || 'v6',
AUTH_SECRET: process.env.AUTH_SECRET || 'mysecret',
VALID_ISSUERS: process.env.VALID_ISSUERS || '["https://api.topcoder-dev.com", "https://api.topcoder.com", "https://topcoder-dev.auth0.com/", "https://auth.topcoder-dev.com/"]',
IDENTITY_DB_URL: process.env.IDENTITY_DB_URL,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The IDENTITY_DB_URL is added without a default value. Ensure that this environment variable is always set in all environments to prevent potential runtime errors.


// used to get M2M token
AUTH0_URL: process.env.AUTH0_URL,
Expand Down Expand Up @@ -69,6 +70,7 @@ module.exports = {
ALL: process.env.SCOPE_MEMBERS_ALL || 'all:user_profiles'
}
},
DELETE_USER_SCOPE: process.env.SCOPE_DELETE_USER || 'delete:user',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ security]
The DELETE_USER_SCOPE is introduced without a clear indication of its usage in the system. Ensure that this scope is properly validated and enforced in the application logic to prevent unauthorized access.


// Member identifiable info fields, copilots, admins, or M2M can get these fields
// Anyone in the constants.AUTOCOMPLETE_ROLES will have access to these fields
Expand Down Expand Up @@ -123,4 +125,10 @@ module.exports = {
USERFLOW: process.env.USERFLOW_PRIVATE_KEY
},
MEMBER_SERVICE_PRISMA_TIMEOUT: process.env.MEMBER_SERVICE_PRISMA_TIMEOUT ? parseInt(process.env.MEMBER_SERVICE_PRISMA_TIMEOUT, 10) : 10000,

MAILCHIMP: {
API_KEY: process.env.MAILCHIMP_API_KEY,
SERVER_PREFIX: process.env.MAILCHIMP_SERVER_PREFIX,
LIST_FETCH_COUNT: process.env.MAILCHIMP_LIST_FETCH_COUNT ? Number(process.env.MAILCHIMP_LIST_FETCH_COUNT) : 1000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
Consider validating the MAILCHIMP_LIST_FETCH_COUNT to ensure it is within acceptable limits, as setting it too high could lead to performance issues or API rate limits.

}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "TopCoder Member V6 API",
"main": "app.js",
"scripts": {
"postinstall": "prisma generate --schema=prisma/schema.prisma && prisma generate --schema=prisma/skills-schema.prisma",
"postinstall": "prisma generate --schema=prisma/schema.prisma && prisma generate --schema=prisma/skills-schema.prisma && prisma generate --schema=prisma/identity-schema.prisma",
"start": "node app.js",
"start:dev": "nodemon app.js",
"lint": "standard",
Expand Down
2 changes: 1 addition & 1 deletion prisma/generated/client/edge.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions prisma/generated/client/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
1 change: 1 addition & 0 deletions prisma/generated/identity-client/client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./index"
4 changes: 4 additions & 0 deletions prisma/generated/identity-client/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
module.exports = { ...require('.') }
1 change: 1 addition & 0 deletions prisma/generated/identity-client/default.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./index"
4 changes: 4 additions & 0 deletions prisma/generated/identity-client/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
module.exports = { ...require('.') }
1 change: 1 addition & 0 deletions prisma/generated/identity-client/edge.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./default"
201 changes: 201 additions & 0 deletions prisma/generated/identity-client/edge.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@

/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */

Object.defineProperty(exports, "__esModule", { value: true });

const {
PrismaClientKnownRequestError,
PrismaClientUnknownRequestError,
PrismaClientRustPanicError,
PrismaClientInitializationError,
PrismaClientValidationError,
getPrismaClient,
sqltag,
empty,
join,
raw,
skip,
Decimal,
Debug,
objectEnumValues,
makeStrictEnum,
Extensions,
warnOnce,
defineDmmfProperty,
Public,
getRuntime,
createParam,
} = require('./runtime/edge.js')


const Prisma = {}

exports.Prisma = Prisma
exports.$Enums = {}

/**
* Prisma Client JS version: 6.13.0
* Query Engine version: 361e86d0ea4987e9f53a565309b3eed797a6bcbd
*/
Prisma.prismaVersion = {
client: "6.13.0",
engine: "361e86d0ea4987e9f53a565309b3eed797a6bcbd"
}

Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError
Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError
Prisma.PrismaClientInitializationError = PrismaClientInitializationError
Prisma.PrismaClientValidationError = PrismaClientValidationError
Prisma.Decimal = Decimal

/**
* Re-export of sql-template-tag
*/
Prisma.sql = sqltag
Prisma.empty = empty
Prisma.join = join
Prisma.raw = raw
Prisma.validator = Public.validator

/**
* Extensions
*/
Prisma.getExtensionContext = Extensions.getExtensionContext
Prisma.defineExtension = Extensions.defineExtension

/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull
Prisma.JsonNull = objectEnumValues.instances.JsonNull
Prisma.AnyNull = objectEnumValues.instances.AnyNull

Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull
}





/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});

exports.Prisma.UserScalarFieldEnum = {
user_id: 'user_id',
handle: 'handle',
handle_lower: 'handle_lower',
modify_date: 'modify_date',
status: 'status'
};

exports.Prisma.EmailScalarFieldEnum = {
email_id: 'email_id',
user_id: 'user_id',
address: 'address',
modify_date: 'modify_date'
};

exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
};

exports.Prisma.QueryMode = {
default: 'default',
insensitive: 'insensitive'
};

exports.Prisma.NullsOrder = {
first: 'first',
last: 'last'
};


exports.Prisma.ModelName = {
user: 'user',
email: 'email'
};
/**
* Create the Client
*/
const config = {
"generator": {
"name": "identityClient",
"provider": {
"fromEnvVar": null,
"value": "prisma-client-js"
},
"output": {
"value": "/home/jmgasper/Documents/Git/v6/member-api-v6/prisma/generated/identity-client",
"fromEnvVar": null
},
"config": {
"engineType": "library"
},
"binaryTargets": [
{
"fromEnvVar": null,
"value": "debian-openssl-3.0.x",
"native": true
}
],
"previewFeatures": [],
"sourceFilePath": "/home/jmgasper/Documents/Git/v6/member-api-v6/prisma/identity-schema.prisma",
"isCustomOutput": true
},
"relativeEnvPaths": {
"rootEnvPath": null
},
"relativePath": "../..",
"clientVersion": "6.13.0",
"engineVersion": "361e86d0ea4987e9f53a565309b3eed797a6bcbd",
"datasourceNames": [
"identitydb"
],
"activeProvider": "postgresql",
"postinstall": false,
"inlineDatasources": {
"identitydb": {
"url": {
"fromEnvVar": "IDENTITY_DB_URL",
"value": null
}
}
},
"inlineSchema": "generator identityClient {\n provider = \"prisma-client-js\"\n output = \"./generated/identity-client\"\n}\n\ndatasource identitydb {\n provider = \"postgresql\"\n url = env(\"IDENTITY_DB_URL\")\n schemas = [\"identity\"]\n}\n\nmodel user {\n user_id Decimal @id(map: \"u175_45\") @default(dbgenerated(\"nextval('sequence_user_seq'::regclass)\")) @identitydb.Decimal(10, 0)\n handle String @identitydb.VarChar(50)\n handle_lower String? @identitydb.VarChar(50)\n modify_date DateTime? @default(now()) @identitydb.Timestamp(6)\n status String @identitydb.VarChar(3)\n\n @@index([handle])\n @@index([handle_lower], map: \"user_lower_handle_idx\")\n @@index([status, handle_lower])\n @@map(\"user\")\n @@schema(\"identity\")\n}\n\nmodel email {\n email_id Decimal @id(map: \"u110_23\") @default(dbgenerated(\"nextval('sequence_email_seq'::regclass)\")) @identitydb.Decimal(10, 0)\n user_id Decimal? @identitydb.Decimal(10, 0)\n address String? @identitydb.VarChar(100)\n modify_date DateTime? @default(now()) @identitydb.Timestamp(6)\n\n @@index([user_id], map: \"email_user_id_idx\")\n @@index([address])\n @@map(\"email\")\n @@schema(\"identity\")\n}\n",
"inlineSchemaHash": "c5a596f0918d1322e0688539e5f1dd09423833ad2a87dca3d89817938caeaaf8",
"copyEngine": true
}
config.dirname = '/'

config.runtimeDataModel = JSON.parse("{\"models\":{\"user\":{\"dbName\":\"user\",\"schema\":\"identity\",\"fields\":[{\"name\":\"user_id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"nativeType\":[\"Decimal\",[\"10\",\"0\"]],\"default\":{\"name\":\"dbgenerated\",\"args\":[\"nextval('sequence_user_seq'::regclass)\"]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"handle\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":[\"VarChar\",[\"50\"]],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"handle_lower\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":[\"VarChar\",[\"50\"]],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"modify_date\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":[\"Timestamp\",[\"6\"]],\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":[\"VarChar\",[\"3\"]],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"email\":{\"dbName\":\"email\",\"schema\":\"identity\",\"fields\":[{\"name\":\"email_id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"nativeType\":[\"Decimal\",[\"10\",\"0\"]],\"default\":{\"name\":\"dbgenerated\",\"args\":[\"nextval('sequence_email_seq'::regclass)\"]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user_id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"nativeType\":[\"Decimal\",[\"10\",\"0\"]],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"nativeType\":[\"VarChar\",[\"100\"]],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"modify_date\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"nativeType\":[\"Timestamp\",[\"6\"]],\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}")
defineDmmfProperty(exports.Prisma, config.runtimeDataModel)
config.engineWasm = undefined
config.compilerWasm = undefined

config.injectableEdgeEnv = () => ({
parsed: {
IDENTITY_DB_URL: typeof globalThis !== 'undefined' && globalThis['IDENTITY_DB_URL'] || typeof process !== 'undefined' && process.env && process.env.IDENTITY_DB_URL || undefined
}
})

if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) {
Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined)
}

const PrismaClient = getPrismaClient(config)
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)

Loading
Loading