Skip to content

Get all secrets of one auth client return the response but data is always empty #1335

@russojrv-zz

Description

@russojrv-zz

Describe the bug
When you try to get all secrets of one auth client, it never returns items. The problem is that one await is missing in the code.

Expected behavior
Get all secrets of an auth client.

To Reproduce

  1. Call to the /:authclientId/secrets endpoint in the secret-service

Solution
Add the await to the corresponding method.

services/secret-service/src/route/auth-clients/index.js (Add the await)
const secrets = await findByAuthClient( req.user.sub, authClient._id, );
services/secret-service/src/dao/secret.js (Remove await/async and return the Promise)

findByAuthClient( id, authClientId, ) { return Secret.full.find({ 'value.authClientId': authClientId, 'owners.id': id, }, 'name type value.authClientId value.scope value.expires value.externalId owners currentError', ); },

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions