Class OAuthRedirectSettingsStorage


  • public class OAuthRedirectSettingsStorage
    extends Object
    • Method Detail

      • getOrCreateRedirectIdForConnection

        @NotNull
        public String getOrCreateRedirectIdForConnection​(@NotNull
                                                         SProject project,
                                                         @NotNull
                                                         String connectionId)
        Returns the stored redirect ID for the given OAuth connection. If no redirect ID has been stored yet, a new one will be generated and persisted.
        Parameters:
        project - the project that contains the connection
        connectionId - the ID of the OAuth connection
        Returns:
        the redirect ID
        Since:
        2024.07
      • setRedirectIdForConnection

        public void setRedirectIdForConnection​(@NotNull
                                               SProject project,
                                               @NotNull
                                               String connectionId,
                                               @NotNull
                                               String redirectId)
        Sets the redirect ID for the given OAuth connection. The redirect ID will be stored in the custom data storage of the connection's project. Any previously or concurrently persisted redirect ID will be overwritten.
        Parameters:
        project - the project that contains the connection
        connectionId - the ID of the OAuth connection
        redirectId - The redirect ID to set
        Since:
        2024.07
      • removeRedirectIdForConnection

        public void removeRedirectIdForConnection​(@NotNull
                                                  SProject project,
                                                  @NotNull
                                                  String connectionId)
        Removes the stored redirect ID for a specific connection in the project.
        Parameters:
        project - the project that contains the connection
        connectionId - the ID of the connection to remove the redirect ID for
        Since:
        2024.07
      • copyConnectionSettings

        public void copyConnectionSettings​(@NotNull
                                           SProject sourceProject,
                                           @NotNull
                                           SProject targetProject,
                                           @NotNull
                                           Map<String,​String> connectionIdMapping)
        Copies all redirect settings of the source project to the target project. Any settings the target project might have had will be overwritten. This could have security implications, e.g., when duplicating redirect IDs.
        Parameters:
        sourceProject - the project to copy the settings from
        targetProject - the project to copy the settings to
        connectionIdMapping - a mapping of source connection ID to target connection ID
        Since:
        2024.07