-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #116 , global metadata, remove deprecated operation functions, re…
…move auth_email, depend remotes not devtools
- Loading branch information
1 parent
b35d02b
commit 320f9b4
Showing
16 changed files
with
104 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#' Make serviceAccounts objects | ||
#' @noRd | ||
gce_make_serviceaccounts <- function(){ | ||
|
||
if(Sys.getenv(source) == ""){ | ||
stop("No email found in the authentication file at Sys.getenv('GCE_AUTH_FILE')", call.=FALSE) | ||
} | ||
|
||
email <- jsonlite::unbox(jsonlite::fromJSON(Sys.getenv("GCE_AUTH_FILE"))$client_email) | ||
|
||
if(is.null(email)){ | ||
stop("Couldn't find client_email in GCE_AUTH_FILE environment file", call.=FALSE) | ||
} | ||
|
||
list( | ||
list( | ||
email = email, | ||
scopes = list("https://www.googleapis.com/auth/cloud-platform") | ||
) | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,26 +48,6 @@ indent <- function(str, indent = 0) { | |
) | ||
} | ||
|
||
#' Get auth email | ||
#' If it includes '@' then assume the email, otherwise an environment file | ||
#' @param source where the email comes from | ||
#' @keywords internal | ||
auth_email <- function(source){ | ||
|
||
if(Sys.getenv(source) == ""){ | ||
stop("No email found in the authentication file at Sys.getenv(", source, "). \nSet argument auth_email to the environment file containing your service account authentication JSON file e.g. 'GCE_AUTH_FILE', or supply the authentication email directly. e.g. '[email protected]'") | ||
} | ||
|
||
if(!grepl("@", source)){ | ||
out <- jsonlite::fromJSON(Sys.getenv(source))$client_email | ||
} else { | ||
out <- source | ||
} | ||
|
||
out | ||
|
||
} | ||
|
||
#' Timestamp to R date | ||
#' @keywords internal | ||
timestamp_to_r <- function(t){ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.