예제 #1
0
def test_setup_ms():
    liss = list(FO.values())
    liss.extend(list(OA.values()))

    # keydefs, tool_iss, liss, ms_path
    res = test_utils.setup(KEYDEFS, 'iss', liss, 'ms', csms_def=SMS_DEF,
                           mds_dir='mds', base_url='http://example.org')

    assert res
예제 #2
0
def test_setup_ms():
    liss = list(FO.values())
    liss.extend(list(OA.values()))
    for path in ['ms_dir', 'mds']:
        if os.path.isdir(path):
            shutil.rmtree(path)

    # keydefs, tool_iss, liss, ms_path
    res = test_utils.setup(KEYDEFS,
                           'iss',
                           liss,
                           'ms_dir',
                           csms_def=SMS_DEF,
                           mds_dir='mds',
                           base_url='http://example.org')

    assert res
예제 #3
0
}]

MS_DIR = 'ms_dir_10'
fs = FileSystem(MS_DIR)
fs.reset()

if os.path.isdir('mds'):
    shutil.rmtree('mds')

liss = list(FO.values())
liss.extend(list(OA.values()))

signer, keybundle = test_utils.setup(KEY_DEFS,
                                     TOOL_ISS,
                                     liss,
                                     ms_path=MS_DIR,
                                     csms_def=SMS_DEF,
                                     mds_dir='mds',
                                     base_url='https://localhost')

sunet_op = 'https://www.sunet.se/op'

_kj = build_keyjar(KEY_DEFS)[1]
fed_ent = FederationEntity(None,
                           keyjar=_kj,
                           iss=sunet_op,
                           signer=signer[OA['catalogix']])


# ------------------------------------------------------------
class DummyAuthn(UserAuthnMethod):
예제 #4
0
}]

TOOL_ISS = 'https://localhost'

# Clear out old stuff
for d in ['mds', 'ms']:
    if os.path.isdir(d):
        shutil.rmtree(d)

liss = list(fo_conf.FO.values())
liss.extend(list(fo_conf.OA.values()))

signers, keybundle = test_utils.setup(KEYDEFS,
                                      TOOL_ISS,
                                      liss,
                                      ms_path=fo_conf.MS_PATH,
                                      csms_def=fo_conf.SMS_DEF,
                                      mds_dir=fo_conf.MDS_DIR,
                                      base_url=fo_conf.BASE_URL)

exp = 'jwks_bundle'
if not os.path.isdir(exp):
    os.mkdir(exp)
os.chdir(exp)
for iss, kj in keybundle.items():
    fn = quote_plus(iss)
    fp = open(fn, 'w')
    fp.write(json.dumps(kj.export_jwks(issuer=iss)))
    fp.close()
os.rmdir('fo_jwks')
os.chdir('..')
예제 #5
0
#!/usr/bin/env python3
import importlib
import sys
from fedoidc import test_utils

sys.path.insert(0, ".")
config = importlib.import_module(sys.argv[1])

_liss = []
_liss.extend(list(config.FO.values()))
_liss.extend(list(config.OA.values()))
_liss.extend(list(config.IA.values()))
_liss.extend(list(config.EO.values()))

signer, keybundle = test_utils.setup(config.KEY_DEFS,
                                     config.TOOL_ISS,
                                     _liss,
                                     'ms_path',
                                     config.SMS_DEF,
                                     'ms_dir',
                                     base_url=sys.argv[2])
예제 #6
0
        }
    }
}

# Clear out old stuff
for d in ['mds', 'ms']:
    if os.path.isdir(d):
        shutil.rmtree(d)

liss = list(FO.values())
liss.extend(list(OA.values()))
liss.extend(list(EO.values()))

signer, keybundle = test_utils.setup(KEYDEFS,
                                     TOOL_ISS,
                                     liss,
                                     ms_path='ms',
                                     csms_def=SMS_DEF,
                                     mds_dir='mds')

fo_keybundle = JWKSBundle('https://example.com')
for iss in FO.values():
    fo_keybundle[iss] = keybundle[iss]


def test_parse_pi():
    # Sunet OP
    sunet_op = 'https://sunet.se/op'

    # _kj = build_keyjar(KEYDEFS)[1]
    _kj = signer[EO['sunet.op']].signing_service.signing_keys
    op_fed_ent = FederationEntity(None,