def get_authentication_wrapper(role, service_type, unique_service_id): if service_type != LinkedServiceController.SERVICE_AMAZON: raise NotImplementedError( "the service type %s is not yet supported by this method" % service_type) return LinkedServiceController.LinkedServiceByTypeAndID( service_type, unique_service_id, AuthenticationServiceBase.RoleWrapperByEntityType(service_type))
def select_role_by_authentication_service(service_type, unique_service_id): service_wrapper = LinkedServiceController.LinkedServiceByTypeAndID( service_type, unique_service_id, AuthenticationServiceBase.RoleWrapperByEntityType(service_type)) if not service_wrapper: return None return RoleController.GetRoleForEntityTypeAndID( service_wrapper.linked_service.role_type, service_wrapper.linked_service.role_id, RoleBase.RoleWrapperByEntityType( service_wrapper.linked_service.role_type))