io.github.lc.oss.commons.web.tokens.CsrfToken Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of web Show documentation
Show all versions of web Show documentation
A basic extension of the Spring web framework to accelerate application development
The newest version!
package io.github.lc.oss.commons.web.tokens;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonProperty;
public class CsrfToken implements Token {
private final String id;
private final long expires;
public CsrfToken(int expires) {
this.id = UUID.randomUUID().toString();
this.expires = System.currentTimeMillis() + expires;
}
public CsrfToken(@JsonProperty("id") String id, @JsonProperty("expires") long expires) {
this.id = id;
this.expires = expires;
}
@Override
public String getId() {
return this.id;
}
@Override
public long getExpires() {
return this.expires;
}
}