Skip to content

Commit

Permalink
Merge pull request #42 from SanjayShetty01/migrate-paws.security.iden…
Browse files Browse the repository at this point in the history
…tity

migrating to paws.security.identity
  • Loading branch information
SanjayShetty01 authored Nov 14, 2024
2 parents 3d11d24 + b70374f commit 06bf708
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 519 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: RCognito
Type: Package
Title: A Simplified Interface for 'Amazon Cognito'
Version: 0.1.0
Version: 0.2.0
Authors@R: person(given = c("Sanjaya", "J"),
family = "Shetty",
role = c("aut", "cre"),
Expand All @@ -12,7 +12,7 @@ License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.2
Imports: paws
Imports: paws.security.identity
Suggests:
testthat (>= 3.0.0),
mockery
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export(confirm_sign_up_user)
export(forgot_password)
export(sign_in)
export(sign_up_user)
import(paws)
import(paws.security.identity)
4 changes: 2 additions & 2 deletions R/change_password.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Change User Password
#'
#'@import paws
#'@import paws.security.identity
#'
#' @param old_password A character string representing the user's current password.
#' @param new_password A character string representing the user's new password.
Expand All @@ -12,7 +12,7 @@
change_password <- function(old_password, new_password, token) {

tryCatch({
cognito <- paws::cognitoidentityprovider()
cognito <- paws.security.identity::cognitoidentityprovider()

cognito$change_password(PreviousPassword = old_password,
ProposedPassword = new_password,
Expand Down
4 changes: 2 additions & 2 deletions R/confirm_forgot_password.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' This function confirms the forgot password process by setting a new password for a user.
#'
#'@import paws
#'@import paws.security.identity
#'
#' @param client_id A character string representing the app client ID.
#' @param username A character string for the user's username.
Expand All @@ -15,7 +15,7 @@
confirm_forgot_password <- function(client_id, username, confirmation_code, new_password) {
tryCatch({

cognito <- paws::cognitoidentityprovider()
cognito <- paws.security.identity::cognitoidentityprovider()

cognito$confirm_forgot_password(
ClientId = client_id,
Expand Down
4 changes: 2 additions & 2 deletions R/confirm_sign_up.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' This function confirms the sign-up process for a user in AWS Cognito.
#'
#' @import paws
#' @import paws.security.identity
#'
#' @param client_id A character string representing the app client ID.
#' @param userpool A character string representing the user pool ID.
Expand All @@ -17,7 +17,7 @@ confirm_sign_up_user <- function(client_id,
username,
verification_code) {
tryCatch({
cognito <- paws::cognitoidentityprovider()
cognito <- paws.security.identity::cognitoidentityprovider()

users_info_from_cognito <- get_user_list_from_cognito(cognito_client =
cognito, userpool =
Expand Down
4 changes: 2 additions & 2 deletions R/forgot_password.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Initiate Forgot Password Request
#'
#'@import paws
#'@import paws.security.identity
#'
#' @param client_id A character string representing the app client ID.
#' @param username A character string for the user's username.
Expand All @@ -10,7 +10,7 @@
forgot_password <- function(client_id, username) {
tryCatch({

cognito <- paws::cognitoidentityprovider()
cognito <- paws.security.identity::cognitoidentityprovider()

cognito$forgot_password(ClientId = client_id, Username = username)

Expand Down
4 changes: 2 additions & 2 deletions R/sign_in.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Sign in to AWS Cognito
#'
#'@import paws
#'@import paws.security.identity
#'
#' @param client_id A character string representing the app client ID.
#' @param username A character string for the user's username.
Expand All @@ -14,7 +14,7 @@ sign_in <- function(client_id, username, password,
authflow = "USER_PASSWORD_AUTH") {
tryCatch({

cognito <- paws::cognitoidentityprovider()
cognito <- paws.security.identity::cognitoidentityprovider()

auth_parameter <- list(USERNAME = username, PASSWORD = password)

Expand Down
4 changes: 2 additions & 2 deletions R/sign_up.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Sign up a new user to AWS Cognito
#'
#'@import paws
#'@import paws.security.identity
#'
#' @param client_id A character string representing the app client ID.
#' @param email A character string for the user's email address.
Expand All @@ -20,7 +20,7 @@ sign_up_user <- function(client_id, email, username, password, ...) {

tryCatch({

cognito <- paws::cognitoidentityprovider()
cognito <- paws.security.identity::cognitoidentityprovider()

sign_up_result <- cognito$sign_up(
ClientId = client_id,
Expand Down
Loading

0 comments on commit 06bf708

Please sign in to comment.