-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Mert-Z/mertz_tokenrepositoryfix
Resolves #1
- Loading branch information
Showing
6 changed files
with
157 additions
and
215 deletions.
There are no files selected for viewing
276 changes: 83 additions & 193 deletions
276
src/main/java/mertz/security/oauth2/provider/token/store/cassandra/CassandraTokenStore.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 11 additions & 12 deletions
23
...ava/mertz/security/oauth2/provider/token/store/cassandra/model/ClientIdToAccessToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,37 @@ | ||
package mertz.security.oauth2.provider.token.store.cassandra.model; | ||
|
||
import java.util.Set; | ||
|
||
import org.springframework.data.cassandra.mapping.PrimaryKey; | ||
import org.springframework.cassandra.core.PrimaryKeyType; | ||
import org.springframework.data.cassandra.mapping.PrimaryKeyColumn; | ||
import org.springframework.data.cassandra.mapping.Table; | ||
|
||
@Table(value = ClientIdToAccessToken.TABLE) | ||
public class ClientIdToAccessToken { | ||
|
||
public static final String TABLE = "client_id_to_access"; | ||
|
||
@PrimaryKey | ||
private String key; | ||
@PrimaryKeyColumn(name = "key", ordinal = 0, type = PrimaryKeyType.PARTITIONED) | ||
private String key; | ||
|
||
// Set of JSON | ||
private Set<String> oAuth2AccessTokenSet; | ||
@PrimaryKeyColumn(name = "oAuth2AccessToken", ordinal = 1, type = PrimaryKeyType.CLUSTERED) | ||
private String oAuth2AccessToken; | ||
|
||
public ClientIdToAccessToken(String key, Set<String> oAuth2AccessTokenSet) { | ||
public ClientIdToAccessToken(String key, String oAuth2AccessToken) { | ||
super(); | ||
this.key = key; | ||
this.oAuth2AccessTokenSet = oAuth2AccessTokenSet; | ||
this.oAuth2AccessToken = oAuth2AccessToken; | ||
} | ||
|
||
public final String getKey() { | ||
return key; | ||
} | ||
|
||
public final Set<String> getoAuth2AccessTokenSet() { | ||
return oAuth2AccessTokenSet; | ||
public final String getOAuth2AccessToken() { | ||
return oAuth2AccessToken; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ClientIdToAccessToken [key=" + key + ", oAuth2AccessTokenSet=" + oAuth2AccessTokenSet + "]"; | ||
return "ClientIdToAccessToken [key=" + key + ", oAuth2AccessToken=" + oAuth2AccessToken + "]"; | ||
} | ||
|
||
} |
20 changes: 10 additions & 10 deletions
20
...ava/mertz/security/oauth2/provider/token/store/cassandra/model/UsernameToAccessToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
package mertz.security.oauth2.provider.token.store.cassandra.model; | ||
|
||
import java.util.Set; | ||
|
||
import org.springframework.data.cassandra.mapping.PrimaryKey; | ||
import org.springframework.cassandra.core.PrimaryKeyType; | ||
import org.springframework.data.cassandra.mapping.PrimaryKeyColumn; | ||
import org.springframework.data.cassandra.mapping.Table; | ||
|
||
@Table(value = UsernameToAccessToken.TABLE) | ||
public class UsernameToAccessToken { | ||
|
||
public static final String TABLE = "uname_to_access"; | ||
|
||
@PrimaryKey | ||
@PrimaryKeyColumn(name = "key", ordinal = 0, type = PrimaryKeyType.PARTITIONED) | ||
private String key; | ||
|
||
// Set of JSON | ||
private Set<String> oAuth2AccessTokenSet; | ||
@PrimaryKeyColumn(name = "oAuth2AccessToken", ordinal = 1, type = PrimaryKeyType.CLUSTERED) | ||
private String oAuth2AccessToken; | ||
|
||
public UsernameToAccessToken(String key, Set<String> oAuth2AccessTokenSet) { | ||
public UsernameToAccessToken(String key, String oAuth2AccessToken) { | ||
super(); | ||
this.key = key; | ||
this.oAuth2AccessTokenSet = oAuth2AccessTokenSet; | ||
this.oAuth2AccessToken = oAuth2AccessToken; | ||
} | ||
|
||
public final String getKey() { | ||
return key; | ||
} | ||
|
||
public final Set<String> getoAuth2AccessTokenSet() { | ||
return oAuth2AccessTokenSet; | ||
public final String getOAuth2AccessToken() { | ||
return oAuth2AccessToken; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "UsernameToAccessToken [key=" + key + ", oAuth2AccessTokenSet=" + oAuth2AccessTokenSet + "]"; | ||
return "UsernameToAccessToken [key=" + key + ", oAuth2AccessToken=" + oAuth2AccessToken + "]"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters