-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed API deletion to instead set key as inactive
- Loading branch information
billkalter
committed
Oct 21, 2016
1 parent
da1c856
commit eda9aaf
Showing
28 changed files
with
608 additions
and
368 deletions.
There are no files selected for viewing
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
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
27 changes: 27 additions & 0 deletions
27
auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/identity/IdentityState.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.bazaarvoice.emodb.auth.identity; | ||
|
||
/** | ||
* State for an {@link AuthIdentity}. Currently there are 3 possible values: | ||
* | ||
* <ol> | ||
* <li>ACTIVE. This is the normal state for an identity.</li> | ||
* <li>INACTIVE. The identity exists but cannot be authenticated or authorized for any operations.</li> | ||
* <li>MIGRATED. The identity's ID has been migrated and the current identity is a historical record from the | ||
* old ID. Like INACTIVE, a MIGRATED identity cannot be authenticated or authorized.</li> | ||
* </ol> | ||
*/ | ||
public enum IdentityState { | ||
ACTIVE, | ||
INACTIVE, | ||
MIGRATED; | ||
|
||
/** | ||
* Returns true if an identity is in a state where it can be authorized or authenticated. The current | ||
* implementation redundantly returns true only for ACTIVE. Even so, use of this method is preferred to | ||
* verify if an identity can be authorized or authenticated since that tautology may change if other states | ||
* are introduced. | ||
*/ | ||
public boolean isActive() { | ||
return this == ACTIVE; | ||
} | ||
} |
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
25 changes: 25 additions & 0 deletions
25
auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/identity/InternalIdentity.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.bazaarvoice.emodb.auth.identity; | ||
|
||
import java.util.Date; | ||
import java.util.Set; | ||
|
||
/** | ||
* Interface for getting information about an identity for internal purposes. Notably it this interface does not | ||
* expose the secret ID of the identity, such as its API key. This allows use of the identity for validating | ||
* permissions and other common metadata without exposing the ID necessary for logging in, spoofing, or otherwise | ||
* leaking the identity. | ||
*/ | ||
public interface InternalIdentity { | ||
|
||
String getInternalId(); | ||
|
||
Set<String> getRoles(); | ||
|
||
String getOwner(); | ||
|
||
String getDescription(); | ||
|
||
Date getIssued(); | ||
|
||
IdentityState getState(); | ||
} |
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
Oops, something went wrong.