Okta VSCode ExtensionOkta-ExplorerPurposeProvide Application Developers, Dev Ops Administrators and OIN Partners a way to sign up for an Okta developer account and manage their Okta applications from within Visual Studio Code, see https://code.visualstudio.com/. Installation
Sign Up
Create Application
View Application
Edit Application
Auto SaveBecause you can let VSCode save after every x milliseconds or so or save when the editor loses focus or when the window loses focus, the state of the configuration file may not be valid when a save occurs which results in errors returned by the server. To avoid excessive calls to the server, and to avoid submitting invalid configurations, it may be desirable to disable Auto Save while editing application configurations in Okta-Explorer. PersonasThe Visual Studio Code extension targets three primary personas as its audience. Dev Ops Administrators - coordinates the work between software and operation teams. They set up processes and tools to help teams work efficiently. Application Developer - responsible for creating, developing and modifying source code for software applications. They design and implement software that fulfills use case scenarios defined by a project team. Integration Application Developer (OIN Partners) - responsible for adding new integrations to Okta in their SaaS application for submission to the OIN. User StoriesAs a Dev Ops Administrator or Application Developer, I want to sign up for an Okta developer account. As a Dev Ops Administrator or Application Developer, I want to create a new Okta application from within the Visual Studio Code integrated development environment. As a Dev Ops Administrator or Application Developer, I want to review an applications configuration in json or yaml format from within the Visual Studio Code integrated development environment. As a Dev Ops Administrator or Application Developer, I want to update an applications configuration by editing and saving its json or yaml file representation from within the Visual Studio Code integrated development environment. As a Dev Ops Administrator or Application Developer, I want to delete an application from within the Visual Studio Code integrated development environment. As an Application Developer, I want to create a new local application project that is automatically configured with Okta authentication from within the Visual Studio Code integrated development environment. Visual Studio Code Contribution PointsTo add custom user interface elements to Visual Studio Code, extension authors define a contributes node in package.json. For further information about Visual Studio Code contribution points, see https://code.visualstudio.com/api/references/contribution-points. The following json segment shows the contributes node of the Okta Visual Studio Code Integration.
ArchitectureThe top level composition class is OktaExplorer which is composed of OktaTreeDataProviderThe OktaTreeDataProvider provides data that is displayed in the tree view in Visual Studio Code. It is an implementation of the interface TreeDataProvider provided by Visual Studio Code. Internally it uses an OktaDataProvider to make Okta API calls. See, https://github.com/bryanapellanes-okta/okta-vscode-extension/tree/v1_main/okta-explorer/src/classes/oktaTreeDataProvider.ts#L11. OktaSignUpProviderThe OktaSignUpProvider is responsible for signing a user up for an Okta developer organization. It is composed of DotNetInfo, ExtensionConfig, ApiConfig, OktaDataProvider, OktaWizardInstaller , OktaTerminal and a Logger. See, https://github.com/bryanapellanes-okta/okta-vscode-extension/tree/v1_main/okta-explorer/src/classes/injectables/oktaSignUpProvider.ts#L20. OktaEditorThe OktaEditor is responsible for displaying application configuration as editable yaml or json files which are ultimately synchronized with the backing Okta organization. It is composed of ExtensionConfig, SyncedDataCache, DataSyncProvider, WorkspaceFolderProvider, DataTemplateManager, Notifier and a Logger. See, https://github.com/bryanapellanes-okta/okta-vscode-extension/tree/v1_main/okta-explorer/src/classes/oktaEditor.ts#L25. Composition ComponentsThe following are the components that constitute the top level composition classes.
Custom TemplatesIn addition to the default templates included with the Okta VSCode Exension, custom templates can be loaded from the file system. When the pick list is presented to create a new application, custom templates are presented along with the default templates. For a custom template to be displayed it must be saved to the .okta/data-templates/application/ folder in the VSCode workspace. The file must contain either json or yaml of an application configuration:
The value OnCreateTo facilitate project initialization, a command can be specified in an onCreate node of a custom template. When using onCreate the application data should be specified as the data node:
When a template that has an onCreate node defined is used, the Okta VSCode Extension runs the specified command after creating the application in the Okta organization. Dependency InjectionTo aide in adherence to best practice and SOLID principles, Okta VSCode Extension uses InversifyJS for dependency injection and inversion of control. See binding definitions, https://github.com/bryanapellanes-okta/okta-vscode-extension/tree/v1_main/okta-explorer/src/containers/releaseContainer.ts#L48-L74. References |