usa_get_passwords: Find username and passwords for databases

View source: R/utils-usa-get-passwords.R

usa_get_passwordsR Documentation

Find username and passwords for databases

Description

Find the username and passwords specific given the username of the computer and stored or entered passwords for accessing databases that store confidential information about landings of Pacific Hake.

Usage

usa_get_passwords(password_file)

Arguments

password_file

A file path specifying where to find the passwords. The path can be full or relative to your current working directory. The text file must contain two lines, where the first line is the NORPAC password and the second line is the PacFIN password. These passwords should not be surrounded with quotes. If a file name is not provided, which is the default behavior, then the user will be prompted for their passwords. This also happens if the file cannot be found given the path provided. These passwords are needed because the databases store confidential information.

Value

A list with two entries, usernames and passwords. Each entry contain a named vector with one element for each database that is used, i.e., NORPAC and PacFIN. The list is invisibly returned to ensure that the passwords are not printed to the screen. Thus, the function call should be assigned to an object.

Author(s)

Kelli F. Johnson

Examples

## Not run: 
# Prompted for passwords for each database
test <- usa_get_passwords()
# Prompted for passwords for each database because password_file is not found
test <- usa_get_passwords(password_file = "doesnotwork.txt")
# On Kelli Johnson's machine, the following will work
test <- usa_get_passwords(password_file = "password.txt")

## End(Not run)

pacific-hake/hake-assessment documentation built on Jan. 14, 2025, 9:12 p.m.