mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 12:20:34 +00:00

Co-authored-by: Mufei <327958099@qq.com> Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
21 lines
544 B
TypeScript
21 lines
544 B
TypeScript
import { parseHeaderCert } from '../controller';
|
|
import { AuthModeType } from '../type';
|
|
import { SERVICE_LOCAL_HOST } from '../../../common/system/tools';
|
|
|
|
export const authCert = async (props: AuthModeType) => {
|
|
const result = await parseHeaderCert(props);
|
|
|
|
return {
|
|
...result,
|
|
isOwner: true,
|
|
canWrite: true
|
|
};
|
|
};
|
|
|
|
/* auth the request from local service */
|
|
export const authRequestFromLocal = ({ req }: AuthModeType) => {
|
|
if (req.headers.host !== SERVICE_LOCAL_HOST) {
|
|
return Promise.reject('Invalid request');
|
|
}
|
|
};
|