detached e32c0a4

test(middleware): add GetAuthStatus to stubAuthService and fix error message capitalization

commit
e32c0a44c1c036466260d80160e4206baaf21c94
author
bnema · · 2026-01-28 21:36 UTC
parent
a66330d
signature
unsigned
2 files · +6 -2
M internal/adapters/in/cli/auth.go +2 -2
@@ -683,12 +683,12 @@ func runAuthStatus() error {
683683 // Determine active remote
684684 remoteName := config.Active
685685 if remoteName == "" {
686- return fmt.Errorf("No active remote configured. Use 'gordon remote use <name>' or --remote flag")
686+ return fmt.Errorf("no active remote configured. Use 'gordon remote use <name>' or --remote flag")
687687 }
688688
689689 remoteConfig, ok := config.Remotes[remoteName]
690690 if !ok {
691- return fmt.Errorf("Active remote '%s' not found", remoteName)
691+ return fmt.Errorf("active remote '%s' not found", remoteName)
692692 }
693693
694694 // Create client
@@ -683,12 +683,12 @@ func runAuthStatus() error {
683 // Determine active remote683 // Determine active remote
684 remoteName := config.Active684 remoteName := config.Active
685 if remoteName == "" {685 if remoteName == "" {
686- return fmt.Errorf("No active remote configured. Use 'gordon remote use <name>' or --remote flag")686+ return fmt.Errorf("no active remote configured. Use 'gordon remote use <name>' or --remote flag")
687 }687 }
688 688
689 remoteConfig, ok := config.Remotes[remoteName]689 remoteConfig, ok := config.Remotes[remoteName]
690 if !ok {690 if !ok {
691- return fmt.Errorf("Active remote '%s' not found", remoteName)691+ return fmt.Errorf("active remote '%s' not found", remoteName)
692 }692 }
693 693
694 // Create client694 // Create client
M internal/adapters/in/http/middleware/auth_test.go +4 -0
@@ -501,6 +501,10 @@ func (s stubAuthService) GeneratePasswordHash(string) (string, error) {
501501 return "", errors.New("not implemented")
502502 }
503503
504+func (s stubAuthService) GetAuthStatus(context.Context) (*domain.AuthStatus, error) {
505+ return nil, errors.New("not implemented")
506+}
507+
504508 // Tests for checkScopeAccess function
505509
506510 func TestCheckScopeAccess_ActionMapping(t *testing.T) {
@@ -501,6 +501,10 @@ func (s stubAuthService) GeneratePasswordHash(string) (string, error) {
501 return "", errors.New("not implemented")501 return "", errors.New("not implemented")
502 }502 }
503 503
504+func (s stubAuthService) GetAuthStatus(context.Context) (*domain.AuthStatus, error) {
505+ return nil, errors.New("not implemented")
506+}
507+
504 // Tests for checkScopeAccess function508 // Tests for checkScopeAccess function
505 509
506 func TestCheckScopeAccess_ActionMapping(t *testing.T) {510 func TestCheckScopeAccess_ActionMapping(t *testing.T) {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close