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

feat: validate boolean inputs #2010

Closed
wants to merge 1 commit into from
Closed

Conversation

lfleischmann
Copy link
Member

Description

Validate boolean inputs instead of assuming all values are valid.

Implementation

Only values that are resolved by strconv.ParseBool without an error are now valid input values.

@FreddyDevelop
Copy link
Contributor

When I try this and use the quickstart app I always get an error at the preflight state when the register_client_capabilities action is used:

{
    "name": "preflight",
    "status": 400,
    "payload": {},
    "csrf_token": "pVj7AjmhgaQvRDbkcCcdZomYrHBJZLWj",
    "actions": {
        "register_client_capabilities": {
            "href": "/login?action=register_client_capabilities%40a3b85827-3a46-4f91-b678-5090e52b6dd9",
            "inputs": {
                "webauthn_available": {
                    "name": "webauthn_available",
                    "type": "boolean",
                    "required": true,
                    "hidden": true,
                    "error": {
                        "code": "value_missing_error",
                        "message": "The value is missing."
                    }
                },
                "webauthn_conditional_mediation_available": {
                    "name": "webauthn_conditional_mediation_available",
                    "type": "boolean",
                    "hidden": true
                },
                "webauthn_platform_authenticator_available": {
                    "name": "webauthn_platform_authenticator_available",
                    "type": "boolean",
                    "hidden": true
                }
            },
            "action": "register_client_capabilities",
            "description": "Send the computers capabilities."
        }
    },
    "error": {
        "code": "form_data_invalid_error",
        "message": "Form data invalid."
    },
    "links": null
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Recently closed
Development

Successfully merging this pull request may close these issues.

2 participants