feat: add serve command for Postman integration#4
Merged
Conversation
Start a local HTTP server (127.0.0.1:9876 by default) exposing /token, /me, and /health endpoints. Postman pre-request scripts can call these to automatically fetch bearer tokens without spawning child processes. Refactored cmd/token.go and cmd/me.go to extract shared getToken and getMe helpers so both CLI commands and HTTP handlers use the same logic. Updated README with Postman setup instructions and a copy-paste pre-request script snippet.
ortegadn
approved these changes
Jul 10, 2026
An error occurred while trying to automatically change base from
andrespd99/feat/multi-projects
to
main
July 10, 2026 19:08
Dependency Review✅ No vulnerabilities or OpenSSF Scorecard issues found.Scanned FilesNone |
Reporte de Seguridad — 2026-07-10 20:02 UTC🚫 PR Bloqueado — Vulnerabilidades detectadas en este PR.
❌ CodeQLRevisa los detalles del check para más información. Deuda de seguridad existente en
|
| # | Paquete | Severidad | Detectado el |
|---|---|---|---|
| #13 | golang.org/x/crypto |
critical | 2026-07-10 |
| #12 | golang.org/x/crypto |
critical | 2026-07-10 |
| #11 | golang.org/x/crypto |
critical | 2026-07-10 |
| #10 | golang.org/x/crypto |
high | 2026-07-10 |
| #9 | golang.org/x/crypto |
critical | 2026-07-10 |
| #7 | golang.org/x/crypto |
critical | 2026-07-10 |
| #5 | golang.org/x/crypto |
critical | 2026-07-10 |
| #4 | golang.org/x/crypto |
critical | 2026-07-10 |
| #3 | golang.org/x/crypto |
high | 2026-07-10 |
Generado por Security Report · 2026-07-10 20:02 UTC
ortegadn
approved these changes
Jul 10, 2026
- Module path: github.com/andrespd99/fireauth - Binary name: fireauth - Config dir: ~/.fireauth/ - All docs, workflows, install script updated - No Cashea references remain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
servesubcommand that starts a local HTTP server for Postman pre-request script integration.Postman scripts cannot spawn child processes, so this provides REST endpoints that scripts can call over HTTP to fetch bearer tokens automatically.
Changes
cmd/serve.go(new) —servecobra command with--addrflag (default127.0.0.1:9876). Exposes:GET /health— health check with versionGET /token— returns bearer token (supports?project=,?refresh=true,?format=header)GET /me— returns JSON user details (supports?project=)http.ServeMuxsync.Mutexguards concurrent session file writescmd/token.go— ExtractedgetToken(projectName, forceRefresh)helper shared by CLI and HTTP handlercmd/me.go— ExtractedgetMe(ctx, projectName)helper shared by CLI and HTTP handlerREADME.md— Replaced "Coming soon" note with full Postman docs: server setup, endpoint reference, and a copy-paste pre-request script snippetTesting
All pass.