Skip to content

Commit

Permalink
freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
JosiahParry committed Jun 5, 2024
1 parent 483f53e commit cb85e59
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
15 changes: 15 additions & 0 deletions _freeze/docs/auth/storing-credentials/execute-results/html.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hash": "826a7a3b195faf480c719a5e0fce2621",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: Storing credentials\n---\n\n\nAuthentication requires that you provide sensitive data to the R authentication R functions. These are used to verify your identity to the services that you are calling. These sensitive variables **should never be written down in your code**. \n\nThe packages in the R-ArcGIS Bridge rely heavily on **environment variables**. Environment variables are dynamic values that can be set to store sensitive or configuration information, allowing you to manage and control access to crucial data across various tools and applications, including R scripts.\n\n\n## Environment variables \n\nThe package `{arcgisutils}` is responsible for handling authorization for all of the R packages. With it, there are a number of different mechanism for authorizing each requiring a different combination of environment variables. \n\nEnvironment variables are fetched using `Sys.getenv()`. They are key-value pairs. For example, to find the path of R run\n\n\n::: {.cell}\n\n```{.r .cell-code}\nSys.getenv(\"R_HOME\")\n```\n\n::: {.cell-output .cell-output-stdout}\n\n```\n[1] \"/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources\"\n```\n\n\n:::\n:::\n\n\nOr to set a value use `Sys.setenv()`\n\n\n::: {.cell}\n\n```{.r .cell-code}\nSys.setenv(\"ANSWER_TO_EVERYTHING\" = 42)\nSys.getenv(\"ANSWER_TO_EVERYTHING\")\n```\n\n::: {.cell-output .cell-output-stdout}\n\n```\n[1] \"42\"\n```\n\n\n:::\n:::\n\n\n\n## Using an `.Renviron` file\n\nEnvironment variables should _**never**_ be included in your code.\nWe recommend using an `.Renviron` file at minimum to store your credentials.\n\nYou can use the `usethis` to edit the file. Ensure it is installed and run the following in your text editor:\n\n:::{.callout-warning}\nIf you modify environment variables you will need to restart your R session for the change to be registered.\n:::\n\n```r\nusethis::edit_r_environ()\n```\n:::{.callout-tip title=\"`.Renviron` scopes\" collapse=\"true\"}\n`.Renviron` files can be created at a user level or a project level. It is recommended to use project level `.Renviron` files when deploying scripts to production. If most of your work is interactive then a user level file is sufficient. \n\n**Project scoped** `.Renviron` files store environment variables that are available for the project _only_. The `.Renviron` is stored at the root folder level.\n\n**User scoped** `.Renviron` files store environment variables in the user's home directory. The environment variables will be available to you in any project you open. However, if you share your project, the environment variables will not be shared with it.\n:::\n\nThis will open your `.Renviron` file for you to edit.\n\n```bash\n# used for OAuth Code & Client\nARCGIS_CLIENT=your-client-id\n# used for OAuth Client flow\nARCGIS_SECRET=your-super-secret-key\n# used for publishing and Username/Password auth\nARCGIS_USER=your-user-name\n# used for API Key auth\nARCGIS_API_KEY=your-developer-api-key\n# specify if not using ArcGIS Online\nARCGIS_HOST=https://your-portal.com/ \n```\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
],
"includes": {},
"engineDependencies": {},
"preserve": {},
"postProcess": true
}
}
19 changes: 18 additions & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ website:
href: https://esri.com

sidebar:
collapse-level: 1
style: "floating"
contents:
- href: index.qmd
Expand All @@ -28,6 +29,20 @@ website:
- docs/auth/storing-credentials.qmd
- href: location-services/connecting-to-a-portal.qmd
text: "Authenticating with R"
- section: Layers
contents:
- text: "Overview"
- text: "Reading Feature Services"
- text: "Reading Image Servers"
- text: "Publishing layers"
- section: Editing
contents:
- Overview
- Adding features
- Updating features
- Deleting features
- section: Geocoding
- section: Places


# - section: ArcGIS Pro
Expand Down Expand Up @@ -56,4 +71,6 @@ format:
code-link: false


highlight-style: pygments
highlight-style: pygments

freeze: true
1 change: 0 additions & 1 deletion docs/auth/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ There a number of times when you will need to verify who you say you are when us
- store geocoding results in a file
- or access POI data through `{arcgisplaces}`


## Sign up for an account

To access certain content, services, or organizations, you will need to be signed in to eithe an ArcGIS Developer account, ArcGIS Online account, or ArcGIS Enterprise account. The type of account, user type, and role you need depends on the resource you need to access and the operations you wish to undertake.
Expand Down

0 comments on commit cb85e59

Please sign in to comment.