Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DaskKubernetesEnvironment #1338

Merged
merged 9 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update secret documentation as well
  • Loading branch information
cicdw committed Aug 9, 2019
commit b2abb4c5f9864afbac8bf9b1ca1ea1ced701813b
2 changes: 1 addition & 1 deletion docs/cloud/cloud_concepts/secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ KEY = VALUE
with however many key / value pairs you'd like.

::: tip You don't have to store raw values in your config
Prefect will interpolate certain values from your OS environment, so you can specify values from environment variables via `"$ENV_VAR"`.
Prefect will interpolate certain values from your OS environment, so you can specify values from environment variables via `"$ENV_VAR"`. Note that secrets set this way will always result in lowercase names.
:::

### Cloud Execution
Expand Down
2 changes: 1 addition & 1 deletion docs/outline.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classes = ["Client"]

[pages.client.secrets]
title = "Secrets"
module = "prefect.client"
module = "prefect.client.secrets"
classes = ["Secret"]

[pages.schedules.schedules]
Expand Down
33 changes: 33 additions & 0 deletions src/prefect/client/secrets.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
"""
A Secret is a serializable object used to represent a secret key & value.

The value of the `Secret` is not set upon initialization and instead is set
either in `prefect.context` or on the server, with behavior dependent on the value
of the `use_local_secrets` flag in your Prefect configuration file.

To set a Secret in Prefect Cloud, you can use `prefect.Client.set_secret`, or set it directly via GraphQL:

```graphql
mutation {
setSecret(input: { name: "KEY", value: "VALUE" }) {
success
}
}
```

To set a _local_ Secret, either place the value in your user configuration file (located at `~/.prefect/config.toml`):

```
[context.secrets]
MY_KEY = "MY_VALUE"
```

or directly in context:

```python
import prefect

prefect.context.secrets["MY_KEY"] = "MY_VALUE"
```
"""

import json
import os
from typing import Any, Optional
Expand Down