Auth resource return an error when retrieving invalid auth resources ID

Open Beginner friendly
#11 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
api, backend

Research direction

Start at internal/authresource/service.go:242, then trace how internal/authresource/handler.go:126 handles the invalid authorization resource. Reproduce the request with an authorization ID that does not belong to the consent, and confirm it returns the existing 404 error without a nil-pointer panic.

Written by the indexing model from the issue text.

Description

Type/Bug

Bellow error throws when fetching invalid auth resources, in {{baseUrl}}/consents/:consentId/authorizations/:authorizationId path

time=2026-02-25T08:47:58.794+05:30 level=WARN msg="Client error occurred" correlation-id=5e51ee9c-a7ba-44cc-8abd-54cc122ce1f6 code=AR-4040 message="Authorization resource not found" description="auth resource 9fc8dde3-7baa-480a-86e6-d11e7584d9a1 does not belong to consent string" http_status=404
2026/02/25 08:48:14 http: panic serving 127.0.0.1:54999: runtime error: invalid memory address or nil pointer dereference
goroutine 107 [running]:
net/http.(*conn).serve.func1()
        /usr/local/go/src/net/http/server.go:1943 +0xb4
panic({0x10475c220?, 0x104a271a0?})
        /usr/local/go/src/runtime/panic.go:783 +0x120
github.com/wso2/openfgc/internal/authresource.(*authResourceService).GetAuthResource(0x14000060168, {0x1047cf138, 0x14000176570}, {0x140005880c9, 0x24}, {0x14000588095, 0x24}, {0x14000582610, 0x6})
        /Users/hasithan/Projects/wso2/openfgc/consent-server/internal/authresource/service.go:242 +0x180
github.com/wso2/openfgc/internal/authresource.(*authResourceHandler).handleGet(0x14000012f20, {0x1047cecc0, 0x140003160f0}, 0x14000000c80)
        /Users/hasithan/Projects/wso2/openfgc/consent-server/internal/authresource/handler.go:126 +0x1ac
net/http.HandlerFunc.ServeHTTP(0x14000130180?, {0x1047cecc0?, 0x140003160f0?}, 0x10?)
        /usr/local/go/src/net/http/server.go:2322 +0x38
net/http.(*ServeMux).ServeHTTP(0x14000176510?, {0x1047cecc0, 0x140003160f0}, 0x14000000c80)
        /usr/local/go/src/net/http/server.go:2861 +0x190
main.setupHTTPServer.WrapWithCorrelationID.CorrelationIDMiddleware.func1({0x1047cecc0, 0x140003160f0}, 0x14000000b40)
        /Users/hasithan/Projects/wso2/openfgc/consent-server/internal/system/middleware/correlationid.go:57 +0xec
net/http.HandlerFunc.ServeHTTP(0x0?, {0x1047cecc0?, 0x140003160f0?}, 0x140002cfb50?)
        /usr/local/go/src/net/http/server.go:2322 +0x38
net/http.serverHandler.ServeHTTP({0x140002fae00?}, {0x1047cecc0?, 0x140003160f0?}, 0x1?)
        /usr/local/go/src/net/http/server.go:3340 +0xb0
net/http.(*conn).serve(0x140003818c0, {0x1047cf138, 0x140001882d0})
        /usr/local/go/src/net/http/server.go:2109 +0x528
created by net/http.(*Server).Serve in goroutine 19
        /usr/local/go/src/net/http/server.go:3493 +0x384
Dominant language
Go
Stars
8
Forks
17
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wso2/openfgc

All issues in wso2/openfgc

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.