-
Notifications
You must be signed in to change notification settings - Fork 3
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
I18N-1323 Update Mojito CLI to use OpenAPI spec for rest calls #201
base: master
Are you sure you want to change the base?
Conversation
@@ -173,7 +173,8 @@ public SecurityFilterChain configure(HttpSecurity http) throws Exception { | |||
"/cli/**", | |||
"/js/**", | |||
"/css/**", | |||
"/error") | |||
"/error", | |||
"/v3/api-docs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This endpoint should be open for open api file generation during the integration test phase
<goal>generate</goal> | ||
</goals> | ||
<configuration> | ||
<inputSpec>${project.parent.basedir}/webapp/src/main/resources/openapi.json</inputSpec> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It points to the file generated in the webapp module
20c063b
to
e3582e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a first pass as this is still in WIP.
Left a few questions/comments
cli/src/main/java/com/box/l10n/mojito/cli/apiclient/AuthenticatedApiClient.java
Outdated
Show resolved
Hide resolved
Request request = new Request.Builder().url(url).build(); | ||
this.latestCsrfToken = this.getCsrfToken(httpClient, request); | ||
RequestBody requestBody = | ||
new FormEncodingBuilder().add("username", "admin").add("password", "ChangeMe").build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't be hardcoding usernames and passwords like this? Why is this interceptor required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An interceptor is required to authenticate requests
startAuthenticationFlow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't hard-code the passwords as done here, I'm assuming this is just done as this is a work in progress? The CredentialProvider should be reused here as in the flow you've linked to
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class WsApiConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these new Beans required? Why can't we use the existing *WS.java class endpoints?
cli/src/main/java/com/box/l10n/mojito/cli/apiclient/RepositoryWsApiHelper.java
Outdated
Show resolved
Hide resolved
webapp/src/main/java/com/box/l10n/mojito/service/scheduledjob/ScheduledJobTypeRepository.java
Outdated
Show resolved
Hide resolved
d19a9e9
to
e4ab20f
Compare
Auto-generated code for rest calls
Changed swagger-codegen-maven plugin configuration
Modified dependencies
Modified open API config
Refactor rest client
Refactored user rest calls
Fixed pagination issue
Updated package of the generated code
Refactored some commands
Refactored commit commands
Fixed custom model resolver
Refactored Branch commands
Refactored AI Prompt commands
Refactor AI commands
Addressed PR comments
Refactor commands
Fixed schemas' issues
f2e50fc
to
1818d37
Compare
Refactor other commands
Generate code from open API specification and reuse the generated models and clients