Interface CredentialType

    • Method Detail

      • populateContextForCreate

        void populateContextForCreate​(@NotNull
                                      @NotNull Map<String,​Object> context)
        Provide any required context to be used when rendering the freemarker template for creating credentials. Allows you to add any default values for initial creation
        Parameters:
        context - map to put your context in.
      • populateContextForEdit

        void populateContextForEdit​(@NotNull
                                    @NotNull Map<String,​Object> context,
                                    @NotNull
                                    @NotNull CredentialsData previousCredentialsData)
        Provide any required context to be used when rendering the freemarker template for editing credentials.
        Parameters:
        context - map to put your context in.
        previousCredentialsData - existing credentials
      • validate

        void validate​(@NotNull
                      @NotNull ActionParametersMap params,
                      @Nullable
                      @Nullable CredentialsData previousCredentialsData,
                      @NotNull
                      @NotNull ErrorCollection errorCollection)
        Validate configuration.
        Parameters:
        params - configuration to be validated
        previousCredentialsData - the previous immutable CredentialsData before saving or null if credentials are being created.
        errorCollection - error collection to be set on validation failure
      • generateCredentialsConfigMap

        @NotNull
        @NotNull Map<String,​String> generateCredentialsConfigMap​(@NotNull
                                                                       @NotNull ActionParametersMap params,
                                                                       @Nullable
                                                                       @Nullable CredentialsData previousCredentialsData)
        Convert the params from the ui into a config map to be stored in the database. Can assume validation has occurred in the #validate method.

        Sensitive parameters such as passwords do not have to be encrypted, as they will be secured before being stored in the database.

        Parameters:
        params - request parameters.
        previousCredentialsData - the previous immutable CredentialsData before saving or null if credentials are being created.
        Returns:
        the configuration map to be stored in the database.
      • generateCredentialsConfigMap

        @NotNull
        @NotNull Map<String,​String> generateCredentialsConfigMap​(@NotNull
                                                                       @NotNull Map<String,​String> params)
                                                                throws WebValidationException
        Convert the given map into a config map of the shared credential to be stored in the database.

        Sensitive parameters such as passwords do not have to be encrypted, as they will be secured before being stored in the database.

        Parameters:
        params - original map to be converted
        Returns:
        the configuration map to be stored in the database.
        Throws:
        WebValidationException - if params contains invalid configuration
      • getCredentialsConfigurationMap

        @NotNull
        @NotNull Map<String,​String> getCredentialsConfigurationMap​(@NotNull
                                                                         @NotNull CredentialsData credentialsData)
        Convert an existing CredentialsData to a map. So that configuration of the credential can used by other component, e.g. the rest plugin. Each implementation of CredentialType should populate different data to the map and encrypt them if necessary.
        Parameters:
        credentialsData - an existing credential
        Returns:
        Map that stores the credential's configuration