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

Api auth required openapi #10971

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/api/Access.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponses;
import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
import org.glassfish.jersey.media.multipart.FormDataParam;
Expand Down Expand Up @@ -1269,6 +1270,7 @@ private String getWebappImageResource(String imageName) {
})
@Tag(name = "saveAuxiliaryFileWithVersion",
description = "Save Auxiliary File With Version")
@SecurityRequirement(name = "api_token")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it "api_token" and not "API token" or "API_Token" or whatever else? Is it arbitrary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that we also have to define the "security schema" and we name that security schema, we also set a type. The security schema could be named something else but in this case api_key is the name

@RequestBody(content = @Content(mediaType = MediaType.MULTIPART_FORM_DATA))
public Response saveAuxiliaryFileWithVersion(@Context ContainerRequestContext crc,
@PathParam("fileId") Long fileId,
Expand Down
Loading