Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Development) : Implement an API Endpoint to allow users to add username #8

Open
rohit-zip opened this issue May 22, 2024 · 1 comment
Labels
enhancement New feature or request Feature good first issue Good for newcomers

Comments

@rohit-zip
Copy link
Member

Issue Description

Rules:

  • Code implementation should strictly adhere to the designated components such as User Controller, User Implementation, and associated modules.
  • Maintain conformity with the CQRS pattern while refraining from any alterations to the project structure.
  • Avoid introducing new variables in User Entity and Document.
  • Ensure data persistence across both PostgreSQL and Elasticsearch.

Endpoint:

Request Param:

  • username: Specify the username for the user.

Note:

Utilize @AuthenticationPrincipal to access logged-in user details, including userId, email, username, and authorities.

Response Body:

  • ApplicationResponse: Contains a descriptive message along with the affected userId.

Validations:

  • Username should be unique
  • Automatic extraction of logged-in user data via @AuthenticationPrincipal.
  • Username constraints: Max 16 characters, no special characters at the beginning, only "-" and "_" allowed as special characters, and numbers permitted.
  • Convert the username to lowercase.

Exception Handling

  • Throw BadRequest or any other exception with proper exception code in it. Please message for the error in error-messages.properties file present in resources directory.
  • Add message in front of that particular error code
  • Error codes should be sequential and starts with DE which depicts Data Error

Contact:

For further assistance, please reach out:

@rohit-zip rohit-zip changed the title (Development) : Implementa API Endpoint to allow users to add username (Development) : Implement an API Endpoint to allow users to add username May 22, 2024
@rohit-zip rohit-zip added enhancement New feature or request good first issue Good for newcomers labels May 22, 2024
@rohit-zip rohit-zip moved this to Backlog in Bloggios - Open Source May 22, 2024
@kesrishubham2510
Copy link

kesrishubham2510 commented Aug 25, 2024

Hi @rohit-zip, I see the targetController has a RequestMapping path "/auth-provider/user-auth/read" already adding a post method with "/auth-provider/user/add-username" endpoint would be redundant I think.

Suggestion:- Either the RequestMapping could be modified to EndpointConstants.CONTEXT_PATH and the "/user-auth/read" can be appended specifically to the Get methods only.

Am I missing anything here ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Feature good first issue Good for newcomers
Projects
Status: Backlog
Development

No branches or pull requests

2 participants