Interface TagManager

All Known Subinterfaces:
IamDb<I,G>
All Known Implementing Classes:
CommonJsonDb, JsonDocDb, MultiSourceDb

public interface TagManager
Tags are randomized strings that are used to generate text that would be improbable for attackers to guess. They're used for activities like user confirmation via email or password reset request handling.
  • Method Details

    • createTag

      String createTag(String userId, String appTagType, long duration, TimeUnit durationTimeUnit, String nonce) throws IamSvcException
      Create a tag for a given user id with a particular type and duration. If a tag for the same user with the same type exists, it's replaced with the new tag.
      Parameters:
      userId - a user ID
      appTagType - a tag type
      duration - the length of time the tag should exist
      durationTimeUnit - the time unit for the duration
      nonce - used to seed random number generator
      Returns:
      a tag
      Throws:
      IamSvcException - if there's a problem in the IAM service
    • getUserIdForTag

      String getUserIdForTag(String tag) throws IamSvcException
      Retrieves the userId associated with a tag. If the tag has expired, null is returned.
      Parameters:
      tag - a tag generated by createTag
      Returns:
      a user ID or null if no entry exists (or an entry existed but expired)
      Throws:
      IamSvcException - if there's a problem in the IAM service
    • removeMatchingTag

      void removeMatchingTag(String userId, String appTagType) throws IamSvcException
      Remove any matching tag for the given user and type.
      Parameters:
      userId - a user ID
      appTagType - a tag type
      Throws:
      IamSvcException - if there's a problem in the IAM service
    • sweepExpiredTags

      void sweepExpiredTags() throws IamSvcException
      Sweep any expired tags. The tag manager implementation may not actually require this operation. In that case, make it a no-op.
      Throws:
      IamSvcException - if there's a problem in the IAM service