Class JWSFilter

Object
org.apache.spark.ui.JWSFilter
All Implemented Interfaces:
jakarta.servlet.Filter

public class JWSFilter extends Object implements jakarta.servlet.Filter
A servlet filter that requires JWS, a cryptographically signed JSON Web Token, in the header.

Like the other UI filters, the following configurations are required to use this filter.


   - spark.ui.filters=org.apache.spark.ui.JWSFilter
   - spark.org.apache.spark.ui.JWSFilter.param.secretKey=BASE64URL-ENCODED-YOUR-PROVIDED-KEY
 
The HTTP request should have Authorization: Bearer <jws> header.

   - <jws> is a string with three fields, '<header>.<payload>.<signature>'.
   - <header> is supposed to be a base64url-encoded string of '{"alg":"HS256","typ":"JWT"}'.
   - <payload> is a base64url-encoded string of fully-user-defined content.
   - <signature> is a signature based on '<header>.<payload>' and a user-provided key parameter.
 
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain)
     
    void
    init(jakarta.servlet.FilterConfig config)
    Load and validate the configurtions: - IllegalArgumentException will happen if the user didn't provide this argument - WeakKeyException will happen if the user-provided value is insufficient

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jakarta.servlet.Filter

    destroy
  • Constructor Details

    • JWSFilter

      public JWSFilter()
  • Method Details

    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain)
      Specified by:
      doFilter in interface jakarta.servlet.Filter
    • init

      public void init(jakarta.servlet.FilterConfig config)
      Load and validate the configurtions: - IllegalArgumentException will happen if the user didn't provide this argument - WeakKeyException will happen if the user-provided value is insufficient
      Specified by:
      init in interface jakarta.servlet.Filter
      Parameters:
      config - (undocumented)