Ai
1 Star 0 Fork 0

codingchengdu/egg-oauth2-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.d.ts 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
Stephen 提交于 2019-05-09 01:10 +08:00 . Add declaration file. (#47)
import { Context } from 'egg';
import * as OAuth2Server from 'oauth2-server';
import { AuthorizationCode, Token,
AuthorizationCodeModel, ClientCredentialsModel, RefreshTokenModel, PasswordModel, ExtensionModel,
AuthenticateOptions, AuthorizeOptions, ServerOptions, TokenOptions,
} from 'oauth2-server';
declare module 'egg' {
export interface Application {
oAuth2Server: OAuth2;
}
}
type Model = AuthorizationCodeModel | ClientCredentialsModel | RefreshTokenModel | PasswordModel | ExtensionModel;
type ExecuteOptions = AuthenticateOptions | AuthorizeOptions | TokenOptions;
declare class OAuth2 {
constructor(config: ServerOptions, model: Model);
private config: ServerOptions;
private model: Model;
private server: OAuth2Server;
/**
* Authenticates a request.
*/
public authenticate(options?: AuthenticateOptions): (ctx: Context, next: Function) => Promise<void>;
/**
* Authorizes a token request.
*/
public authorize(options?: AuthorizeOptions): (ctx: Context, next: Function) => Promise<void>;
/**
* Retrieves a new token for an authorized token request.
*/
public token(options?: TokenOptions): (ctx: Context, next: Function) => Promise<void>;
private execute(handle: 'authenticate' | 'authorize' | 'token', ctx: Context, options: ExecuteOptions): Promise<AuthorizationCode | Token>;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/codingchengdu/egg-oauth2-server.git
git@gitee.com:codingchengdu/egg-oauth2-server.git
codingchengdu
egg-oauth2-server
egg-oauth2-server
master

搜索帮助