Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions docs/usage/interpreter/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Snippet of code (language of interpreter) that executes after initialization of

## Credential Injection

Credentials from the credential manager can be injected into Notebooks. Credential injection works by replacing the following patterns in Notebooks with matching credentials for the Credential Manager: `{user.CREDENTIAL_ENTITY}` and `{password.CREDENTIAL_ENTITY}`. However, credential injection must be enabled per Interpreter, by adding a boolean `injectCredentials` setting in the Interpreters configuration. Injected passwords are removed from Notebook output to prevent accidentally leaking passwords.
Credentials from the credential manager can be injected into Notebooks. Credential injection works by replacing the following patterns in Notebooks with matching credentials for the Credential Manager: `{CREDENTIAL_ENTITY.user}` and `{CREDENTIAL_ENTITY.password}`. However, credential injection must be enabled per Interpreter, by adding a boolean `injectCredentials` setting in the Interpreters configuration. Injected passwords are removed from Notebook output to prevent accidentally leaking passwords.

**Credential Injection Setting**
<img src="{{BASE_PATH}}/assets/themes/zeppelin/img/screenshots/credential_injection_setting.png" width="500px">
Expand All @@ -142,9 +142,9 @@ Credentials from the credential manager can be injected into Notebooks. Credenti
**Credential Injection Example**

```scala
val password = "{password.SOME_CREDENTIAL_ENTITY}"
val password = "{SOME_CREDENTIAL_ENTITY.password}"

val username = "{user.SOME_CREDENTIAL_ENTITY}"
val username = "{SOME_CREDENTIAL_ENTITY.user}"
```

## Interpreter Process Recovery (Experimental)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class CredentialInjector {

private Set<String> passwords = new HashSet<>();
private final UserCredentials creds;
private static final Pattern userpattern = Pattern.compile("\\{user\\.([^\\}]+)\\}");
private static final Pattern passwordpattern = Pattern.compile("\\{password\\.([^\\}]+)\\}");
private static final Pattern userpattern = Pattern.compile("\\{([^\\}]+)\\.user\\}");
private static final Pattern passwordpattern = Pattern.compile("\\{([^\\}]+)\\.password\\}");


public CredentialInjector(UserCredentials creds) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public Credentials() {
}

public UserCredentials getUserCredentials(String username) throws IOException {
loadCredentials();
UserCredentials uc = credentialsMap.get(username);
if (uc == null) {
uc = new UserCredentials();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class CredentialInjectorTest {

private static final String TEMPLATE =
"val jdbcUrl = \"jdbc:mysql://localhost/emp?user={user.mysql}&password={password.mysql}\"";
"val jdbcUrl = \"jdbc:mysql://localhost/emp?user={mysql.user}&password={mysql.password}\"";
private static final String CORRECT_REPLACED =
"val jdbcUrl = \"jdbc:mysql://localhost/emp?user=username&password=pwd\"";

Expand Down