Beispiel #1
0
    def test_auth_req_callback_stores_state_for_consent(self, context, satosa_config):
        base = SATOSABase(satosa_config)

        context.target_backend = satosa_config["BACKEND_MODULES"][0]["name"]
        requester_name = [{"lang": "en", "text": "Test EN"}, {"lang": "sv", "text": "Test SV"}]
        internal_req = InternalRequest(UserIdHashType.transient, None, requester_name)
        internal_req.approved_attributes = ["attr1", "attr2"]
        base._auth_req_callback_func(context, internal_req)

        assert context.state[consent.STATE_KEY]["requester_name"] == internal_req.requester_name
        assert context.state[consent.STATE_KEY]["filter"] == internal_req.approved_attributes
Beispiel #2
0
    def test_auth_req_callback_stores_state_for_consent(self, context, satosa_config):
        base = SATOSABase(satosa_config)

        context.target_backend = satosa_config["BACKEND_MODULES"][0]["name"]
        requester_name = [{"lang": "en", "text": "Test EN"}, {"lang": "sv", "text": "Test SV"}]
        internal_req = InternalData(
            subject_type=NAMEID_FORMAT_TRANSIENT, requester_name=requester_name,
        )
        internal_req.attributes = ["attr1", "attr2"]
        base._auth_req_callback_func(context, internal_req)

        assert context.state[consent.STATE_KEY]["requester_name"] == internal_req.requester_name
        assert context.state[consent.STATE_KEY]["filter"] == internal_req.attributes
Beispiel #3
0
    def test_auth_req_callback_stores_state_for_consent(
            self, context, satosa_config):
        base = SATOSABase(satosa_config)

        context.target_backend = satosa_config["BACKEND_MODULES"][0]["name"]
        requester_name = [{
            "lang": "en",
            "text": "Test EN"
        }, {
            "lang": "sv",
            "text": "Test SV"
        }]
        internal_req = InternalRequest(UserIdHashType.transient, None,
                                       requester_name)
        internal_req.approved_attributes = ["attr1", "attr2"]
        base._auth_req_callback_func(context, internal_req)

        assert context.state[
            consent.STATE_KEY]["requester_name"] == internal_req.requester_name
        assert context.state[
            consent.STATE_KEY]["filter"] == internal_req.approved_attributes