Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DyfanJones committed Jun 27, 2023
1 parent 5d20c9b commit 4ae3d8f
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions paws/R/sts_service.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NULL
#'
#' @description
#' Security Token Service
#'
#'
#' Security Token Service (STS) enables you to request temporary,
#' limited-privilege credentials for users. This guide provides
#' descriptions of the STS API. For more information about using this
Expand Down Expand Up @@ -54,7 +54,7 @@ NULL
#' @examples
#' \dontrun{
#' svc <- sts()
#' #
#' #
#' svc$assume_role(
#' ExternalId = "123ABC",
#' Policy = "\{\"Version\":\"2012-10-17\",\"Statement\":[\{\"Sid\":\"Stmt1\",\"Effect\":\"A...",
Expand Down Expand Up @@ -102,7 +102,6 @@ NULL
#' @rdname sts
#' @export
sts <- function(config = list()) {
.sts$metadata$endpoints <- .get_sts_endpoints(config$profile)
svc <- .sts$operations
svc <- set_config(svc, config)
return(svc)
Expand All @@ -115,7 +114,7 @@ sts <- function(config = list()) {

.sts$metadata <- list(
service_name = "sts",
endpoints = list(), # Will be set later when sts client is established
endpoints = list("*" = list(endpoint = "https://sts.amazonaws.com", global = TRUE), "us-gov-*" = list(endpoint = "sts.{region}.amazonaws.com", global = FALSE), "cn-*" = list(endpoint = "sts.{region}.amazonaws.com.cn", global = FALSE), "us-iso-*" = list(endpoint = "sts.{region}.c2s.ic.gov", global = FALSE), "us-isob-*" = list(endpoint = "sts.{region}.sc2s.sgov.gov", global = FALSE)),
service_id = "STS",
api_version = "2011-06-15",
signing_name = "sts",
Expand All @@ -127,24 +126,3 @@ sts <- function(config = list()) {
handlers <- new_handlers("query", "v4")
new_service(.sts$metadata, handlers, config)
}

.get_sts_endpoints <- function(profile = "") {

sts_regional_endpoint <- get_sts_regional_endpoint(profile)

if (sts_regional_endpoint != "") {
default_endpoint <- list(endpoint = "sts.{region}.amazonaws.com", global = FALSE)
} else {
default_endpoint <- list(endpoint = "sts.amazonaws.com", global = TRUE)
}

endpoints <- list(
"*" = default_endpoint,
"us-gov-*" = list(endpoint = "sts.{region}.amazonaws.com", global = FALSE),
"cn-*" = list(endpoint = "sts.{region}.amazonaws.com.cn", global = FALSE),
"us-iso-*" = list(endpoint = "sts.{region}.c2s.ic.gov", global = FALSE),
"us-isob-*" = list(endpoint = "sts.{region}.sc2s.sgov.gov", global = FALSE)
)

return(endpoints)
}

0 comments on commit 4ae3d8f

Please sign in to comment.