You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,38 @@ To install the extension, execute:
19
19
pip install jupyter_drives
20
20
```
21
21
22
+
## Configure Credentials
23
+
24
+
To begin using the extension and gain access to your drives, you need to configure your user credentials generated by the provider (e.g.: `access_key`, `secret-access-key` and if applicable `session_token`).
25
+
26
+
For those working with `S3` drives using the `AWS` CLI, the credentials will be automatically extracted from `~/.aws/credentials`. There is nothing that needs to be done on your side.
27
+
28
+
> Note: This is only applicable for Linux or macOS `AWS`[CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) users. In case you are using the `AWS` CLI from Windows, you can use the custom file path configuration with `C:\Users\USERNAME\.aws\credentials`. You can read more about this [here](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html).
29
+
30
+
### Configuration file
31
+
32
+
Otherwise, you can add your credentials to the server configuration file. Create a `jupyter_notebook_config.py` file in one of the
for example: `~/.jupyter/jupyter_notebook_config.py`, and specify your long-term or short-term credentials.
35
+
36
+
```python
37
+
c = get_config()
38
+
39
+
c.DrivesConfig.access_key_id ="<AWS Access Key ID / IAM Access Key ID>"
40
+
c.DrivesConfig.secret_access_key ="<AWS Secret Access Key / IAM Secret>"
41
+
c.DrivesConfig.session_token ="<AWS Session Token / IAM Session Token>"
42
+
```
43
+
44
+
### Custom credentials file path
45
+
46
+
You can also just specify the location of a local file which contains your credentials. The `acccess_key`, `secret_access_key` and if applicable the `session_token` will be automatically extracted from there.
Copy file name to clipboardExpand all lines: jupyter_drives/base.py
+47-1Lines changed: 47 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
importos
2
+
fromsysimportplatform
1
3
importentrypoints
2
4
fromtraitletsimportEnum, Unicode, default
3
5
fromtraitlets.configimportConfigurable
@@ -45,6 +47,13 @@ class DrivesConfig(Configurable):
45
47
help="Base URL of the provider service REST API.",
46
48
)
47
49
50
+
custom_credentials_path=Unicode(
51
+
None,
52
+
config=True,
53
+
allow_none=True,
54
+
help="Custom path of file where credentials are located. Extension automatically checks jupyter_notebook_config.py or directly in ~/.aws/credentials for AWS CLI users."
aws_credentials_path="~/.aws/credentials"#add read me about credentials path in windows: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html
0 commit comments