def test_the_token_fails_to_verify_with_a_bad_secret(self):
        result = DigestTokens() \
            .verify_and_decode('bad-secret', self.token)

        assert result['verified'] is False
        assert result['code'] == 'bad-digest'
        assert 'value' not in result
    def test_the_token_fails_to_verify(self):
        token = 'DIGEST:bad-token'
        result = DigestTokens() \
            .verify_and_decode('bad-secret', token)

        assert result['verified'] is False
        assert result['code'] == 'bad-token'
        assert 'message' not in result
        assert 'value' not in result
Пример #3
0
    def test_the_token_successfully_verifies_with_the_correct_secret(self):
        result = DigestTokens() \
            .verify_and_decode('my-secret', self.token)

        assert result['verified'] is True
        assert result['code'] == 'verified'
        assert 'value' in result

        value = result['value']

        assert value['uri'] == 'https://my-custom-backend.example.org'
Пример #4
0
    def test_the_token_successfully_verifies_with_the_correct_secret(self):
        result = DigestTokens() \
            .verify_and_decode('my-secret', self.token)

        assert result['verified'] is True
        assert result['code'] == 'verified'
        assert 'value' in result

        value = result['value']

        assert value['requiredTag'] == 'roomAlias:my-room'
    def test_the_token_successfully_verifies_with_the_correct_secret(self):
        result = DigestTokens() \
            .verify_and_decode('my-secret', self.token)

        assert result['verified'] is True
        assert result['code'] == 'verified'
        assert 'value' in result

        value = result['value']

        assert value['type'] == 'publish'
        assert value['requiredTag'] == 'channelId:us-northeast#my-application-id#my-channel.134566'
    def test_the_token_successfully_verifies_with_the_correct_secret(self):
        result = DigestTokens() \
            .verify_and_decode('my-secret', self.token)

        assert result['verified'] is True
        assert result['code'] == 'verified'
        assert 'value' in result

        value = result['value']

        assert value['type'] == 'publish'

        assert len(value['capabilities']) == 2
        assert 'multi-bitrate' in value['capabilities']
        assert 'streaming' in value['capabilities']