"""Environment variables and constants for solveit_wxbot."""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_config.ipynb.

# %% auto #0
__all__ = ['CORP_ID', 'SECRET', 'AGENT_ID', 'TOKEN', 'AES_KEY', 'CHUNK_SIZE', 'DEDUP_WINDOW', 'TOKEN_BUFFER']

# %% ../nbs/00_config.ipynb #662a8c5c
import base64, os

# WeCom credentials
CORP_ID  = os.environ['WECOM_CORP_ID']    # Enterprise ID
SECRET   = os.environ['WECOM_SECRET']     # App secret
AGENT_ID = os.environ['WECOM_AGENT_ID']  # App agent ID
TOKEN    = os.environ['WECOM_TOKEN']      # Webhook token

# AES key requires padding to valid base64 length before decoding
AES_KEY = base64.b64decode(os.environ['WECOM_AES_KEY'] + '=')

# Tuneable constants
CHUNK_SIZE   = 680  # Max chars per WeCom message segment
DEDUP_WINDOW = 60   # Seconds to remember seen MsgIds
TOKEN_BUFFER = 300  # Seconds before expiry to refresh access token
