diff --git a/projects/vdk-plugins/vdk-control-api-auth/.plugin-ci.yml b/projects/vdk-plugins/vdk-control-api-auth/.plugin-ci.yml new file mode 100644 index 0000000000..a890f9556a --- /dev/null +++ b/projects/vdk-plugins/vdk-control-api-auth/.plugin-ci.yml @@ -0,0 +1,34 @@ +# Copyright 2021 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 + +image: "python:3.7" + +# TODO: Uncomment when committing new changes +#.build-vdk-control-api-auth: +# variables: +# PLUGIN_NAME: vdk-control-api-auth +# extends: .build-plugin +# +#build-py37-vdk-control-api-auth: +# extends: .build-vdk-control-api-auth +# image: "python:3.7" +# +# +#build-py38-vdk-control-api-auth: +# extends: .build-vdk-control-api-auth +# image: "python:3.8" +# +# +#build-py39-vdk-control-api-auth: +# extends: .build-vdk-control-api-auth +# image: "python:3.9" +# +#build-py310-vdk-control-api-auth: +# extends: .build-vdk-control-api-auth +# image: "python:3.10" + +# TODO: Uncomment when plugin is ready for release +#release-vdk-control-api-auth: +# variables: +# PLUGIN_NAME: vdk-control-api-auth +# extends: .release-plugin diff --git a/projects/vdk-plugins/vdk-control-api-auth/README.md b/projects/vdk-plugins/vdk-control-api-auth/README.md new file mode 100644 index 0000000000..aded74280a --- /dev/null +++ b/projects/vdk-plugins/vdk-control-api-auth/README.md @@ -0,0 +1,13 @@ +# vdk-control-api-auth + +vdk-control-api-auth is a plugin library that implements authentication +utilities used by vdk-control-cli and other plugins. + +## Usage + +This is a library plugin, not a runnable plugin, and it is intended to be +used as a dependency for other plugins which need to authenticate users. + +## Build and testing + +In order to build and test a plugin go to the plugin directory and use `../build-plugin.sh` script to build it diff --git a/projects/vdk-plugins/vdk-control-api-auth/requirements.txt b/projects/vdk-plugins/vdk-control-api-auth/requirements.txt new file mode 100644 index 0000000000..ee9832996b --- /dev/null +++ b/projects/vdk-plugins/vdk-control-api-auth/requirements.txt @@ -0,0 +1,4 @@ +pytest +vdk-core + +vdk-test-utils diff --git a/projects/vdk-plugins/vdk-control-api-auth/setup.py b/projects/vdk-plugins/vdk-control-api-auth/setup.py new file mode 100644 index 0000000000..7310eb59b8 --- /dev/null +++ b/projects/vdk-plugins/vdk-control-api-auth/setup.py @@ -0,0 +1,44 @@ +# Copyright 2021 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +import pathlib + +import setuptools + +""" +Builds a package with the help of setuptools in order for this package to be imported in other projects + +"plugin-package-template" is the name of the package which contains the plugin/s. + +"plugin-template" is the name of the plugin contained within this package. Note that you can include +more than one plugin in a single package. Also note that the contained plugin may have the same name as the package. + +"plugin_template" is the Python file which contains the plugin hooks for the corresponding plugin. +""" + +__version__ = "0.1.0" + +setuptools.setup( + name="vdk-control-api-auth", + version=__version__, + url="https://github.com/vmware/versatile-data-kit", + description="Versatile Data Kit plugin library provides support for " + "authentication.", + long_description=pathlib.Path("README.md").read_text(), + long_description_content_type="text/markdown", + install_requires=[], + package_dir={"": "src"}, + packages=setuptools.find_namespace_packages(where="src"), + entry_points={ + "vdk.plugin.run": [ + "vdk-control-api-auth = vdk.plugin.control_api_auth.control_api_auth_plugin" + ] + }, + classifiers=[ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + ], +) diff --git a/projects/vdk-plugins/vdk-control-api-auth/src/vdk/plugin/control_api_auth/control_api_auth_plugin.py b/projects/vdk-plugins/vdk-control-api-auth/src/vdk/plugin/control_api_auth/control_api_auth_plugin.py new file mode 100644 index 0000000000..221ba2fe25 --- /dev/null +++ b/projects/vdk-plugins/vdk-control-api-auth/src/vdk/plugin/control_api_auth/control_api_auth_plugin.py @@ -0,0 +1,13 @@ +# Copyright 2021 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0 +from vdk.api.plugin.hook_markers import hookimpl + +""" +Include the plugin hooks here. For example: + +from vdk.internal.core.context import CoreContext + +@hookimpl +def vdk_initialize(context: CoreContext): + pass +""" diff --git a/projects/vdk-plugins/vdk-control-api-auth/tests/test_vdk_auth_plugin.py b/projects/vdk-plugins/vdk-control-api-auth/tests/test_vdk_auth_plugin.py new file mode 100644 index 0000000000..50c007580a --- /dev/null +++ b/projects/vdk-plugins/vdk-control-api-auth/tests/test_vdk_auth_plugin.py @@ -0,0 +1,2 @@ +# Copyright 2021 VMware, Inc. +# SPDX-License-Identifier: Apache-2.0