Skip to content

Commit

Permalink
Leveraged B2C signout. Moved AAD/B2C configuration publishing into co…
Browse files Browse the repository at this point in the history
…nfig.json. Added option to override reply URL(s). (#1346)
  • Loading branch information
azaslonov authored Jun 18, 2021
1 parent d2cc124 commit 7553c1a
Show file tree
Hide file tree
Showing 24 changed files with 741 additions and 620 deletions.
578 changes: 193 additions & 385 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
"webpack-merge": "^5.2.0"
},
"dependencies": {
"@paperbits/azure": "0.1.419",
"@paperbits/common": "0.1.419",
"@paperbits/core": "0.1.419",
"@paperbits/prosemirror": "0.1.419",
"@paperbits/styles": "0.1.419",
"@paperbits/azure": "0.1.424",
"@paperbits/common": "0.1.424",
"@paperbits/core": "0.1.424",
"@paperbits/prosemirror": "0.1.424",
"@paperbits/styles": "0.1.424",
"@webcomponents/custom-elements": "1.4.2",
"@webcomponents/shadydom": "^1.7.4",
"adal-vanilla": "^1.0.18",
Expand All @@ -88,9 +88,7 @@
"remark": "^13.0.0",
"remark-html": "^13.0.1",
"saxen": "^8.1.2",
"slick": "^1.12.2",
"topojson-client": "^3.1.0",
"truncate-html": "^1.0.3",
"xhr2": "^0.2.0"
"truncate-html": "^1.0.3"
}
}
4 changes: 4 additions & 0 deletions src/apim.design.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MapiObjectStorage, MapiBlobStorage } from "./persistence";
import { DefaultAuthenticator } from "./components/defaultAuthenticator";
import { IInjector, IInjectorModule } from "@paperbits/common/injection";
import { ConsoleLogger } from "@paperbits/common/logging";
import { DefaultSessionManager } from "@paperbits/common/persistence/defaultSessionManager";
import { ListOfApisModule } from "./components/apis/list-of-apis/ko/listOfApis.module";
import { ListOfApisEditorModule } from "./components/apis/list-of-apis/ko/listOfApisEditor.module";
import { DetailsOfApiModule } from "./components/apis/details-of-api/ko/detailsOfApi.module";
Expand Down Expand Up @@ -61,6 +62,7 @@ import { OldContentRouteGuard } from "./routing/oldContentRouteGuard";
import { AccessTokenRefrsher } from "./authentication/accessTokenRefresher";
import { ApiProductsModule } from "./components/apis/api-products/ko/apiProducts.module";
import { ApiProductsEditorModule } from "./components/apis/api-products/ko/apiProductsEditor.module";
import { RuntimeConfigurator } from "./services/runtimeConfigurator";


export class ApimDesignModule implements IInjectorModule {
Expand Down Expand Up @@ -130,5 +132,7 @@ export class ApimDesignModule implements IInjectorModule {
injector.bindSingleton("oauthService", OAuthService);
injector.bindToCollection("autostart", HistoryRouteHandler);
injector.bindToCollection("autostart", AccessTokenRefrsher);
injector.bindToCollection("autostart", RuntimeConfigurator);
injector.bindSingleton("sessionManager", DefaultSessionManager);
}
}
8 changes: 8 additions & 0 deletions src/apim.publish.module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { AadConfigPublisher } from "./publishing/aadConfigPublisher";
import { IInjector, IInjectorModule } from "@paperbits/common/injection";
import { ConsoleLogger } from "@paperbits/common/logging";
import { MapiClient } from "./services/mapiClient";
Expand Down Expand Up @@ -33,6 +34,8 @@ import { StaticRoleService } from "./services/roleService";
import { ProvisionService } from "./services/provisioningService";
import { OAuthService } from "./services/oauthService";
import { ApiProductsModule } from "./components/apis/api-products/ko/apiProducts.module";
import { RuntimeConfigPublisher } from "./publishing/runtimeConfigPublisher";
import { RuntimeConfigBuilder } from "./publishing/runtimeConfigBuilder";

export class ApimPublishModule implements IInjectorModule {
public register(injector: IInjector): void {
Expand Down Expand Up @@ -71,5 +74,10 @@ export class ApimPublishModule implements IInjectorModule {
injector.bindSingleton("blobStorage", MapiBlobStorage);
injector.bindSingleton("logger", ConsoleLogger);
injector.bindSingleton("oauthService", OAuthService);

injector.bindSingleton("runtimeConfigBuilder", RuntimeConfigBuilder);
injector.bindToCollection("publishers", AadConfigPublisher);
injector.bindToCollection("publishers", RuntimeConfigPublisher);

}
}
112 changes: 57 additions & 55 deletions src/apim.runtime.module.ts
Original file line number Diff line number Diff line change
@@ -1,80 +1,82 @@
import "./polyfills";
import "./bindingHandlers/scrollintoview";
import "./bindingHandlers/copyToClipboard";
import "./bindingHandlers/syntaxHighlight";
import "./bindingHandlers/markdown";
import "./bindingHandlers/barChart";
import "./bindingHandlers/mapChart";
import "./bindingHandlers/minMaxAvgChart";
import "./bindingHandlers/acceptChange";
import "./bindingHandlers/tab";
import "@paperbits/core/ko/bindingHandlers/bindingHandlers.activate";
import "@paperbits/core/ko/bindingHandlers/bindingHandlers.component";
import "@paperbits/core/ko/bindingHandlers/bindingHandlers.dialog";
import "@paperbits/core/ko/bindingHandlers/bindingHandlers.focus";
import "@paperbits/core/ko/bindingHandlers/bindingHandlers.activate";
import "@paperbits/core/ko/bindingHandlers/bindingHandlers.scrollable";
import "@paperbits/core/ko/bindingHandlers/bindingHandlers.dialog";
import { RouteHelper } from "./routing/routeHelper";
import { IInjector, IInjectorModule } from "@paperbits/common/injection";
import { DefaultSettingsProvider } from "@paperbits/common/configuration";
import { IInjector, IInjectorModule } from "@paperbits/common/injection";
import { ConsoleLogger } from "@paperbits/common/logging";
import { ApiList, ApiListDropdown, ApiListTiles } from "./components/apis/list-of-apis/ko/runtime";
import { ApiService } from "./services/apiService";
import { TagService } from "./services/tagService";
import { TenantService } from "./services/tenantService";
import { AnalyticsService } from "./services/analyticsService";
import { DefaultSessionManager } from "@paperbits/common/persistence/defaultSessionManager";
import { ViewStack } from "@paperbits/common/ui/viewStack";
import { BalloonBindingHandler, ResizableBindingHandler } from "@paperbits/core/ko/bindingHandlers";
import "./bindingHandlers/acceptChange";
import "./bindingHandlers/barChart";
import "./bindingHandlers/copyToClipboard";
import "./bindingHandlers/mapChart";
import "./bindingHandlers/markdown";
import "./bindingHandlers/minMaxAvgChart";
import "./bindingHandlers/scrollintoview";
import "./bindingHandlers/syntaxHighlight";
import "./bindingHandlers/tab";
import { ApiProducts } from "./components/apis/api-products/ko/runtime/api-products";
import { ApiProductsTiles } from "./components/apis/api-products/ko/runtime/api-products-tiles";
import { ApiDetails } from "./components/apis/details-of-api/ko/runtime/api-details";
import { ApiHistory } from "./components/apis/history-of-api/ko/runtime/api-history";
import { OperationDetails } from "./components/operations/operation-details/ko/runtime/operation-details";
import { OperationConsole } from "./components/operations/operation-details/ko/runtime/operation-console";
import { ProductService } from "./services/productService";
import { FileInput } from "./components/file-input/file-input";
import { MapiClient } from "./services/mapiClient";
import { UsersService } from "./services/usersService";
import { Signin } from "./components/users/signin/ko/runtime/signin";
import { SignInAad } from "./components/users/signin-social/ko/runtime/signin-aad";
import { SignInAadB2C } from "./components/users/signin-social/ko/runtime/signin-aad-b2c";
import { Signup } from "./components/users/signup/ko/runtime/signup";
import { SignupSocial } from "./components/users/signup-social/ko/runtime/signup-social";
import { Profile } from "./components/users/profile/ko/runtime/profile";
import { Subscriptions } from "./components/users/subscriptions/ko/runtime/subscriptions";
import { ProductList } from "./components/products/product-list/ko/runtime/product-list";
import { ProductDetails } from "./components/products/product-details/ko/runtime/product-details";
import { ProductSubscribe } from "./components/products/product-subscribe/ko/runtime/product-subscribe";
import { ApiList, ApiListDropdown, ApiListTiles } from "./components/apis/list-of-apis/ko/runtime";
import { DefaultAuthenticator } from "./components/defaultAuthenticator";
import { FileInput } from "./components/file-input/file-input";
import { CodeSampleViewModel } from "./components/operations/operation-details/ko/runtime/code-sample";
import { OperationConsole } from "./components/operations/operation-details/ko/runtime/operation-console";
import { OperationDetails } from "./components/operations/operation-details/ko/runtime/operation-details";
import { TypeDefinitionViewModel } from "./components/operations/operation-details/ko/runtime/type-definition";
import { OperationList } from "./components/operations/operation-list/ko/runtime/operation-list";
import { ProductApis } from "./components/products/product-apis/ko/runtime/product-apis";
import { ProductApisTiles } from "./components/products/product-apis/ko/runtime/product-apis-tiles";
import { OperationList } from "./components/operations/operation-list/ko/runtime/operation-list";
import { ProductDetails } from "./components/products/product-details/ko/runtime/product-details";
import { ProductList } from "./components/products/product-list/ko/runtime/product-list";
import { ProductListDropdown } from "./components/products/product-list/ko/runtime/product-list-dropdown";
import { ProductListTiles } from "./components/products/product-list/ko/runtime/product-list-tiles";
import { ProductSubscribe } from "./components/products/product-subscribe/ko/runtime/product-subscribe";
import { ProductSubscriptions } from "./components/products/product-subscriptions/ko/runtime/product-subscriptions";
import { AadService } from "./services/aadService";
import { BackendService } from "./services/backendService";
import { HipCaptcha } from "./components/users/runtime/hip-captcha/hip-captcha";
import { ResetPassword } from "./components/users/reset-password/ko/runtime/reset-password";
import { ConfirmPassword } from "./components/users/confirm-password/ko/runtime/confirm-password";
import { ChangePassword } from "./components/users/change-password/ko/runtime/change-password";
import { Reports } from "./components/reports/ko/runtime/reports";
import { UnhandledErrorHandler } from "./errors/unhandledErrorHandler";
import { ProductListDropdown } from "./components/products/product-list/ko/runtime/product-list-dropdown";
import { TagInput } from "./components/tag-input/tag-input";
import { ChangePassword } from "./components/users/change-password/ko/runtime/change-password";
import { ConfirmPassword } from "./components/users/confirm-password/ko/runtime/confirm-password";
import { Profile } from "./components/users/profile/ko/runtime/profile";
import { ResetPassword } from "./components/users/reset-password/ko/runtime/reset-password";
import { HipCaptcha } from "./components/users/runtime/hip-captcha/hip-captcha";
import { SignInAad } from "./components/users/signin-social/ko/runtime/signin-aad";
import { SignInAadB2C } from "./components/users/signin-social/ko/runtime/signin-aad-b2c";
import { Signin } from "./components/users/signin/ko/runtime/signin";
import { SignupSocial } from "./components/users/signup-social/ko/runtime/signup-social";
import { Signup } from "./components/users/signup/ko/runtime/signup";
import { Subscriptions } from "./components/users/subscriptions/ko/runtime/subscriptions";
import { ValidationSummary } from "./components/users/validation-summary/ko/runtime/validation-summary";
import { TypeDefinitionViewModel } from "./components/operations/operation-details/ko/runtime/type-definition";
import { CodeSampleViewModel } from "./components/operations/operation-details/ko/runtime/code-sample";
import { StaticUserService } from "./services";
import { UnhandledErrorHandler } from "./errors/unhandledErrorHandler";
import "./polyfills";
import { AadSignOutRouteGuard } from "./routing/aadSignoutRouteGuard";
import { RouteHelper } from "./routing/routeHelper";
import { SignOutRouteGuard } from "./routing/signOutRouteGuard";
import { ProvisionService } from "./services/provisioningService";
import { BalloonBindingHandler, ResizableBindingHandler } from "@paperbits/core/ko/bindingHandlers";
import { TagInput } from "./components/tag-input/tag-input";
import { ViewStack } from "@paperbits/common/ui/viewStack";
import { StaticUserService } from "./services";
import { AadService } from "./services/aadService";
import { AnalyticsService } from "./services/analyticsService";
import { ApiService } from "./services/apiService";
import { BackendService } from "./services/backendService";
import { MapiClient } from "./services/mapiClient";
import { OAuthService } from "./services/oauthService";
import { DefaultSessionManager } from "./authentication/defaultSessionManager";
import { ApiProducts } from "./components/apis/api-products/ko/runtime/api-products";
import { ApiProductsTiles } from "./components/apis/api-products/ko/runtime/api-products-tiles";
import { ProductListTiles } from "./components/products/product-list/ko/runtime/product-list-tiles";
import { ProductService } from "./services/productService";
import { ProvisionService } from "./services/provisioningService";
import { TagService } from "./services/tagService";
import { TenantService } from "./services/tenantService";
import { UsersService } from "./services/usersService";

export class ApimRuntimeModule implements IInjectorModule {
public register(injector: IInjector): void {
injector.bindSingleton("logger", ConsoleLogger);
injector.bindToCollection("autostart", UnhandledErrorHandler);
injector.bindToCollection("autostart", BalloonBindingHandler);
injector.bindToCollection("autostart", ResizableBindingHandler);
injector.bindToCollection("routeGuards", AadSignOutRouteGuard);
injector.bindToCollection("routeGuards", SignOutRouteGuard);
injector.bind("apiList", ApiList);
injector.bind("apiListDropdown", ApiListDropdown);
Expand Down
21 changes: 0 additions & 21 deletions src/authentication/defaultSessionManager.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/authentication/sessionManager.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import * as ko from "knockout";
import * as validation from "knockout.validation";
import template from "./operation-console.html";
import { HttpClient, HttpRequest, HttpResponse } from "@paperbits/common/http";
import { Component, Param, OnMounted } from "@paperbits/common/ko/decorators";
import { ISettingsProvider } from "@paperbits/common/configuration";
import { Operation } from "../../../../../models/operation";
import { ApiService } from "../../../../../services/apiService";
import { ConsoleOperation } from "../../../../../models/console/consoleOperation";
import { HttpClient, HttpRequest, HttpResponse } from "@paperbits/common/http";
import { Component, OnMounted, Param } from "@paperbits/common/ko/decorators";
import { SessionManager } from "@paperbits/common/persistence/sessionManager";
import { ServiceSkuName, TypeOfApi } from "../../../../../constants";
import { SubscriptionState } from "../../../../../contracts/subscription";
import { UnauthorizedError } from "../../../../../errors/unauthorizedError";
import { Api } from "../../../../../models/api";
import { AuthorizationServer } from "../../../../../models/authorizationServer";
import { ConsoleHeader } from "../../../../../models/console/consoleHeader";
import { Utils } from "../../../../../utils";
import { ConsoleOperation } from "../../../../../models/console/consoleOperation";
import { ConsoleParameter } from "../../../../../models/console/consoleParameter";
import { KnownHttpHeaders } from "../../../../../models/knownHttpHeaders";
import { Api } from "../../../../../models/api";
import { KnownStatusCodes } from "../../../../../models/knownStatusCodes";
import { Operation } from "../../../../../models/operation";
import { Product } from "../../../../../models/product";
import { ProductService } from "../../../../../services/productService";
import { UsersService } from "../../../../../services/usersService";
import { TenantService } from "../../../../../services/tenantService";
import { ServiceSkuName, TypeOfApi } from "../../../../../constants";
import { Revision } from "../../../../../models/revision";
import { templates } from "./templates/templates";
import { ConsoleParameter } from "../../../../../models/console/consoleParameter";
import { SubscriptionState } from "../../../../../contracts/subscription";
import { RouteHelper } from "../../../../../routing/routeHelper";
import { TemplatingService } from "../../../../../services/templatingService";
import { ApiService } from "../../../../../services/apiService";
import { OAuthService } from "../../../../../services/oauthService";
import { AuthorizationServer } from "../../../../../models/authorizationServer";
import { SessionManager } from "../../../../../authentication/sessionManager";
import { OAuthSession, StoredCredentials } from "./oauthSession";
import { UnauthorizedError } from "../../../../../errors/unauthorizedError";
import { ProductService } from "../../../../../services/productService";
import { TemplatingService } from "../../../../../services/templatingService";
import { TenantService } from "../../../../../services/tenantService";
import { UsersService } from "../../../../../services/usersService";
import { Utils } from "../../../../../utils";
import { GrantTypes } from "./../../../../../constants";
import { OAuthSession, StoredCredentials } from "./oauthSession";
import template from "./operation-console.html";
import { ResponsePackage } from "./responsePackage";
import { templates } from "./templates/templates";
import { LogItem, WebsocketClient } from "./websocketClient";

const oauthSessionKey = "oauthSession";
Expand Down
Loading

0 comments on commit 7553c1a

Please sign in to comment.