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

New Apache Config Generator for HTTP Basic Authentication #5800

Merged
merged 13 commits into from
Jun 27, 2017
Merged

New Apache Config Generator for HTTP Basic Authentication #5800

merged 13 commits into from
Jun 27, 2017

Conversation

stkrwork
Copy link
Contributor

@stkrwork stkrwork commented Jun 8, 2017

PR checklist

  • Read the contribution guidelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

This is a work in progress implementation for an Apache Configuration Generation for protecting paths in an api. It only generates the location component of the apache configuration, not the whole configuration

stkrwork and others added 10 commits May 30, 2017 16:15
- Added Restbed Generator
Getting latest commits from original
- Added Json processing functions to model
- Removed unnused code from restbed codegen class
- Added response header processing to api template
Changed it to respect alphabetical order
Made the string joining java 7 compatible
Added samples
added missing apache2 config gen in services file
@stkrwork
Copy link
Contributor Author

stkrwork commented Jun 8, 2017

To see that everything works correctly i temporarily chose isOAuth instead of isBasic, to see if the idea works. In the final version, this will be changed to isBasic in the template.

@stkrwork stkrwork changed the title Apacheconfgen Proposed implementation ApacheConfGen for HTTP Basic Authentication Proposed implementation Jun 8, 2017

@Override
public CodegenType getTag() {
return CodegenType.OTHER;
Copy link
Contributor

Choose a reason for hiding this comment

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

What about introducing a new type "CONFIG" instead of using OTHER?

import io.swagger.codegen.DefaultCodegen;
import io.swagger.codegen.SupportingFile;

public class Apache2Confgen extends DefaultCodegen implements CodegenConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about naming the class as "Apache2ConfigCodegen" to make it consistent with other generators (clients, servers, documentations)?

@wing328
Copy link
Contributor

wing328 commented Jun 9, 2017

@stkrwork thanks for the PR. I wonder if you can add the samples under "samples/config/petstore/apache2" so that we can get an idea of what the output looks like.

Alf848 added 2 commits June 11, 2017 21:21
- Added new Config Type
- Added Samples
- Added sample generating scripts
- Renamed Apache2Confgen to Apache2ConfigCodegen
- Added Samples
- Added new config type
- Added sample generating scripts
- Renamed Apache2Confgen to Apache2ConfigCodegen
@stkrwork
Copy link
Contributor Author

The samples are currently generated without the additional properties set.

@wing328 wing328 merged commit 3c0623c into swagger-api:master Jun 27, 2017
@stkrwork stkrwork deleted the apacheconfgen branch June 27, 2017 18:52
@wing328
Copy link
Contributor

wing328 commented Jun 28, 2017

@stkrwork thanks for creating the first config generator for Swagger Codegen 👏 👏 👏

Discussion for future enhancements can be found in #5936

Linked to #5760

@wing328 wing328 changed the title ApacheConfGen for HTTP Basic Authentication Proposed implementation New Apache Config Generator for HTTP Basic Authentication Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants