Skip to content

Security attributes for openAPI documentation #7173

Open
@Bartheyrman22

Description

@Bartheyrman22

Description
Evaluate the security attributes when building the openAPI documentation. This for Resources and Operations.

Example

<?php
// ApiPlatform\OpenApi\Factory\OpenApiFactory

// inside function collectPaths
if (null !== $security = $operation->getSecurity()) {
    $variables = [
        'trust_resolver' => $this->authenticationTrustResolver,
        'auth_checker' => $this->authorizationChecker, // needed for the is_granted expression function
    ];

    $granted = (bool) $this->expressionLanguage->evaluate($security, $variables);
    if (!$granted) {
        continue;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions