chore: Update api-reports

Signed-off-by: Carlos Esteban Lopez <lcarlosesteb@vmware.com>
This commit is contained in:
Carlos Esteban Lopez
2023-11-20 14:28:31 -05:00
parent f3d06de7d8
commit da273b695b
6 changed files with 72 additions and 10 deletions
@@ -0,0 +1,46 @@
## API Report File for "@backstage/plugin-auth-backend-module-vmware-cloud-provider"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { OAuthAuthenticator } from '@backstage/plugin-auth-node';
import { OAuthAuthenticatorResult } from '@backstage/plugin-auth-node';
import { PassportOAuthAuthenticatorHelper } from '@backstage/plugin-auth-node';
import { PassportProfile } from '@backstage/plugin-auth-node';
import { SignInResolverFactory } from '@backstage/plugin-auth-node';
import { Strategy } from 'passport-oauth2';
// @public
const authModuleVmwareCloudProvider: () => BackendFeature;
export default authModuleVmwareCloudProvider;
// @public
export const vmwareCloudAuthenticator: OAuthAuthenticator<
vmwareCloudAuthenticatorContext,
vmwarePassportProfile
>;
// @public (undocumented)
export interface vmwareCloudAuthenticatorContext {
// (undocumented)
helper: PassportOAuthAuthenticatorHelper;
// (undocumented)
organizationId?: string;
// (undocumented)
providerStrategy: Strategy;
}
// @public
export namespace vmwareCloudSignInResolvers {
const profileEmailMatchingUserEntityEmail: SignInResolverFactory<
OAuthAuthenticatorResult<PassportProfile>,
unknown
>;
}
// @public (undocumented)
export type vmwarePassportProfile = PassportProfile & {
organizationId?: string;
};
```
@@ -18,7 +18,7 @@ export interface Config {
auth?: {
providers?: {
/** @visibility frontend */
vmwareCloud?: {
vmwareCloudServices?: {
[authEnv: string]: {
clientId: string;
organizationId: string;
@@ -30,18 +30,22 @@ import {
Strategy as OAuth2Strategy,
} from 'passport-oauth2';
/** @public */
export interface vmwareCloudAuthenticatorContext {
organizationId?: string;
providerStrategy: OAuth2Strategy;
helper: PassportOAuthAuthenticatorHelper;
}
type vmwarePassportProfile = PassportProfile & {
/** @public */
export type vmwarePassportProfile = PassportProfile & {
organizationId?: string;
};
/**
* VMware Cloud Authenticator to be used by `createOAuthProviderFactory`
*
* @public
*/
export const vmwareCloudAuthenticator = createOAuthAuthenticator<
vmwareCloudAuthenticatorContext,
@@ -20,6 +20,10 @@
* @packageDocumentation
*/
export { vmwareCloudAuthenticator } from './authenticator';
export {
vmwareCloudAuthenticator,
type vmwareCloudAuthenticatorContext,
type vmwarePassportProfile,
} from './authenticator';
export { authModuleVmwareCloudProvider as default } from './module';
export { vmwareCloudSignInResolvers } from './resolvers';
@@ -37,6 +37,7 @@ import express from 'express';
import session from 'express-session';
import request from 'supertest';
import { Config } from '../config';
import { authModuleVmwareCloudProvider } from './module';
function isPromise<T>(value: unknown | Promise<T>): value is Promise<T> {
@@ -186,14 +187,14 @@ describe('authModuleVmwareCloudProvider', () => {
},
auth: {
providers: {
vmwareCloud: {
vmwareCloudServices: {
development: {
clientId: 'placeholderClientId',
organizationId: 'orgId',
},
},
},
},
} as Config['auth'],
},
}),
],
@@ -203,13 +204,15 @@ describe('authModuleVmwareCloudProvider', () => {
const agent = request.agent(server);
const res = await agent.get('/api/auth/vmwareCloud/start?env=development');
const res = await agent.get(
'/api/auth/vmwareCloudServices/start?env=development',
);
expect(res.status).toEqual(302);
const nonceCookie = agent.jar.getCookie('vmwareCloud-nonce', {
const nonceCookie = agent.jar.getCookie('vmwareCloudServices-nonce', {
domain: 'localhost',
path: '/api/auth/vmwareCloud/handler',
path: '/api/auth/vmwareCloudServices/handler',
script: false,
secure: false,
});
@@ -221,7 +224,7 @@ describe('authModuleVmwareCloudProvider', () => {
expect(Object.fromEntries(startUrl.searchParams)).toEqual({
response_type: 'code',
client_id: 'placeholderClientId',
redirect_uri: `http://localhost:${server.port()}/api/auth/vmwareCloud/handler/frame`,
redirect_uri: `http://localhost:${server.port()}/api/auth/vmwareCloudServices/handler/frame`,
code_challenge: expect.any(String),
state: expect.any(String),
scope: 'openid offline_access',
@@ -23,6 +23,11 @@ import {
import { vmwareCloudAuthenticator } from './authenticator';
import { vmwareCloudSignInResolvers } from './resolvers';
/**
* VMware Cloud Provider backend module for the auth plugin
*
* @public
*/
export const authModuleVmwareCloudProvider = createBackendModule({
pluginId: 'auth',
moduleId: 'vmware-cloud-provider',
@@ -31,7 +36,7 @@ export const authModuleVmwareCloudProvider = createBackendModule({
deps: { providers: authProvidersExtensionPoint },
async init({ providers }) {
providers.registerProvider({
providerId: 'vmwareCloud',
providerId: 'vmwareCloudServices',
factory: createOAuthProviderFactory({
authenticator: vmwareCloudAuthenticator,
signInResolverFactories: {