HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/panel/command/oauth_secret.py
from bokeh.command.subcommand import Subcommand


class OAuthSecret(Subcommand):
    ''' Subcommand to generate a new encryption key.

    '''

    #: name for this subcommand
    name = "oauth-secret"

    help = "Create a Panel encryption key for use with Panel server"

    args = (
    )

    def invoke(self, args):
        from cryptography.fernet import Fernet
        key = Fernet.generate_key()
        print(key.decode('utf-8'))  # noqa: T201