Skip to content

Commit 2aa89a6

Browse files
authored
Note in schema which operations have sensitive secrets (#2895)
1 parent fa4fd26 commit 2aa89a6

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

src/components/authentication/login.resolver.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ResolveField,
77
Resolver,
88
} from '@nestjs/graphql';
9+
import { stripIndent } from 'common-tags';
910
import { AnonSession, GqlContextType, Session } from '../../common';
1011
import { Loader, LoaderOf } from '../../core';
1112
import { Powers as Power, Privileges } from '../authorization';
@@ -21,7 +22,10 @@ export class LoginResolver {
2122
) {}
2223

2324
@Mutation(() => LoginOutput, {
24-
description: 'Login a user',
25+
description: stripIndent`
26+
Login a user
27+
@sensitive-secrets
28+
`,
2529
})
2630
async login(
2731
@Args('input') input: LoginInput,
@@ -34,7 +38,10 @@ export class LoginResolver {
3438
}
3539

3640
@Mutation(() => LogoutOutput, {
37-
description: 'Logout a user',
41+
description: stripIndent`
42+
Logout a user
43+
@sensitive-secrets
44+
`,
3845
})
3946
async logout(
4047
@AnonSession() session: Session,

src/components/authentication/password.resolver.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Args, Mutation, Resolver } from '@nestjs/graphql';
2+
import { stripIndent } from 'common-tags';
23
import { AnonSession, LoggedInSession, Session } from '../../common';
34
import { AuthenticationService } from './authentication.service';
45
import {
@@ -15,7 +16,10 @@ export class PasswordResolver {
1516
constructor(private readonly authentication: AuthenticationService) {}
1617

1718
@Mutation(() => ChangePasswordOutput, {
18-
description: 'Change your password',
19+
description: stripIndent`
20+
Change your password
21+
@sensitive-secrets
22+
`,
1923
})
2024
async changePassword(
2125
@Args() { oldPassword, newPassword }: ChangePasswordArgs,
@@ -36,7 +40,10 @@ export class PasswordResolver {
3640
}
3741

3842
@Mutation(() => ResetPasswordOutput, {
39-
description: 'Reset Password',
43+
description: stripIndent`
44+
Reset Password
45+
@sensitive-secrets
46+
`,
4047
})
4148
async resetPassword(
4249
@Args('input') input: ResetPasswordInput,

src/components/authentication/register.resolver.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ResolveField,
77
Resolver,
88
} from '@nestjs/graphql';
9+
import { stripIndent } from 'common-tags';
910
import { AnonSession, GqlContextType, Session } from '../../common';
1011
import { Loader, LoaderOf } from '../../core';
1112
import { Powers as Power, Privileges } from '../authorization';
@@ -21,7 +22,10 @@ export class RegisterResolver {
2122
) {}
2223

2324
@Mutation(() => RegisterOutput, {
24-
description: 'Register a new user',
25+
description: stripIndent`
26+
Register a new user
27+
@sensitive-secrets
28+
`,
2529
})
2630
async register(
2731
@Args('input') input: RegisterInput,

0 commit comments

Comments
 (0)