Find a password literal following an = token (for SET PASSWORD = 'pw').
(tokens: list[sqlglot.tokens.Token])
| 543 | |
| 544 | |
| 545 | def _find_password_after_eq(tokens: list[sqlglot.tokens.Token]) -> str | None: |
| 546 | """Find a password literal following an = token (for SET PASSWORD = 'pw').""" |
| 547 | tt = sqlglot.tokens.TokenType |
| 548 | for i, tok in enumerate(tokens): |
| 549 | if tok.token_type == tt.EQ and i + 1 < len(tokens): |
| 550 | next_tok = tokens[i + 1] |
| 551 | if next_tok.token_type == tt.STRING: |
| 552 | return next_tok.text |
| 553 | return None |
| 554 | |
| 555 | |
| 556 | def is_sandbox_allowed(text: str) -> bool: |
no outgoing calls
no test coverage detected