Class DevSmsInboxController

java.lang.Object
com.irurueta.authserver.authorization.api.web.ott.DevSmsInboxController
All Implemented Interfaces:
DevSmsInboxPageApi

@Controller @Profile("dev") public class DevSmsInboxController extends Object implements DevSmsInboxPageApi
Development only (dev profile): renders the SMS messages the logging sender recorded instead of sending them, so a developer or an end-to-end test can read the code of a sign-in or of a phone enrolment. The page is as the contract apis/auth-server/web-pages/auth-server-pages-v1.yaml describes it through the generated DevSmsInboxPageApi. The inbox exists only while the logging sender is in use, so it is looked up lazily: with a real gateway configured the page is empty. It is a documented exception to the rule that src/main holds no demo-only code (the end-to-end tests run the packaged jar, so it cannot live in src/test); it is inert in every other profile because the controller is not even created.
  • Field Details

    • DEV_SMS_INBOX_PATH

      public static final String DEV_SMS_INBOX_PATH
      Path of the page, taken from the contract.
      See Also:
    • VIEW_NAME

      static final String VIEW_NAME
      Name of the template of the page.
      See Also:
    • MESSAGES_ATTRIBUTE

      static final String MESSAGES_ATTRIBUTE
      Name of the model attribute that holds the recorded messages.
      See Also:
    • smsInbox

      private final org.springframework.beans.factory.ObjectProvider<SmsInbox> smsInbox
      The inbox of the logging sender; absent when a real gateway sends the messages.
    • pageRenderer

      private final PageRenderer pageRenderer
      Renders the page.
  • Constructor Details

    • DevSmsInboxController

      public DevSmsInboxController()
  • Method Details

    • devSmsInboxPage

      public org.springframework.http.ResponseEntity<String> devSmsInboxPage()
      Renders the recorded messages.
      Specified by:
      devSmsInboxPage in interface DevSmsInboxPageApi
      Returns:
      the page, never cached because the messages carry codes.