-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14361cb
commit 006af5a
Showing
62 changed files
with
1,418 additions
and
533 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
YEAR: 2015 | ||
COPYRIGHT HOLDER: Sunholo Ltd. | ||
YEAR: 2017 | ||
COPYRIGHT HOLDER: Sunholo Ltd. |
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 |
---|---|---|
@@ -1,47 +1,61 @@ | ||
8f28e45122fb75714fb07970e01cf7ea *DESCRIPTION | ||
6346ec78b27187fcd99986124133fc2a *LICENSE | ||
7c427fa92df77717f351519a54b71791 *NAMESPACE | ||
3e13cc9ced89f79dfc4e469975fd9659 *NEWS.md | ||
648363052aba9854b423375c99657918 *R/bigQueryR.R | ||
01672f25679abbfa0707f48efd714348 *R/cloudStorage.R | ||
9b3a51b950a50b6ecd6b406a1be1369a *R/dataParseFunctions.R | ||
758e0bc804503f03ad4a72b14418527e *R/downloadData.R | ||
17dd3b9c30dac16d5bd026f3df74b488 *R/jobs.R | ||
2e82d5ec073e9d2b36ae027e193f7cbf *R/listBigQuery.R | ||
440c9973dcb208844c3edb429d0b9802 *R/options.R | ||
f772297399468e70b3e420a1516a1351 *R/query.R | ||
c8a80e9159390e4888025b8a8910b029 *R/tables.R | ||
a72bfa91dafebe6fe204accf2009264c *R/uploadData.R | ||
f20c09c89a63a3f153f162a16cd64c95 *R/utilities.R | ||
03521890ac6dd06a536a5d3d7a8af502 *README.md | ||
b6bf9fa119de5ecadc2965be4246d273 *build/vignette.rds | ||
f71310f8d070e87efc1fa772ca5ffe07 *DESCRIPTION | ||
1918b8807c8b12031663a9efe23458e0 *LICENSE | ||
bc6b17f202ec4268089cc692723e20ca *NAMESPACE | ||
1da1f905feb2803ffe111ca9d961a4b2 *NEWS.md | ||
b0c470bbd0c12471ff6d861f1218fc40 *R/auth.R | ||
086eb868dbba4a932d07a6733668b75d *R/bigQueryR.R | ||
455eeee08045823b8139a02fcbe11184 *R/dataParseFunctions.R | ||
9f55dd2698f912ef056568ea7b7de704 *R/downloadData.R | ||
2c421cc2f3b9e1495cc7eaa2ee2e9455 *R/globals.R | ||
68d75a7ae77b9432833e0e1332f1a668 *R/jobs.R | ||
32aa14239281734f839e12e265f23b92 *R/listBigQuery.R | ||
c19901ae9c831f8fd2a0736d3179e55f *R/options.R | ||
26ab87c8358b202f129adbcb56811423 *R/partition.R | ||
4fcedd2524f11131bff92a22277f68e0 *R/print_methods.R | ||
596baca6e9394a11920a4649eebbb6e3 *R/query.R | ||
eef5d355fb0e6bab3f7a4a456baeb9d7 *R/tables.R | ||
755b8b0ce51436d58e6ccb8f6172566b *R/uploadData.R | ||
e1db41010e5046aa90d77fe6cc3acd1c *R/utilities.R | ||
bdecbcecf9ef55523b5d34dcac0cb906 *build/vignette.rds | ||
e8d818d4be126d9c02920eb65f6437f9 *inst/CITATION | ||
59d79154d6247524cbbc88634227446a *inst/doc/bigQueryR.Rmd | ||
0fb2f16a5513073e8a38c12dfae03306 *inst/doc/bigQueryR.html | ||
0ab1a7ba9227ed7bdd95302ad44b2645 *man/bigQueryR.Rd | ||
21dc463667cc1fcdf1031f8d75f666d2 *man/bqr_auth.Rd | ||
57e2b5ffc089a2058165301bb7a1514e *man/bqr_create_table.Rd | ||
e56931b4b933cbb94f91186d9bfba040 *man/bqr_delete_table.Rd | ||
2d48482a2881a48471a797f925a1b2cf *man/bqr_download_extract.Rd | ||
f3a333525b6c382a76ff09b637c0271d *man/bqr_extract_data.Rd | ||
1d6daf45023594342594cecb9d6ce8c9 *man/bqr_get_job.Rd | ||
164c6b52867cb9c94ddca698c46b90a9 *man/bqr_grant_extract_access.Rd | ||
eb00021cde39fd03185b5325e3db586e *man/bqr_list_datasets.Rd | ||
3242264356742e6692fd2381b94fe97f *man/bqr_list_jobs.Rd | ||
384fc76e5ea61dea13447d889433f663 *man/bqr_list_projects.Rd | ||
1a1da54c1496a3dd366a896fec099a5b *man/bqr_list_tables.Rd | ||
8af9a2131e608514747ddd274f42aa03 *man/bqr_query.Rd | ||
a6cb20f7277f2cba72f7f168559399c6 *man/bqr_query_asynch.Rd | ||
10c0c1853541fe29b740003e4b007400 *man/bqr_table_data.Rd | ||
75e152274b3fb966adcb1b34517787c9 *man/bqr_table_meta.Rd | ||
48d94d31a9d1721c054e97c29c2c17ff *man/bqr_upload_data.Rd | ||
3883396c01758b50b76afed5f31fbf9c *man/bqr_wait_for_job.Rd | ||
a2f3694cd0d6e26e4d2cb131c35ad424 *man/error.message.Rd | ||
0d884342e1dce6a8d9dde386ccefa52f *man/gcs_update_acl.Rd | ||
691565ef7e3c837f1f51d4d6b1b7680a *man/idempotency.Rd | ||
2240e92cd7767970a3f56d45070895a9 *man/is.NullOb.Rd | ||
57e5ee063d87b8133cb4785429c9685a *man/is.error.Rd | ||
172de60e13e30d803506104947d1f6b7 *man/myMessage.Rd | ||
5eeba1d521d9a6dda8a61512f6891b9a *man/parse_bqr_query.Rd | ||
fc01bed2025f8af7aff31ab1c21bfef7 *man/rmNullObs.Rd | ||
ab0078545cd347c3bb7574bf0400c768 *inst/doc/bigQueryR.html | ||
f79d7c7ac5251dc6a23a6b017defdb76 *man/bigQueryR.Rd | ||
f2eaee4efd44db76c75a716149aba951 *man/bq_get_global_dataset.Rd | ||
791f0abace3714d39e1e8756a20d263b *man/bq_get_global_project.Rd | ||
7f09fd4c7f5568d6ca0d5698790d6198 *man/bq_global_dataset.Rd | ||
2f56650fb57a829047a39efaec6da112 *man/bq_global_project.Rd | ||
b3f9e03bb6da6feb766bfad852b58cc8 *man/bqr_auth.Rd | ||
5f1404486f0cf5766c533a467df13929 *man/bqr_create_table.Rd | ||
6336dd1c3338a540170f4bc92f4086ed *man/bqr_delete_table.Rd | ||
167a725f3e64f66bac5a373787a891fb *man/bqr_download_extract.Rd | ||
3f9ef0221ea290493a4531cbcd765a2c *man/bqr_extract_data.Rd | ||
185fcec6d220ac634a599c672913c283 *man/bqr_get_job.Rd | ||
16f5371ae462ea0748418e75d269ca6d *man/bqr_grant_extract_access.Rd | ||
bbf59a86db782fe7738e324eadc78e85 *man/bqr_list_datasets.Rd | ||
19820c74cad33004d559b82769578b46 *man/bqr_list_jobs.Rd | ||
064792bb7a89debc8a6d4ccb396b1473 *man/bqr_list_projects.Rd | ||
b8c81fbd5f4028e1141498493eef45c1 *man/bqr_list_tables.Rd | ||
5b46c8237dbb1507ffd0cd8de3f98b4d *man/bqr_partition.Rd | ||
282f8c0b94ca8120c4bb3c6b8b0abc16 *man/bqr_query.Rd | ||
219d4fe9e4e83d3107a24839f039cc59 *man/bqr_query_asynch.Rd | ||
6e0461025cc743c5bdeea70902f86914 *man/bqr_table_data.Rd | ||
1d8dd1834db2e3b1d997da63bb6ef9f9 *man/bqr_table_meta.Rd | ||
fa5d7faf959fcf014cced69a653fa418 *man/bqr_upload_data.Rd | ||
0b5f0797e3de31820545e97f634e41d0 *man/bqr_wait_for_job.Rd | ||
cd4ec4d5e7dbb8040424decf497029be *man/cat0.Rd | ||
4bbba36b86bbc6eed98145c48630cc03 *man/error.message.Rd | ||
8d453641d4c85e98f7f2c3a688fe5f46 *man/format_object_size.Rd | ||
4e022539f6f9e50a18fceb24ea14d15f *man/idempotency.Rd | ||
99e6d2088a016007fc87b8305dae2b56 *man/is.NullOb.Rd | ||
73380d60c7bfa916fd6ddf62b4d0e5a6 *man/is.error.Rd | ||
321a1d33b48d0e3a2fdb7ea034d54630 *man/js_to_posix.Rd | ||
d76f703325b6d887279822dd0f696961 *man/myMessage.Rd | ||
d73a74c4a41bb745e0c47c8e69b1008b *man/parse_bqr_query.Rd | ||
c9fdcdaed7c24bf33774de3e5207116c *man/rmNullObs.Rd | ||
4f517b883d180122b87094234afadacb *man/schema_fields.Rd | ||
95592f7be17d720b52e846ab24cb9e32 *man/timestamp_to_r.Rd | ||
a59ed0de0e2d665bad365061cc457dbb *tests/testthat.R | ||
4c8d57de99d7aef7be21fe3570a77d99 *tests/testthat/auth.json | ||
6559e60e37c35f770892f18831db6b2e *tests/testthat/test_query.R | ||
59d79154d6247524cbbc88634227446a *vignettes/bigQueryR.Rmd |
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,66 @@ | ||
# check authenticated with correct scopes | ||
check_bq_auth <- function(){ | ||
cloud_scopes <- c("https://www.googleapis.com/auth/cloud-platform", | ||
"https://www.googleapis.com/auth/bigquery") | ||
|
||
if(!getOption("googleAuthR.scopes.selected") %in% cloud_scopes){ | ||
stop("Not authenticated with Google BigQuery. Needs to be one of ", | ||
paste(cloud_scopes, collapse = " ")) | ||
current_op <- getOption("googleAuthR.verbose") | ||
options(googleAuthR.verbose = 2) | ||
googleAuthR::gar_token_info() | ||
options(googleAuthR.verbose = current_op) | ||
} | ||
} | ||
|
||
# check authenticated with correct scopes | ||
check_gcs_auth <- function(){ | ||
cloud_scopes <- c("https://www.googleapis.com/auth/cloud-platform", | ||
"https://www.googleapis.com/auth/devstorage.full_control", | ||
"https://www.googleapis.com/auth/devstorage.read_write") | ||
|
||
if(!getOption("googleAuthR.scopes.selected") %in% cloud_scopes){ | ||
stop("Not authenticated with Google Cloud Storage. Needs to be one of ", | ||
paste(cloud_scopes, collapse = " ")) | ||
current_op <- getOption("googleAuthR.verbose") | ||
options(googleAuthR.verbose = 2) | ||
googleAuthR::gar_token_info() | ||
options(googleAuthR.verbose = current_op) | ||
} | ||
} | ||
|
||
#' Authenticate this session | ||
#' | ||
#' A wrapper for \link[googleAuthR]{gar_auth} and \link[googleAuthR]{gar_auth_service} | ||
#' | ||
#' @param new_user If TRUE, reauthenticate via Google login screen | ||
#' @param no_auto Will ignore auto-authentication settings if TRUE | ||
#' | ||
#' If you have set the environment variable \code{BQ_AUTH_FILE} to a valid file location, | ||
#' the function will look there for authentication details. | ||
#' Otherwise it will look in the working directory for the `.httr-oauth` file, which if not present | ||
#' will trigger an authentication flow via Google login screen in your browser. | ||
#' | ||
#' If \code{BQ_AUTH_FILE} is specified, then \code{bqr_auth()} will be called upon loading the package | ||
#' via \code{library(bigQueryR)}, | ||
#' meaning that calling this function yourself at the start of the session won't be necessary. | ||
#' | ||
#' \code{BQ_AUTH_FILE} can be either a token generated by \link[googleAuthR]{gar_auth} or | ||
#' service account JSON ending with file extension \code{.json} | ||
#' | ||
#' @return Invisibly, the token that has been saved to the session | ||
#' @import googleAuthR | ||
#' @importFrom tools file_ext | ||
#' @export | ||
bqr_auth <- function(new_user = FALSE, no_auto = FALSE){ | ||
|
||
required_scopes <- c("https://www.googleapis.com/auth/bigquery", | ||
"https://www.googleapis.com/auth/devstorage.full_control", | ||
"https://www.googleapis.com/auth/cloud-platform") | ||
|
||
googleAuthR::gar_auto_auth(required_scopes, | ||
new_user = new_user, | ||
no_auto = no_auto, | ||
environment_var = "BQ_AUTH_FILE", | ||
travis_environment_var = "TRAVIS_BQ_AUTH_FILE") | ||
} |
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
Oops, something went wrong.