spring-projects / spring-projects/spring-security

JdbcTokenRepositoryImpl - Table name should have configurable

Open
#5,183 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Summary

The table name (persistent_logins) lives in final strings for multiple times. Why isn't there a better approach for this?
E.g.: public void setTokenTableName(String tableName) which can come from a new interface e.g. TableAwareTokenRepository or something like that.

Actual Behavior

The end-user cannot configure the tablename

Expected Behavior

I suggest it should be configurable.

Version

4.2.3.RELEASE

Sample

/** Default SQL for creating the database table to store the tokens */
public static final String CREATE_TABLE_SQL = "create table persistent_logins (username varchar(64) not null, series varchar(64) primary key, " + "token varchar(64) not null, last_used timestamp not null)";

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with JdbcTokenRepositoryImpl and inspect the repeated persistent_logins table name, including CREATE_TABLE_SQL. Trace how the repository creates and uses the token table, then determine the configuration boundary requested by the issue. Done means the table name can be configured without changing the repository's token-storage behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
authentication
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.