Skip to content

Commit 75c66e8

Browse files
authored
fix: avoid passgenerator pipe warning
2 parents 4ac76c2 + 9a0d63c commit 75c66e8

8 files changed

Lines changed: 65 additions & 6 deletions

File tree

memory/distribution/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ Mapear os artefatos Linux do `ab` e sua publicação automatizada.
1212

1313
```mermaid
1414
flowchart LR
15-
Tag[tag v1.0.0] --> Workflow[release.yml]
15+
Tag[tag v*] --> Workflow[release.yml]
1616
Workflow --> Snap[Snap classic]
1717
Workflow --> Flatpak[Flatpak bundle]
1818
Workflow --> Release[GitHub Release]
1919
```
20-

memory/utilities/PASSGENERATOR.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Gerador de senhas
2+
3+
## Responsabilidade
4+
5+
Gerar senhas a partir de `/dev/urandom` com regras de composição opcionais.
6+
7+
## Entidades
8+
9+
- `scripts/passgenerator`: script Bash que monta o conjunto de caracteres e valida a senha gerada.
10+
11+
## Relações
12+
13+
- `bin/ab-util` encaminha `ab util passgenerator` ao script.
14+
- Os pacotes Snap e Flatpak copiam `scripts/` para a instalação.
15+
16+
## Fluxo
17+
18+
1. Lê uma quantidade finita de bytes aleatórios e filtra o conjunto escolhido.
19+
2. Acumula caracteres até atingir o tamanho solicitado.
20+
3. Rejeita sequências, repetições e combinações que não atendem aos mínimos configurados.
21+
22+
## Fontes no código
23+
24+
- `scripts/passgenerator`
25+
- `bin/ab-util`
26+
- `tests/integration/test_passgenerator.py`

memory/utilities/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Utilitários
2+
3+
## Responsabilidade
4+
5+
Mapear os utilitários locais expostos por `ab util`.
6+
7+
## Componentes
8+
9+
- [PASSGENERATOR.md](PASSGENERATOR.md): geração de senhas seguras.
10+
11+
## Relações
12+
13+
```mermaid
14+
flowchart LR
15+
Command[ab util passgenerator] --> Dispatcher[bin/ab-util]
16+
Dispatcher --> Generator[scripts/passgenerator]
17+
```

packaging/snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: ab
22
base: core24
3-
version: "1.0.0"
3+
version: "1.0.1"
44
summary: Allan Batista's Linux development utilities
55
description: |
66
Unified CLI utilities for development workflows powered by OpenRouter.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ab-cli"
7-
version = "1.0.0"
7+
version = "1.0.1"
88
description = "AI Linux Dev Utilities - Unified CLI utilities for development workflows, powered by LLMs via OpenRouter"
99
readme = "README.md"
1010
license = {text = "MIT"}

scripts/passgenerator

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ contains_repeated() {
8787
generate_password() {
8888
local pwd=""
8989
while true; do
90-
pwd=$(< /dev/urandom tr -dc "$CHARSET" | head -c "$LENGTH")
90+
pwd=""
91+
while [[ ${#pwd} -lt "$LENGTH" ]]; do
92+
pwd+=$(head -c "$((LENGTH * 32))" /dev/urandom | tr -dc "$CHARSET")
93+
done
94+
pwd="${pwd:0:LENGTH}"
9195

9296
# Check minimum quantities
9397
[[ $(grep -o "[A-Za-z]" <<< "$pwd" | wc -l) -lt "$MIN_LETTERS" ]] && continue

src/ab_cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
Unified CLI utilities for development workflows, powered by LLMs via OpenRouter.
44
"""
55

6-
__version__ = "1.0.0"
6+
__version__ = "1.0.1"
77
__author__ = "Allan Batista"

tests/integration/test_passgenerator.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,16 @@ def test_passgenerator_help_is_available():
1616

1717
assert result.returncode == 0
1818
assert "--min-digits" in result.stdout
19+
20+
21+
def test_passgenerator_generates_password_without_stderr():
22+
result = subprocess.run(
23+
[str(AB), "util", "passgenerator", "16", "--no-punct"],
24+
capture_output=True,
25+
text=True,
26+
)
27+
28+
assert result.returncode == 0
29+
assert result.stderr == ""
30+
assert len(result.stdout.strip()) == 16
31+
assert result.stdout.strip().isalnum()

0 commit comments

Comments
 (0)