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

feat(users): Added blacklist for users #3469

Merged
merged 13 commits into from
Jan 31, 2024
Merged

Conversation

racnan
Copy link
Contributor

@racnan racnan commented Jan 29, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Added blacklist for users.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Invalidate the token after logout.

How did you test it?

Use the below api to logout.

curl --location --request POST '<URL>/user/signout' \
--header 'Authorization: Bearer JWT'

When you use the same token as above to test any other api then response will be 401.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@racnan racnan added C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed A-users Area: Users labels Jan 29, 2024
@racnan racnan self-assigned this Jan 29, 2024
@racnan racnan requested review from a team as code owners January 29, 2024 10:37
@racnan racnan linked an issue Jan 29, 2024 that may be closed by this pull request
@racnan racnan requested a review from a team as a code owner January 30, 2024 07:45
lsampras
lsampras previously approved these changes Jan 30, 2024
ThisIsMani
ThisIsMani previously approved these changes Jan 30, 2024
Comment on lines +50 to +63
fn get_redis_connection<A: AppStateInfo>(state: &A) -> RouterResult<Arc<RedisConnectionPool>> {
state
.store()
.get_redis_conn()
.change_context(ApiErrorResponse::InternalServerError)
.attach_printable("Failed to get redis connection")
}

fn expiry_to_i64(expiry: u64) -> RouterResult<i64> {
expiry
.try_into()
.into_report()
.change_context(ApiErrorResponse::InternalServerError)
}
Copy link
Member

Choose a reason for hiding this comment

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

You can inline this

@preetamrevankar preetamrevankar added this pull request to the merge queue Jan 31, 2024
Merged via the queue into main with commit e331d2d Jan 31, 2024
10 of 12 checks passed
@preetamrevankar preetamrevankar deleted the impl-user-blacklist branch January 31, 2024 07:32
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-users Area: Users C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: blacklist user
7 participants