Skip to content

[JOSS] Plaintext credential cache #60

Description

@schochastics
bs_cache_auth <- function(user, pass, host = get_bluesky_pds()) {
  fs::dir_create(fs::path_dir(bs_auth_file()))
  if (fs::file_exists(bs_auth_file())) {
    # if (bs_has_user()) {
    #   auth <- httr2::secret_read_rds(bs_auth_file(), key = 'BLUESKY_APP_USER')
    # } else {
    auth <- readRDS(bs_auth_file())
    # }
    if (bs_auth_is_valid(auth)) {
      return(auth)
    }
  }

  auth <- bs_create_auth(user, pass, host)
  # if (bs_has_user()) {
  #   httr2::secret_write_rds(auth, path = bs_auth_file(), key = 'BLUESKY_APP_USER')
  # } else {
  saveRDS(auth, bs_auth_file())
  # }
  auth
}

looks like encryption was considered but is not in use anymore. Writing plaintext auth to a file is not a good idea

Metadata

Metadata

Assignees

No one assigned

    Labels

    JOSShandled-i-thinkIssues/features that I think are handled

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions