Skip to content

Commit 02e7f85

Browse files
nettoie vars env pour API Sirene
1 parent 2a2f1eb commit 02e7f85

File tree

5 files changed

+9
-15
lines changed

5 files changed

+9
-15
lines changed

.github/workflows/build-artifacts.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ jobs:
1717
- {os: ubuntu-24.04, r-version: '4.4', rspm: 'https://packagemanager.posit.co/cran/__linux__/noble/latest'}
1818
runs-on: ${{ matrix.config.os }}
1919
env:
20-
INSEE_APP_KEY: ${{ secrets.INSEE_APP_KEY }}
21-
INSEE_APP_SECRET: ${{ secrets.INSEE_APP_SECRET }}
20+
INSEE_API_TOKEN: ${{ secrets.INSEE_API_TOKEN }}
2221
RSPM: ${{ matrix.config.rspm }}
2322
GITHUB_PAT: ${{ secrets.PAT_TOKEN }}
2423
CURLOPT_TIMEOUT: 0

R/sirets_successeurs.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#' pouvoir générer un jeton d'accès. Ces informations sont à passer sous forme
1616
#' de variables d'environnement.
1717
#'
18-
#' Renseigner pour cela `INSEE_APP_KEY` et `INSEE_APP_SECRET` dans un fichier
18+
#' Renseigner pour cela `INSEE_API_TOKEN` dans un fichier
1919
#' de configuration `.Renviron`.
20-
#' Consulter [cette page](https://api.insee.fr/catalogue/site/themes/wso2/subthemes/insee/pages/help.jag)
20+
#' Consulter [cette page](https://github.com/InseeFrLab/DoReMIFaSol/tree/new-api#requ%C3%AAter-une-api-rest--le-r%C3%A9pertoire-dentreprises-sirene)
2121
#' pour de l'aide sur comment obtenir de tels identifiants.
2222
#'
2323
#' @param sirets établissements pour lesquels rechercher les successeurs (un

man/sirets_successeurs.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ library(doremifasol)
22
library(testthat)
33

44
# tests unitaires sur la fonction telechargerDonnees
5-
test_check("doremifasol")
5+
test_check("doremifasol")

tests/testthat/helper.R

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
skip_if_no_app <- function() {
2-
if (nzchar(Sys.getenv("INSEE_APP_KEY")) && nzchar(Sys.getenv("INSEE_APP_SECRET"))) {
2+
if (nzchar(Sys.getenv("INSEE_API_TOKEN"))) {
33
return(invisible(TRUE))
44
}
5-
testthat::skip("Environment variables INSEE_APP_KEY and INSEE_APP_SECRET are not defined.")
5+
testthat::skip("Environment variable INSEE_API_TOKEN is not defined.")
66
}
77

88
app_maybe <- function() {
99
skip_if_no_app()
10-
httr::oauth_app("Test", Sys.getenv("INSEE_APP_KEY"), Sys.getenv("INSEE_APP_SECRET"))
10+
check_configuration()
1111
}
1212

1313
check_configuration <- function() {
1414
skip_if_offline("api.insee.fr")
1515
skip_if_not_installed("httpuv")
1616
}
17-
18-
fetch_token_maybe <- function() {
19-
check_configuration()
20-
insee_token(app_maybe(), cache = FALSE)
21-
}

0 commit comments

Comments
 (0)