@jmondi/oauth2-server
Advanced tools
Comparing version 0.0.2-beta.4 to 0.0.2-beta.5
import { OAuthUser } from "./user.entity"; | ||
import { OAuthClient } from "./client.entity"; | ||
import { OAuthScope } from "./scope.entity"; | ||
export interface AuthCode { | ||
export interface OAuthAuthCode { | ||
token: string; | ||
@@ -6,0 +6,0 @@ user?: OAuthUser; |
@@ -5,3 +5,3 @@ import { DateInterval } from "@jmondi/date-interval"; | ||
import { OAuthAccessTokenRepository, OAuthAuthCodeRepository, OAuthClientRepository, OAuthRefreshTokenRepository, OAuthScopeRepository, OAuthUserRepository } from "../repositories"; | ||
import { OAuthAccessToken, AuthCode, OAuthClient, OAuthRefreshToken, OAuthScope } from "../entities"; | ||
import { OAuthAccessToken, OAuthAuthCode, OAuthClient, OAuthRefreshToken, OAuthScope } from "../entities"; | ||
import { RedirectResponse } from "../responses"; | ||
@@ -36,3 +36,3 @@ import { JwtService } from "../utils"; | ||
protected issueAccessToken(accessTokenTTL: DateInterval, client: OAuthClient, userId?: string, scopes?: OAuthScope[]): Promise<OAuthAccessToken>; | ||
protected issueAuthCode(authCodeTTL: DateInterval, client: OAuthClient, userIdentifier?: string, redirectUri?: string, codeChallenge?: string, codeChallengeMethod?: string, scopes?: OAuthScope[]): Promise<AuthCode>; | ||
protected issueAuthCode(authCodeTTL: DateInterval, client: OAuthClient, userIdentifier?: string, redirectUri?: string, codeChallenge?: string, codeChallengeMethod?: string, scopes?: OAuthScope[]): Promise<OAuthAuthCode>; | ||
protected issueRefreshToken(accessToken: OAuthAccessToken): Promise<OAuthRefreshToken | undefined>; | ||
@@ -39,0 +39,0 @@ protected generateUniqueIdentifier(len?: number): string; |
@@ -1,5 +0,5 @@ | ||
import { AuthCode, OAuthClient, OAuthScope, OAuthUser } from "../entities"; | ||
import { OAuthAuthCode, OAuthClient, OAuthScope, OAuthUser } from "../entities"; | ||
export interface OAuthAuthCodeRepository { | ||
getNewAuthCode(client: OAuthClient, user: OAuthUser | undefined, scopes: OAuthScope[]): AuthCode; | ||
persistNewAuthCode(authCode: AuthCode): Promise<AuthCode>; | ||
getNewAuthCode(client: OAuthClient, user: OAuthUser | undefined, scopes: OAuthScope[]): OAuthAuthCode; | ||
persistNewAuthCode(authCode: OAuthAuthCode): Promise<OAuthAuthCode>; | ||
isAuthCodeRevoked(authCodeCode: string): Promise<any>; | ||
@@ -6,0 +6,0 @@ getAuthCodeByIdentifier(authCodeCode: string): Promise<any>; |
{ | ||
"version": "0.0.2-beta.4", | ||
"version": "0.0.2-beta.5", | ||
"license": "MIT", | ||
@@ -4,0 +4,0 @@ "main": "dist/index.js", |
@@ -5,3 +5,3 @@ import { OAuthUser } from "./user.entity"; | ||
export interface AuthCode { | ||
export interface OAuthAuthCode { | ||
token: string; | ||
@@ -8,0 +8,0 @@ user?: OAuthUser; |
@@ -14,3 +14,3 @@ import crypto from "crypto"; | ||
} from "../repositories"; | ||
import { OAuthAccessToken, AuthCode, OAuthClient, OAuthRefreshToken, OAuthScope } from "../entities"; | ||
import { OAuthAccessToken, OAuthAuthCode, OAuthClient, OAuthRefreshToken, OAuthScope } from "../entities"; | ||
import { RedirectResponse } from "../responses"; | ||
@@ -153,3 +153,3 @@ import { OAuthException } from "../exceptions"; | ||
scopes: OAuthScope[] = [], | ||
): Promise<AuthCode> { | ||
): Promise<OAuthAuthCode> { | ||
const user = userIdentifier ? await this.userRepository.getByUserIdentifier(userIdentifier) : undefined; | ||
@@ -156,0 +156,0 @@ |
@@ -1,7 +0,7 @@ | ||
import { AuthCode, OAuthClient, OAuthScope, OAuthUser } from "../entities"; | ||
import { OAuthAuthCode, OAuthClient, OAuthScope, OAuthUser } from "../entities"; | ||
export interface OAuthAuthCodeRepository { | ||
getNewAuthCode(client: OAuthClient, user: OAuthUser | undefined, scopes: OAuthScope[]): AuthCode; | ||
getNewAuthCode(client: OAuthClient, user: OAuthUser | undefined, scopes: OAuthScope[]): OAuthAuthCode; | ||
persistNewAuthCode(authCode: AuthCode): Promise<AuthCode>; | ||
persistNewAuthCode(authCode: OAuthAuthCode): Promise<OAuthAuthCode>; | ||
@@ -8,0 +8,0 @@ isAuthCodeRevoked(authCodeCode: string): Promise<any>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
480209