Skip to contents

This function is used only in the plumber endpoints, to prevent them being called by unauthorized users. Authorization is determined solely from the secret supplied by the caller, and never from the token hard-coded in the container. The secret is authorized if it either matches the environment variable PKGCHECK_TOKEN, or is a GitHub token belonging to one of the authorized users.

Usage

is_user_authorized(secret = NULL)

Arguments

secret

Environment variable PKGCHECK_TOKEN sent from bot, or a GitHub token of an authorized user.

Value

Logical value indicating whether or not a user is authorized.