diff --git a/types/hapi__bell/hapi__bell-tests.ts b/types/hapi__bell/hapi__bell-tests.ts index febf92039d..e3c493b0c5 100644 --- a/types/hapi__bell/hapi__bell-tests.ts +++ b/types/hapi__bell/hapi__bell-tests.ts @@ -72,16 +72,6 @@ async function run() { clientId: '', clientSecret: '' }, - { - provider: 'office365', - clientId: '', - clientSecret: '', - password: 'cookie_encryption_password_secure', - providerParams: { - response_type: 'code' - }, - scope: ['openid', 'offline_access', 'profile'] - }, { provider: 'okta', config: { uri: 'https://your-organization.okta.com' }, @@ -137,6 +127,7 @@ async function run() { protocol: 'oauth2', scope: ['a', 's', 'd', 'f'], scopeSeparator: '~~~', + pkce: 'S256', async profile(credentials, params, get) { console.log(credentials.provider); console.log(credentials.query); diff --git a/types/hapi__bell/index.d.ts b/types/hapi__bell/index.d.ts index 7da3e09dc5..1946e374e3 100644 --- a/types/hapi__bell/index.d.ts +++ b/types/hapi__bell/index.d.ts @@ -1,21 +1,15 @@ -// Type definitions for @hapi/bell 10.1 +// Type definitions for @hapi/bell 11.0 // Project: https://github.com/hapijs/bell // Definitions by: Simon Schick // Silas Rech // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.8 +// TypeScript Version: 3.1 -import { Server, Request, Plugin, AuthCredentials } from '@hapi/hapi'; +import { AuthMode, Server, Request, Plugin, AuthCredentials } from '@hapi/hapi'; declare module '@hapi/hapi' { interface ServerAuth { strategy(name: string, scheme: 'bell', options: BellOptions): void; - strategy( - name: string, - scheme: 'bell', - mode: boolean | 'required' | 'optional' | 'try', - options: BellOptions, - ): void; } } @@ -25,12 +19,12 @@ export interface StringLikeMap { export type Provider = 'arcgisonline' | 'auth0' | - 'azuread' | + 'azure' | 'bitbucket' | + 'cognito' | 'digitalocean' | 'discord' | 'dropbox' | - 'dropboxV2' | 'facebook' | 'fitbit' | 'foursquare' | @@ -45,7 +39,6 @@ export type Provider = 'meetup' | 'mixer' | 'nest' | - 'office365' | 'okta' | 'phabricator' | 'pingfed' | @@ -262,6 +255,8 @@ export interface CustomProtocol1 extends CustomProtocol { profile: ProfileGetter; } +export type PkceSetting = 'plain' | 'S256'; + export interface CustomProtocol2 extends CustomProtocol { /** * the authorization protocol used. @@ -278,6 +273,11 @@ export interface CustomProtocol2 extends CustomProtocol { */ useParamsAuth?: boolean; + /** + * If specified, uses proof key exchange. + */ + pkce?: PkceSetting; + /** * the scope separator character. Only required when a provider has a broken OAuth 2.0 implementation. Defaults to space (Facebook and GitHub default to comma). */