Skip to content

Added security implementation according OpenAPI 3.1.0 specification#717

Merged
romalytvynenko merged 5 commits intomainfrom
feat/security-specification
Feb 9, 2025
Merged

Added security implementation according OpenAPI 3.1.0 specification#717
romalytvynenko merged 5 commits intomainfrom
feat/security-specification

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