Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

The basic issues is that the development and delivery of code is currently required to add a new provider into Knox.
This results in a barrier to entry for integrating new providers with Knox.
In particular the integration of an existing servlet filter into Knox should not require code development.
The design below is intended to introduce a very simple configuration based mechanism to accomplish this.
Naturally this will only cover very simple use-cases.
More advanced requirements will still require the development of a ProviderDeploymentContributor.

 

Code Block
xml
xml
titleTopology
linenumberstrue

<topology>
  <gateway>
    <provider>
      <role>authentication</role>
      <name>generic</name>
      <enabled>true</enabled>
      <param>
        <name>filterClassName</name>
        <value>org.opensource.filters.ExistingFilter</value>
      </param>
    </provider>
    ...
  </gateway>
  ...
</topology>
Code Block
java
java
titleDefaultProviderDeploymentContributor
linenumberstrue

public class DefaultProviderDeploymentContributor {

  String getRole() {
    return "*"; // The "*" will require special handling in the framework.

  String getName() {
    return "defaultgeneric";
  }

  void initializeContribution( DeploymentContext context ) {
    // NoOp
  }

  void contributeProvider( DeploymentContext context, Provider provider ) {
    // NoOp
  }

  void contributeFilter(
      DeploymentContext context,
      Provider provider,
      Service service,
      ResourceDescriptor resource,
      List<FilterParamDescriptor> params ) {
    resource.addFilter()
        .name( getName() )
        .role( provider.getRole() )
        .impl( TODO )provider.getParams().get( "filterClassName" ) )
        .params( params );
  }

  void finalizeContribution( DeploymentContext context ) {
    // NoOp
  }
}