Skip to content

Use an auth.Session for indexing spaces - #3556

Open
aduffeck wants to merge 3 commits into
opencloud-eu:mainfrom
aduffeck:index-space-auth-session
Open

aduffeck wants to merge 3 commits into
opencloud-eu:mainfrom
aduffeck:index-space-auth-session

Conversation

@aduffeck

Copy link
Copy Markdown
Member

This makes sure that the token does not expire if the indexing process takes longer than the token lifetime.

This commit also makes sure that the authenticated context is reused instead of generating a new context for each resource which is much more efficient.

Note: Depends on opencloud-eu/reva#804

This makes sure that the token does not expire if the indexing process
takes longer than the token lifetime.

This commit also makes sure that the authenticated context is reused
instead of generating a new context for each resource which is much more
efficient.
@codacy-production

codacy-production Bot commented Sep 17, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 critical

Alerts:
⚠ 2 issues (≤ 0 issues of at least minor severity)

Results:
2 new issues

Category Results
Security 2 critical

View in Codacy

🟢 Metrics 17 complexity

Metric Results
Complexity 17

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Comment thread services/search/pkg/search/service.go Outdated
rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
collaborationv1beta1 "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/golang-jwt/jwt/v4"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use jwt/v5 here? I know we're also still bundling v4 but just because of transient dependencies.

return time.Time{}, errors.New("no auth token in context")
}
var claims jwt.RegisteredClaims
if _, _, err := jwt.NewParser().ParseUnverified(tkn, &claims); err != nil {

@rhafer rhafer Sep 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit tests use authtoken as the token value. Which will cause an error here. I guess the test need to generate a valid JWT now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants