Blamer-io / hub

Blamer Core Engine
MIT License
5 stars 3 forks source link

14.09.2023 issue-52: insert chat id, token, token alias into database if token is valid #65

Open iColdLight opened 1 year ago

iColdLight commented 1 year ago

Added dependency for json web token in the pom.xml file Added validateToken method in the TokenController class Modified registerToken method to include validation of token in the TokenController class


PR-Codex overview

Focus of the PR:

This PR focuses on adding token validation and insertion functionality to the codebase.

Detailed summary:

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

zoeself commented 1 year ago

@iColdLight thank you for your Pull Request. I'll assign someone to review it soon.

If this PR solves a todo from the code, please don't forget to remove it.

zoeself commented 1 year ago

@h1alexbel please review this Pull Request. Deadline (when it should be merged or closed) is 2023-09-17T19:18:59.313614.

You should check if the requirements have been implemented (partially or in full), if there are unit tests covering the changes and if the CI build passes. Feel free to reject the PR or ask for changes if it's too big or not clear enough.

Estimation here is 30 minutes, that's how much you will be paid. You will be paid even if this PR gets rejected.

zoeself commented 1 year ago

@h1alexbel Don't forget to close this ticket before the deadline (2023-09-17T19:18:59). You are past the first half of the allowed period.

iColdLight commented 1 year ago

Does it mean that I need to work on creating JWT TokenProvider, JWT TokenFIlter, JWT User, etc.?

h1alexbel commented 1 year ago

@iColdLight we don't need JWTs. We are dealing with simple text token from GitHub

And this token is not JWT, it's a just simple GitHub token, simple string

zoeself commented 1 year ago

@h1alexbel Looks like you've missed the task deadline (2023-09-17T19:18:59). You are now resigned from this task.

Please stop working on it, you will not be paid. I will assign it to someone else soon.

zoeself commented 1 year ago

@h1alexbel I couldn't find any assignee for this task. This is either because there are no contributors with role REV available or because the project does not have enough funds.

Please, make sure there is at least one available contributor with the required role and the project can afford to pay them.

iColdLight commented 1 year ago

Hi! I made new changes. I wonder, if you can see them. And sorry for 3 commits in a row... made slight changes in the last two.

l3r8yJ commented 1 year ago

@iColdLight it's okay with commits, but you can read this

l3r8yJ commented 1 year ago

@h1alexbel reminder

l3r8yJ commented 1 year ago

/codex Could there be a problem here in terms of non-blocking interaction?

pr-codex[bot] commented 1 year ago

Could there be a problem here in terms of non-blocking interaction?

@l3r8yJ Yes, there could be a problem with non-blocking interaction in the code. The TokenValidation class implements the Tokens interface and overrides the add method. Inside the add method, there are multiple database interactions (validateToken, checkIfTokenExists, and this.tokenInsertion.add) that return Mono objects, indicating asynchronous operations.

However, the code does not utilize reactive operators like flatMap, map, or zip to chain these operations together and ensure non-blocking execution. Instead, it directly calls these methods synchronously, which may lead to blocking behavior and potential performance issues.

To ensure non-blocking interaction, the code should use reactive operators to compose the asynchronous operations and handle the results asynchronously.

l3r8yJ commented 1 year ago

@iColdLight take note of this comment

Could there be a problem here in terms of non-blocking interaction?

@l3r8yJ Yes, there could be a problem with non-blocking interaction in the code. The TokenValidation class implements the Tokens interface and overrides the add method. Inside the add method, there are multiple database interactions (validateToken, checkIfTokenExists, and this.tokenInsertion.add) that return Mono objects, indicating asynchronous operations.

However, the code does not utilize reactive operators like flatMap, map, or zip to chain these operations together and ensure non-blocking execution. Instead, it directly calls these methods synchronously, which may lead to blocking behavior and potential performance issues.

To ensure non-blocking interaction, the code should use reactive operators to compose the asynchronous operations and handle the results asynchronously.

it's an AI response, could be wrong

iColdLight commented 1 year ago

I made a change to my TokenValidation class to ensure non-blocking interaction. May you take a look?

h1alexbel commented 1 year ago

@l3r8yJ take a look, please