EndorsementsValidator class

Contiene metodi helper per verificare l'autenticità del token JWT.

Metodi

validate(string, string[])

Verificare che il set di ChannelId, provenienti dalle attività in ingresso, corrispondano tutte alle approvazioni trovate nel token JWT. Ad esempio, se un'attività proviene da webchat, tale channelId indica "webchat" e l'autenticità del token jwt DEVE corrispondere a questo.

Dettagli metodo

validate(string, string[])

Verificare che il set di ChannelId, provenienti dalle attività in ingresso, corrispondano tutte alle approvazioni trovate nel token JWT. Ad esempio, se un'attività proviene da webchat, tale channelId indica "webchat" e l'autenticità del token jwt DEVE corrispondere a questo.

static function validate(channelId: string, endorsements: string[]): boolean

Parametri

channelId

string

Nome del canale, in genere estratto dall'attività. Campo ChannelId, a cui viene affinizzata l'attività.

endorsements

string[]

Chiunque abbia firmato il token JWT è autorizzato a inviare attività solo per alcuni canali specifici. L'elenco è l'elenco di verifica dell'autenticità e viene convalidato in base al channelId.

Restituisce

boolean

True è il channelId presente nel set di verifica dell'autenticità. False se il channelId non viene trovato.