Skip to contents

Functions to manage Meetup API authentication in Continuous Integration (CI) environments. meetup_setup_ci() prepares authentication credentials for CI use by encoding tokens, while meetup_load_ci() loads and decodes those credentials in the CI environment.

Usage

meetup_ci_setup(client_name = Sys.getenv("MEETUP_CLIENT_NAME", "meetupr"))

meetup_ci_load(client_name = Sys.getenv("MEETUP_CLIENT_NAME", "meetupr"))

Arguments

client_name

A string representing the name of the client. By default, it is set to "meetupr" and retrieved from the MEETUP_CLIENT_NAME environment variable.

Value

  • meetup_setup_ci(): Returns the encoded base64 authentication token invisibly.

  • meetup_load_ci(): Returns TRUE invisibly if the token was successfully loaded.

Details

Setting up CI Authentication

meetup_setup_ci() performs the following steps:

  • Checks if the user has authenticated with the Meetup API

  • Reads the existing token file from the OAuth cache directory

  • Encodes the token file contents into a base64 string

  • Stores credentials in the keyring with service name "meetupr"

  • Provides guidance for setting environment variables in CI

  • Copies the encoded token to the clipboard (if available)

Loading CI Authentication

meetup_load_ci() requires the following to be stored in the keyring (typically populated from environment variables in CI):

  • token: The base64-encoded token string (service: "meetupr", username: "token")

  • token_file: The name of the token file (service: "meetupr", username: "token_file")

The decoded token is saved in the OAuth cache directory at: {oauth_cache_path}/{client_name}/{token_file}

Environment Variables for CI

When using the environment backend (automatically selected when keyring support is unavailable, such as on CRAN or headless CI systems), credentials are stored as:

  • meetupr:token - The base64-encoded token

  • meetupr:token_file - The token filename

Functions

  • meetup_ci_setup(): Setup authentication for CI environments

  • meetup_ci_load(): Load authentication from CI environment

Examples

if (FALSE) { # \dontrun{
# Setup CI authentication (run locally):
meetup_setup_ci()

# In your CI pipeline, load the credentials:
meetup_load_ci()

# Custom client name:
meetup_setup_ci(client_name = "my_custom_client")
meetup_load_ci(client_name = "my_custom_client")
} # }