Add refresh-tokens module: JWT refresh token rotation, token families and reuse detection on Spring Security 7.1
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6XzpJxZ25cDyuw1Uk
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package com.ankurm.refresh;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
/** Collects lines and writes them to {@code output/<name>.txt} (relative to the module directory). */
|
||||
final class Transcript {
|
||||
|
||||
private final String name;
|
||||
private final StringBuilder text = new StringBuilder();
|
||||
|
||||
Transcript(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
Transcript line(String format, Object... args) {
|
||||
text.append(args.length == 0 ? format : String.format(format, args)).append('\n');
|
||||
return this;
|
||||
}
|
||||
|
||||
void write() throws IOException {
|
||||
Path dir = Path.of("output");
|
||||
Files.createDirectories(dir);
|
||||
Files.writeString(dir.resolve(name + ".txt"), text.toString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user