Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
7c3fcc29
Unverified
Commit
7c3fcc29
authored
Jan 07, 2026
by
Faizaan pochi
Committed by
GitHub
Jan 07, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: allow public memo API access without authentication (#5451)
parent
14fb38f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
v1.go
server/router/api/v1/v1.go
+3
-2
No files found.
server/router/api/v1/v1.go
View file @
7c3fcc29
...
@@ -59,7 +59,7 @@ func (s *APIV1Service) RegisterGateway(ctx context.Context, echoServer *echo.Ech
...
@@ -59,7 +59,7 @@ func (s *APIV1Service) RegisterGateway(ctx context.Context, echoServer *echo.Ech
ctx
:=
r
.
Context
()
ctx
:=
r
.
Context
()
// Get the RPC method name from context (set by grpc-gateway after routing)
// Get the RPC method name from context (set by grpc-gateway after routing)
rpcMethod
,
_
:=
runtime
.
RPCMethod
(
ctx
)
rpcMethod
,
ok
:=
runtime
.
RPCMethod
(
ctx
)
// Extract credentials from HTTP headers
// Extract credentials from HTTP headers
authHeader
:=
r
.
Header
.
Get
(
"Authorization"
)
authHeader
:=
r
.
Header
.
Get
(
"Authorization"
)
...
@@ -67,7 +67,8 @@ func (s *APIV1Service) RegisterGateway(ctx context.Context, echoServer *echo.Ech
...
@@ -67,7 +67,8 @@ func (s *APIV1Service) RegisterGateway(ctx context.Context, echoServer *echo.Ech
result
:=
authenticator
.
Authenticate
(
ctx
,
authHeader
)
result
:=
authenticator
.
Authenticate
(
ctx
,
authHeader
)
// Enforce authentication for non-public methods
// Enforce authentication for non-public methods
if
result
==
nil
&&
!
IsPublicMethod
(
rpcMethod
)
{
// If rpcMethod cannot be determined, allow through, service layer will handle visibility checks
if
result
==
nil
&&
ok
&&
!
IsPublicMethod
(
rpcMethod
)
{
http
.
Error
(
w
,
`{"code": 16, "message": "authentication required"}`
,
http
.
StatusUnauthorized
)
http
.
Error
(
w
,
`{"code": 16, "message": "authentication required"}`
,
http
.
StatusUnauthorized
)
return
return
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment