Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credentials for Plugins need to be handled separately #17

Open
sameersegal opened this issue Jul 26, 2024 · 0 comments
Open

Credentials for Plugins need to be handled separately #17

sameersegal opened this issue Jul 26, 2024 · 0 comments

Comments

@sameersegal
Copy link
Collaborator

At the moment plugin credentials are passed as inputs. But we should segregate credentials from inputs in a plugin call.

Instead of this:

{
            "task_type": "plugin",
            "name": "submit_details_to_api_task",
            "read_variables": [
                "user_name",
                "user_email",
                "user_mobile_number",
                "user_address"
            ],
            "environment_variables": [
                "API_ENDPOINT",
                "CLIENT_ID",
                "CLIENT_SECRET"
            ],
            "write_variables": [
                "SUBMISSION_STATUS"
            ],
            "plugin": {
                "name": "data_submission",
                "inputs": {
                    "NAME": "user_name",
                    "EMAIL": "user_email",
                    "MOBILE_NUMBER": "user_mobile_number",
                    "ADDRESS": "user_address",
                    "API_ENDPOINT": "API_ENDPOINT",
                    "CLIENT_ID": "CLIENT_ID",
                    "CLIENT_SECRET": "CLIENT_SECRET"
                },
                "outputs": {
                    "SUBMISSION_STATUS": "SUBMISSION_STATUS"
                }
            },
            "description": "Submitting the collected user details to the API.",
            "transitions": [
                {
                    "code": "SUCCESS",
                    "goto": "submission_success_task",
                    "description": "Data was successfully submitted."
                },
                {
                    "code": "INVALID_DATA",
                    "goto": "submission_invalid_data_task",
                    "description": "The provided data is invalid. Please re-enter."
                },
            ]
        },

Do this:
Instead of this:

{
            "task_type": "plugin",
            "name": "submit_details_to_api_task",
            "read_variables": [
                "user_name",
                "user_email",
                "user_mobile_number",
                "user_address"
            ],
            "environment_variables": [
                "API_ENDPOINT",
                "CLIENT_ID",
                "CLIENT_SECRET"
            ],
            "write_variables": [
                "SUBMISSION_STATUS"
            ],
            "plugin": {
                "name": "data_submission",
                "environment_variables": {
                    "API_ENDPOINT": "API_ENDPOINT",
                    "CLIENT_ID": "CLIENT_ID",
                    "CLIENT_SECRET": "CLIENT_SECRET"
                }
                "inputs": {
                    "NAME": "user_name",
                    "EMAIL": "user_email",
                    "MOBILE_NUMBER": "user_mobile_number",
                    "ADDRESS": "user_address"
                },
                "outputs": {
                    "SUBMISSION_STATUS": "SUBMISSION_STATUS"
                }
            },
            "description": "Submitting the collected user details to the API.",
            "transitions": [
                {
                    "code": "SUCCESS",
                    "goto": "submission_success_task",
                    "description": "Data was successfully submitted."
                },
                {
                    "code": "INVALID_DATA",
                    "goto": "submission_invalid_data_task",
                    "description": "The provided data is invalid. Please re-enter."
                },
            ]
        },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant