def noCache()

in membership-attribute-service/app/actions/CommonActions.scala [22:49]


  def noCache(result: Result): Result = NoCache(result)

  val NoCacheAction = resultModifier(noCache)

  // TODO: Might need a better name as authoriseForRecentLogin checks for recency and scopes
  def AuthorizeForScopes(requiredScopes: List[AccessScope]): ActionBuilder[AuthenticatedUserAndBackendRequest, AnyContent] =
    NoCacheAction andThen new AuthAndBackendViaAuthLibAction(touchpointBackends, requiredScopes, testUserChecker)

  def AuthorizeForRecentLogin(
      howToHandleRecencyOfSignedIn: HowToHandleRecencyOfSignedIn,
      requiredScopes: List[AccessScope],
  ): ActionBuilder[AuthAndBackendRequest, AnyContent] =
    NoCacheAction andThen new AuthAndBackendViaIdapiAction(touchpointBackends, howToHandleRecencyOfSignedIn, testUserChecker, requiredScopes)

  // TODO: Is this redundant, given that authoriseForRecentLogin checks for recency and scopes?
  def AuthorizeForRecentLoginAndScopes(
      howToHandleRecencyOfSignedIn: HowToHandleRecencyOfSignedIn,
      requiredScopes: List[AccessScope],
  ): ActionBuilder[AuthenticatedUserAndBackendRequest, AnyContent] =
    NoCacheAction andThen
      new AuthAndBackendViaIdapiAction(touchpointBackends, howToHandleRecencyOfSignedIn, testUserChecker, requiredScopes) andThen
      new AuthAndBackendViaAuthLibAction(touchpointBackends, requiredScopes, testUserChecker)

  private def resultModifier(f: Result => Result) = new ActionBuilder[Request, AnyContent] {
    override val parser = bodyParser
    override val executionContext = ex
    def invokeBlock[A](request: Request[A], block: (Request[A]) => Future[Result]) = block(request).map(f)
  }