Class CspNonce

Object
org.apache.spark.ui.CspNonce

public class CspNonce extends Object
Thread-local storage for CSP nonce values.

A nonce is generated per request in HttpSecurityFilter and used by UI pages to mark inline scripts and styles as trusted.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Remove the nonce after the request is complete.
    static String
    Generate a new nonce and store it in the current thread.
    static String
    get()
    Get the nonce for the current request.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CspNonce

      public CspNonce()
  • Method Details

    • generate

      public static String generate()
      Generate a new nonce and store it in the current thread.
    • get

      public static String get()
      Get the nonce for the current request.
    • clear

      public static void clear()
      Remove the nonce after the request is complete.