mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
refactor(schema): simplify validation and OpenAPI generation (#2709)
This commit is contained in:
@@ -33,7 +33,6 @@ import type {
|
||||
TokenRequest,
|
||||
} from '@fluxer/schema/src/domains/oauth/OAuthSchemas';
|
||||
import type {Context} from 'hono';
|
||||
import type {z} from 'zod';
|
||||
import type {ApiContext} from '../ApiContext';
|
||||
import type {SudoVerificationBody} from '../auth/services/SudoVerificationService';
|
||||
import {requireSudoMode} from '../auth/services/SudoVerificationService';
|
||||
@@ -74,7 +73,7 @@ export class OAuth2RequestService {
|
||||
) {}
|
||||
|
||||
async tokenExchange(params: {
|
||||
form: z.infer<typeof TokenRequest>;
|
||||
form: TokenRequest;
|
||||
authorizationHeader?: string;
|
||||
logPrefix: string;
|
||||
}): Promise<OAuth2TokenResponse> {
|
||||
@@ -149,7 +148,7 @@ export class OAuth2RequestService {
|
||||
};
|
||||
}
|
||||
|
||||
async revoke(params: {form: z.infer<typeof RevokeRequestForm>; authorizationHeader?: string}): Promise<void> {
|
||||
async revoke(params: {form: RevokeRequestForm; authorizationHeader?: string}): Promise<void> {
|
||||
const {clientId: clientIdStr, clientSecret: secret} = parseClientCredentials(
|
||||
params.authorizationHeader,
|
||||
params.form.client_id,
|
||||
@@ -165,7 +164,7 @@ export class OAuth2RequestService {
|
||||
}
|
||||
|
||||
async introspect(params: {
|
||||
form: z.infer<typeof IntrospectRequestForm>;
|
||||
form: IntrospectRequestForm;
|
||||
authorizationHeader?: string;
|
||||
}): Promise<OAuth2IntrospectResponse> {
|
||||
const {clientId: clientIdStr, clientSecret: secret} = parseClientCredentials(
|
||||
@@ -194,7 +193,7 @@ export class OAuth2RequestService {
|
||||
}
|
||||
|
||||
async authorizeConsent(params: {
|
||||
body: z.infer<typeof AuthorizeConsentRequest>;
|
||||
body: AuthorizeConsentRequest;
|
||||
userId: UserID;
|
||||
requestCache: RequestCache;
|
||||
}): Promise<OAuth2ConsentResponse> {
|
||||
|
||||
Reference in New Issue
Block a user