Skip to content
Open
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
5 changes: 5 additions & 0 deletions apps/api-gateway/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import { NatsInterceptor } from '@credebl/common';
import { UpdatableValidationPipe } from '@credebl/common/custom-overrideable-validation-pipe';
dotenv.config();

/**
* Bootstraps and starts the NestJS API Gateway application with microservice integration, middleware, API documentation, security, and global configuration.
*
* Initializes the application, connects to a NATS microservice, sets up middleware for request parsing and URL validation, configures Swagger API documentation, applies global exception filters, enables CORS based on environment configuration, serves static files, applies a custom global validation pipe, enables security middleware, and starts listening on the configured host and port.
*/
async function bootstrap(): Promise<void> {
const app = await NestFactory.create(AppModule);

Expand Down
8 changes: 7 additions & 1 deletion libs/common/src/custom-overrideable-validation-pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ import { Reflector } from '@nestjs/core';

export const REWRITE_VALIDATION_OPTIONS = 'rewrite_validation_options';

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
/**
* Decorator that overrides global validation options for a specific route handler or controller.
*
* Attaches custom {@link ValidatorOptions} metadata, allowing selective adjustment of validation behavior such as whitelisting or property checks on a per-handler or per-class basis.
*
* @param options - The validation options to apply for the decorated handler or class.
*/
export function RewriteValidationOptions(options: ValidatorOptions) {
return SetMetadata(REWRITE_VALIDATION_OPTIONS, options);
}
Expand Down
15 changes: 14 additions & 1 deletion libs/prisma-service/prisma/scripts/update_client_credential_data.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ DB_URL=$1
CLIENT_ID=$2
CLIENT_SECRET=$3

# Function to update clientId and clientSecret
# Updates the clientId and clientSecret fields in the "user" table where both are NULL.
#
# Globals:
# DB_URL: The database connection URL.
# CLIENT_ID: The new clientId value to set.
# CLIENT_SECRET: The new clientSecret value to set.
#
# Outputs:
# Prints the result of the SQL update operation to STDOUT, including success or failure messages.
#
# Example:
#
# update_client_credentials
# # Updates all users with NULL clientId and clientSecret, setting them to the provided values.
update_client_credentials() {
local update_query="UPDATE \"user\" SET \"clientId\" = '${CLIENT_ID}', \"clientSecret\" = '${CLIENT_SECRET}' WHERE \"clientId\" IS NULL AND \"clientSecret\" IS NULL;"

Expand Down