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

Added security implementation according OpenAPI 3.1.0 specification #717

Merged
merged 5 commits into from
Feb 9, 2025

Conversation

romalytvynenko
Copy link
Member

@romalytvynenko romalytvynenko commented Feb 9, 2025

This would allow defining all the security rules that allowed by OpenAPI 3.1.0 specification.

For example, the specification allows defining auth methods that require few headers which previously was not possible in Scramble.

Now it becomes possible:

Scramble::configure()
    ->withDocumentTransformers(function (OpenApi $openApi) {
        $openApi->components->securitySchemes['tenant'] = SecurityScheme::apiKey('header', 'X-Tenant');
        $openApi->components->securitySchemes['bearer'] = SecurityScheme::http('bearer');

        $openApi->security[] = new SecurityRequirement([
            'tenant' => [],
            'bearer' => [],
        ]);
    });

@romalytvynenko romalytvynenko force-pushed the feat/security-specification branch from 516517e to 3624b21 Compare February 9, 2025 14:02
@romalytvynenko romalytvynenko changed the title security implementation according OpenAPI 3.1.0 specification Added security implementation according OpenAPI 3.1.0 specification Feb 9, 2025
@romalytvynenko romalytvynenko merged commit 88314d2 into main Feb 9, 2025
13 checks passed
@romalytvynenko romalytvynenko deleted the feat/security-specification branch February 9, 2025 16:04
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

Successfully merging this pull request may close these issues.

1 participant