Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/oauth2-server

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/oauth2-server - npm Package Compare versions

Comparing version 3.0.13 to 3.0.14

128

oauth2-server/index.d.ts

@@ -30,3 +30,3 @@ // Type definitions for Node OAuth2 Server 3.0

options?: OAuth2Server.AuthenticateOptions,
callback?: OAuth2Server.Callback<OAuth2Server.Token>
callback?: OAuth2Server.Callback<OAuth2Server.Token>,
): Promise<OAuth2Server.Token>;

@@ -41,3 +41,3 @@

options?: OAuth2Server.AuthorizeOptions,
callback?: OAuth2Server.Callback<OAuth2Server.AuthorizationCode>
callback?: OAuth2Server.Callback<OAuth2Server.AuthorizationCode>,
): Promise<OAuth2Server.AuthorizationCode>;

@@ -52,3 +52,3 @@

options?: OAuth2Server.TokenOptions,
callback?: OAuth2Server.Callback<OAuth2Server.Token>
callback?: OAuth2Server.Callback<OAuth2Server.Token>,
): Promise<OAuth2Server.Token>;

@@ -63,9 +63,8 @@ }

body?: any;
headers?: { [key: string]: string; } | undefined;
headers?: { [key: string]: string } | undefined;
method?: string | undefined;
query?: { [key: string]: string; } | undefined;
query?: { [key: string]: string } | undefined;
/**
* Instantiates Request using the supplied options.
*
*/

@@ -76,3 +75,2 @@ constructor(options?: { [key: string]: any } | Express.Request);

* Returns the specified HTTP header field. The match is case-insensitive.
*
*/

@@ -83,3 +81,2 @@ get(field: string): any | undefined;

* Checks if the request’s Content-Type HTTP header matches any of the given MIME types.
*
*/

@@ -94,3 +91,3 @@ is(types: string[]): string | false;

body?: any;
headers?: { [key: string]: string; } | undefined;
headers?: { [key: string]: string } | undefined;
status?: number | undefined;

@@ -100,9 +97,7 @@

* Instantiates Response using the supplied options.
*
*/
constructor(options?: { [key: string]: any; } | Express.Response);
constructor(options?: { [key: string]: any } | Express.Response);
/**
* Returns the specified HTTP header field. The match is case-insensitive.
*
*/

@@ -113,3 +108,2 @@ get(field: string): any | undefined;

* Sets the specified HTTP header field. The match is case-insensitive.
*
*/

@@ -120,3 +114,2 @@ set(field: string, value: string): void;

* Redirects to the specified URL using 302 Found.
*
*/

@@ -129,9 +122,7 @@ redirect(url: string): void;

* Instantiates AbstractGrantType using the supplied options.
*
*/
constructor(options: TokenOptions)
constructor(options: TokenOptions);
/**
* Generate access token. Calls Model#generateAccessToken() if implemented.
*
*/

@@ -142,3 +133,2 @@ generateAccessToken(client: Client, user: User, scope: string | string[]): Promise<string>;

* Generate refresh token. Calls Model#generateRefreshToken() if implemented.
*
*/

@@ -149,3 +139,2 @@ generateRefreshToken(client: Client, user: User, scope: string | string[]): Promise<string>;

* Get access token expiration date.
*
*/

@@ -156,3 +145,2 @@ getAccessTokenExpiresAt(): Date;

* Get refresh token expiration date.
*
*/

@@ -163,3 +151,2 @@ getRefreshTokenExpiresAt(): Date;

* Get scope from the request body.
*
*/

@@ -170,3 +157,2 @@ getScope(request: Request): string;

* Validate requested scope. Calls Model#validateScope() if implemented.
*
*/

@@ -177,3 +163,2 @@ validateScope(user: User, client: Client, scope: string | string[]): Promise<string | string[] | Falsey>;

* Retrieve info from the request and client and return token
*
*/

@@ -269,3 +254,3 @@ abstract handle(request: Request, client: Client): Promise<Token | Falsey>;

*/
type Falsey = '' | 0 | false | null | undefined;
type Falsey = "" | 0 | false | null | undefined;

@@ -275,15 +260,21 @@ interface BaseModel {

* Invoked to generate a new access token.
*
*/
generateAccessToken?(client: Client, user: User, scope: string | string[], callback?: Callback<string>): Promise<string>;
generateAccessToken?(
client: Client,
user: User,
scope: string | string[],
callback?: Callback<string>,
): Promise<string>;
/**
* Invoked to retrieve a client using a client id or a client id/client secret combination, depending on the grant type.
*
*/
getClient(clientId: string, clientSecret: string, callback?: Callback<Client | Falsey>): Promise<Client | Falsey>;
getClient(
clientId: string,
clientSecret: string,
callback?: Callback<Client | Falsey>,
): Promise<Client | Falsey>;
/**
* Invoked to save an access token and optionally a refresh token, depending on the grant type.
*
*/

@@ -296,3 +287,2 @@ saveToken(token: Token, client: Client, user: User, callback?: Callback<Token>): Promise<Token | Falsey>;

* Invoked to retrieve an existing access token previously saved through Model#saveToken().
*
*/

@@ -303,3 +293,2 @@ getAccessToken(accessToken: string, callback?: Callback<Token>): Promise<Token | Falsey>;

* Invoked during request authentication to check if the provided access token was authorized the requested scopes.
*
*/

@@ -312,31 +301,40 @@ verifyScope(token: Token, scope: string | string[], callback?: Callback<boolean>): Promise<boolean>;

* Invoked to generate a new refresh token.
*
*/
generateRefreshToken?(client: Client, user: User, scope: string | string[], callback?: Callback<string>): Promise<string>;
generateRefreshToken?(
client: Client,
user: User,
scope: string | string[],
callback?: Callback<string>,
): Promise<string>;
/**
* Invoked to generate a new authorization code.
*
*/
generateAuthorizationCode?(client: Client, user: User, scope: string | string[], callback?: Callback<string>): Promise<string>;
generateAuthorizationCode?(
client: Client,
user: User,
scope: string | string[],
callback?: Callback<string>,
): Promise<string>;
/**
* Invoked to retrieve an existing authorization code previously saved through Model#saveAuthorizationCode().
*
*/
getAuthorizationCode(authorizationCode: string, callback?: Callback<AuthorizationCode>): Promise<AuthorizationCode | Falsey>;
getAuthorizationCode(
authorizationCode: string,
callback?: Callback<AuthorizationCode>,
): Promise<AuthorizationCode | Falsey>;
/**
* Invoked to save an authorization code.
*
*/
saveAuthorizationCode(
code: Pick<AuthorizationCode, 'authorizationCode' | 'expiresAt' | 'redirectUri' | 'scope'>,
client: Client,
user: User,
callback?: Callback<AuthorizationCode>): Promise<AuthorizationCode | Falsey>;
code: Pick<AuthorizationCode, "authorizationCode" | "expiresAt" | "redirectUri" | "scope">,
client: Client,
user: User,
callback?: Callback<AuthorizationCode>,
): Promise<AuthorizationCode | Falsey>;
/**
* Invoked to revoke an authorization code.
*
*/

@@ -347,5 +345,9 @@ revokeAuthorizationCode(code: AuthorizationCode, callback?: Callback<boolean>): Promise<boolean>;

* Invoked to check if the requested scope is valid for a particular client/user combination.
*
*/
validateScope?(user: User, client: Client, scope: string | string[], callback?: Callback<string | Falsey>): Promise<string | string[] | Falsey>;
validateScope?(
user: User,
client: Client,
scope: string | string[],
callback?: Callback<string | Falsey>,
): Promise<string | string[] | Falsey>;
}

@@ -356,9 +358,12 @@

* Invoked to generate a new refresh token.
*
*/
generateRefreshToken?(client: Client, user: User, scope: string | string[], callback?: Callback<string>): Promise<string>;
generateRefreshToken?(
client: Client,
user: User,
scope: string | string[],
callback?: Callback<string>,
): Promise<string>;
/**
* Invoked to retrieve a user using a username/password combination.
*
*/

@@ -369,5 +374,9 @@ getUser(username: string, password: string, callback?: Callback<User | Falsey>): Promise<User | Falsey>;

* Invoked to check if the requested scope is valid for a particular client/user combination.
*
*/
validateScope?(user: User, client: Client, scope: string | string[], callback?: Callback<string | Falsey>): Promise<string | string[] | Falsey>;
validateScope?(
user: User,
client: Client,
scope: string | string[],
callback?: Callback<string | Falsey>,
): Promise<string | string[] | Falsey>;
}

@@ -378,9 +387,12 @@

* Invoked to generate a new refresh token.
*
*/
generateRefreshToken?(client: Client, user: User, scope: string | string[], callback?: Callback<string>): Promise<string>;
generateRefreshToken?(
client: Client,
user: User,
scope: string | string[],
callback?: Callback<string>,
): Promise<string>;
/**
* Invoked to retrieve an existing refresh token previously saved through Model#saveToken().
*
*/

@@ -391,3 +403,2 @@ getRefreshToken(refreshToken: string, callback?: Callback<RefreshToken>): Promise<RefreshToken | Falsey>;

* Invoked to revoke a refresh token.
*
*/

@@ -400,3 +411,2 @@ revokeToken(token: RefreshToken | Token, callback?: Callback<boolean>): Promise<boolean>;

* Invoked to retrieve the user associated with the specified client.
*
*/

@@ -407,5 +417,9 @@ getUserFromClient(client: Client, callback?: Callback<User | Falsey>): Promise<User | Falsey>;

* Invoked to check if the requested scope is valid for a particular client/user combination.
*
*/
validateScope?(user: User, client: Client, scope: string | string[], callback?: Callback<string | Falsey>): Promise<string | string[] | Falsey>;
validateScope?(
user: User,
client: Client,
scope: string | string[],
callback?: Callback<string | Falsey>,
): Promise<string | string[] | Falsey>;
}

@@ -412,0 +426,0 @@

{
"name": "@types/oauth2-server",
"version": "3.0.13",
"version": "3.0.14",
"description": "TypeScript definitions for Node OAuth2 Server",

@@ -40,4 +40,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/oauth2-server",

},
"typesPublisherContentHash": "f715bb4f2d166117ef78f58270233cc5da4f8630249cdc769572c95d7de885ee",
"typeScriptVersion": "3.6"
"typesPublisherContentHash": "626c26fe1d1620da1f35e23e0e6444530b0907bf1a1bd86473572a223dc40f18",
"typeScriptVersion": "4.3"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Thu, 08 Jul 2021 18:51:43 GMT
* Last updated: Sun, 03 Sep 2023 22:33:45 GMT
* Dependencies: [@types/express](https://npmjs.com/package/@types/express)

@@ -14,0 +14,0 @@ * Global values: none

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc