11package restx .security ;
22
3+ import com .google .common .base .Optional ;
4+
35import static restx .http .HTTP .headerTokenCompatible ;
46
57/**
810public class RestxSessionCookieDescriptor {
911 private String cookieName ;
1012 private String cookieSignatureName ;
13+ private String domain ;
14+ private Boolean secure ;
1115
1216 public RestxSessionCookieDescriptor (String cookieName , String cookieSignatureName ) {
17+ this (cookieName , cookieSignatureName , Optional .<String >absent (), Optional .<Boolean >absent ());
18+ }
19+
20+ public RestxSessionCookieDescriptor (String cookieName , String cookieSignatureName ,
21+ Optional <String > domain , Optional <Boolean > secure ) {
1322 this .cookieName = headerTokenCompatible (cookieName , "_" );
1423 this .cookieSignatureName = headerTokenCompatible (cookieSignatureName , "_" );
24+ this .domain = domain .orNull ();
25+ this .secure = secure .orNull ();
1526 }
1627
1728 public String getCookieName () {
@@ -21,4 +32,12 @@ public String getCookieName() {
2132 public String getCookieSignatureName () {
2233 return cookieSignatureName ;
2334 }
35+
36+ public Optional <String > getDomain () {
37+ return Optional .fromNullable (domain );
38+ }
39+
40+ public Optional <Boolean > getSecure () {
41+ return Optional .fromNullable (secure );
42+ }
2443}
0 commit comments