tests/integration/integration_setup.py
def regcode_user(conn: serverconn.ServerConnection, config: dict, profile_data: dict, 
	regcode: str) -> RetVal:
	'''Finishes setting up the admin account by registering it, logging in, and uploading a 
	root keycard entry'''
	
	status = userprofile.profman.get_active_profile()
	profile = None
	if not status.error():
		profile = status['profile']
	
	status = iscmds.regcode(conn, profile_data['address'], regcode, 
		profile_data['password'].hashstring, profile.devid, profile_data['device'])
	assert not status.error(), f"{funcname()}: regcode failed: {status.info()}"

	waddr = utils.WAddress()
	waddr.id = profile_data['wid']
	waddr.domain = profile_data['domain']
	auth.add_device_session(profile.db, waddr, profile.devid, profile_data['device'])

	status = iscmds.login(conn, profile_data['wid'], CryptoString(config['oekey']))
	assert not status.error(), f"{funcname()}: login phase failed: {status.info()}"

	status = iscmds.password(conn, profile_data['password'].hashstring)
	assert not status.error(), f"{funcname()}: password phase failed: {status.info()}"

	status = iscmds.device(conn, profile.devid, profile_data['device'])
	assert not status.error(), f"{funcname()}: device phase failed: {status.info()}"

	entry = keycard.UserEntry()
	entry.set_fields({
		'Name':profile_data['name'],
		'Workspace-ID':profile_data['wid'].as_string(),
		'User-ID':profile_data['uid'].as_string(),
		'Domain':profile_data['domain'].as_string(),
		'Contact-Request-Verification-Key':profile_data['crsigning'].get_public_key(),
		'Contact-Request-Encryption-Key':profile_data['crencryption'].get_public_key(),
		'Encryption-Key':profile_data['encryption'].get_public_key(),
		'Verification-Key':profile_data['signing'].get_public_key()
	})

	status = iscmds.addentry(conn, entry, CryptoString(config['ovkey']), profile_data['crsigning'])
	assert not status.error(), f"{funcname()}: failed to add entry: {status.info()}"

	status = iscmds.iscurrent(conn, 1, profile_data['wid'])
	assert not status.error(), f"{funcname()}: user iscurrent() success check failed: " \
		f"{status.info()}"

	status = iscmds.iscurrent(conn, 2, profile_data['wid'])
	assert not status.error(), f"{funcname()}: user iscurrent() failure check failed: " \
		f"{status.info()}"
	
	return RetVal()
Finishes setting up the admin account by registering it, logging in, and uploading a 
	root keycard entry
Finishes setting up the admin account by registering it, logging in, and uploading a
root keycard entry
Finishes setting up the admin account by registering it logging in and uploading a root keycard entry
def regcode_user(conn: serverconn.ServerConnection, config: dict, profile_data: dict, 
	regcode: str) -> RetVal:
	status = userprofile.profman.get_active_profile()
	profile = None
	if not status.error():
		profile = status['profile']
	status = iscmds.regcode(conn, profile_data['address'], regcode, 
		profile_data['password'].hashstring, profile.devid, profile_data['device'])
	assert not status.error(), f"{funcname()}: regcode failed: {status.info()}"
	waddr = utils.WAddress()
	waddr.id = profile_data['wid']
	waddr.domain = profile_data['domain']
	auth.add_device_session(profile.db, waddr, profile.devid, profile_data['device'])
	status = iscmds.login(conn, profile_data['wid'], CryptoString(config['oekey']))
	assert not status.error(), f"{funcname()}: login phase failed: {status.info()}"
	status = iscmds.password(conn, profile_data['password'].hashstring)
	assert not status.error(), f"{funcname()}: password phase failed: {status.info()}"
	status = iscmds.device(conn, profile.devid, profile_data['device'])
	assert not status.error(), f"{funcname()}: device phase failed: {status.info()}"
	entry = keycard.UserEntry()
	entry.set_fields({
		'Name':profile_data['name'],
		'Workspace-ID':profile_data['wid'].as_string(),
		'User-ID':profile_data['uid'].as_string(),
		'Domain':profile_data['domain'].as_string(),
		'Contact-Request-Verification-Key':profile_data['crsigning'].get_public_key(),
		'Contact-Request-Encryption-Key':profile_data['crencryption'].get_public_key(),
		'Encryption-Key':profile_data['encryption'].get_public_key(),
		'Verification-Key':profile_data['signing'].get_public_key()
	})
	status = iscmds.addentry(conn, entry, CryptoString(config['ovkey']), profile_data['crsigning'])
	assert not status.error(), f"{funcname()}: failed to add entry: {status.info()}"
	status = iscmds.iscurrent(conn, 1, profile_data['wid'])
	assert not status.error(), f"{funcname()}: user iscurrent() success check failed: " \
		f"{status.info()}"
	status = iscmds.iscurrent(conn, 2, profile_data['wid'])
	assert not status.error(), f"{funcname()}: user iscurrent() failure check failed: " \
		f"{status.info()}"
	return RetVal()
def regcode_user ( conn : serverconn . ServerConnection , config : dict , profile_data : dict , regcode : str ) -> RetVal : status = userprofile . profman . get_active_profile ( ) profile = None if not status . error ( ) : profile = status [ 'profile' ] status = iscmds . regcode ( conn , profile_data [ 'address' ] , regcode , profile_data [ 'password' ] . hashstring , profile . devid , profile_data [ 'device' ] ) assert not status . error ( ) , f"{funcname()}: regcode failed: {status.info()}" waddr = utils . WAddress ( ) waddr . id = profile_data [ 'wid' ] waddr . domain = profile_data [ 'domain' ] auth . add_device_session ( profile . db , waddr , profile . devid , profile_data [ 'device' ] ) status = iscmds . login ( conn , profile_data [ 'wid' ] , CryptoString ( config [ 'oekey' ] ) ) assert not status . error ( ) , f"{funcname()}: login phase failed: {status.info()}" status = iscmds . password ( conn , profile_data [ 'password' ] . hashstring ) assert not status . error ( ) , f"{funcname()}: password phase failed: {status.info()}" status = iscmds . device ( conn , profile . devid , profile_data [ 'device' ] ) assert not status . error ( ) , f"{funcname()}: device phase failed: {status.info()}" entry = keycard . UserEntry ( ) entry . set_fields ( { 'Name' : profile_data [ 'name' ] , 'Workspace-ID' : profile_data [ 'wid' ] . as_string ( ) , 'User-ID' : profile_data [ 'uid' ] . as_string ( ) , 'Domain' : profile_data [ 'domain' ] . as_string ( ) , 'Contact-Request-Verification-Key' : profile_data [ 'crsigning' ] . get_public_key ( ) , 'Contact-Request-Encryption-Key' : profile_data [ 'crencryption' ] . get_public_key ( ) , 'Encryption-Key' : profile_data [ 'encryption' ] . get_public_key ( ) , 'Verification-Key' : profile_data [ 'signing' ] . get_public_key ( ) } ) status = iscmds . addentry ( conn , entry , CryptoString ( config [ 'ovkey' ] ) , profile_data [ 'crsigning' ] ) assert not status . error ( ) , f"{funcname()}: failed to add entry: {status.info()}" status = iscmds . iscurrent ( conn , 1 , profile_data [ 'wid' ] ) assert not status . error ( ) , f"{funcname()}: user iscurrent() success check failed: " f"{status.info()}" status = iscmds . iscurrent ( conn , 2 , profile_data [ 'wid' ] ) assert not status . error ( ) , f"{funcname()}: user iscurrent() failure check failed: " f"{status.info()}" return RetVal ( )
Finishes setting up the admin account by registering it, logging in, and uploading a
root keycard entry
Finishes setting up the admin account by registering it logging in and uploading a root keycard entry
'''Finishes setting up the admin account by registering it, logging in, and uploading a 
	root keycard entry'''
conn
serverconn.ServerConnection
config
dict
profile_data
dict
regcode
str