now_executors.NOWAuthExecutor.executor module#

class now_executors.NOWAuthExecutor.executor.SecurityLevel[source]#

Bases: object

ADMIN = 1#
USER = 2#
now_executors.NOWAuthExecutor.executor.secure_request(level, on=None)[source]#
class now_executors.NOWAuthExecutor.executor.NOWAuthExecutor(admin_emails=[], user_emails=[], api_keys=[], *args, **kwargs)[source]#

Bases: jina.serve.executors.BaseExecutor

NOWAuthExecutor performs the token check for authorization. It stores the owner ID belonging to the authorised user and also the user_id of the allowed users with access to the flow deployed by the user.

If no admin_emals, user_emails and api_keys are provided, no checks will be performed.

  • admin_email – ID of the user deploying this flow. ID is obtained from Hubble

  • user_emails (List[str]) – Comma separated Email IDs of the allowed users with access to this flow. The Email ID from the incoming request to this flow will be verified against this.

  • pats – List of PATs of the allowed users with access to this flow.

requests = {'/admin/updateApiKeys': <function secure_request.<locals>.decorator.<locals>.wrapper>, '/admin/updateUserEmails': <function secure_request.<locals>.decorator.<locals>.wrapper>, '/default': <function secure_request.<locals>.decorator.<locals>.wrapper>}#