-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ruby] Support aliasing of API keys (#8124)
* Allow aliasing of auth keys * update sample and add config for feature * update samples Co-authored-by: William Cheng <[email protected]>
- Loading branch information
Showing
36 changed files
with
2,338 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
generatorName: ruby | ||
outputDir: samples/openapi3/client/extensions/x-auth-id-alias/ruby-client | ||
inputSpec: modules/openapi-generator/src/test/resources/3_0/extensions/x-auth-id-alias.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/ruby-client | ||
additionalProperties: | ||
gemName: x_auth_id_alias | ||
gemVersion: 1.0.0 | ||
moduleName: XAuthIDAlias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Generated by: https://openapi-generator.tech | ||
# | ||
|
||
*.gem | ||
*.rbc | ||
/.config | ||
/coverage/ | ||
/InstalledFiles | ||
/pkg/ | ||
/spec/reports/ | ||
/spec/examples.txt | ||
/test/tmp/ | ||
/test/version_tmp/ | ||
/tmp/ | ||
|
||
## Specific to RubyMotion: | ||
.dat* | ||
.repl_history | ||
build/ | ||
|
||
## Documentation cache and generated files: | ||
/.yardoc/ | ||
/_yardoc/ | ||
/doc/ | ||
/rdoc/ | ||
|
||
## Environment normalization: | ||
/.bundle/ | ||
/vendor/bundle | ||
/lib/bundler/man/ | ||
|
||
# for a library or gem, you might want to ignore these files since the code is | ||
# intended to run in multiple environments; otherwise, check them in: | ||
# Gemfile.lock | ||
# .ruby-version | ||
# .ruby-gemset | ||
|
||
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: | ||
.rvmrc |
23 changes: 23 additions & 0 deletions
23
samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator-ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
20 changes: 20 additions & 0 deletions
20
samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/FILES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.gitignore | ||
.rspec | ||
.rubocop.yml | ||
.travis.yml | ||
Gemfile | ||
README.md | ||
Rakefile | ||
docs/UsageApi.md | ||
git_push.sh | ||
lib/x_auth_id_alias.rb | ||
lib/x_auth_id_alias/api/usage_api.rb | ||
lib/x_auth_id_alias/api_client.rb | ||
lib/x_auth_id_alias/api_error.rb | ||
lib/x_auth_id_alias/configuration.rb | ||
lib/x_auth_id_alias/configuration.rb | ||
lib/x_auth_id_alias/version.rb | ||
spec/api_client_spec.rb | ||
spec/configuration_spec.rb | ||
spec/spec_helper.rb | ||
x_auth_id_alias.gemspec |
1 change: 1 addition & 0 deletions
1
samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5.0.1-SNAPSHOT |
2 changes: 2 additions & 0 deletions
2
samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.rspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--require spec_helper |
148 changes: 148 additions & 0 deletions
148
samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.rubocop.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
# This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) | ||
# Automatically generated by OpenAPI Generator (https://openapi-generator.tech) | ||
AllCops: | ||
TargetRubyVersion: 2.4 | ||
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop | ||
# to ignore them, so only the ones explicitly set in this file are enabled. | ||
DisabledByDefault: true | ||
Exclude: | ||
- '**/templates/**/*' | ||
- '**/vendor/**/*' | ||
- 'actionpack/lib/action_dispatch/journey/parser.rb' | ||
|
||
# Prefer &&/|| over and/or. | ||
Style/AndOr: | ||
Enabled: true | ||
|
||
# Align `when` with `case`. | ||
Layout/CaseIndentation: | ||
Enabled: true | ||
|
||
# Align comments with method definitions. | ||
Layout/CommentIndentation: | ||
Enabled: true | ||
|
||
Layout/ElseAlignment: | ||
Enabled: true | ||
|
||
Layout/EmptyLineAfterMagicComment: | ||
Enabled: true | ||
|
||
# In a regular class definition, no empty lines around the body. | ||
Layout/EmptyLinesAroundClassBody: | ||
Enabled: true | ||
|
||
# In a regular method definition, no empty lines around the body. | ||
Layout/EmptyLinesAroundMethodBody: | ||
Enabled: true | ||
|
||
# In a regular module definition, no empty lines around the body. | ||
Layout/EmptyLinesAroundModuleBody: | ||
Enabled: true | ||
|
||
Layout/FirstArgumentIndentation: | ||
Enabled: true | ||
|
||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. | ||
Style/HashSyntax: | ||
Enabled: false | ||
|
||
# Method definitions after `private` or `protected` isolated calls need one | ||
# extra level of indentation. | ||
Layout/IndentationConsistency: | ||
Enabled: true | ||
EnforcedStyle: indented_internal_methods | ||
|
||
# Two spaces, no tabs (for indentation). | ||
Layout/IndentationWidth: | ||
Enabled: true | ||
|
||
Layout/LeadingCommentSpace: | ||
Enabled: true | ||
|
||
Layout/SpaceAfterColon: | ||
Enabled: true | ||
|
||
Layout/SpaceAfterComma: | ||
Enabled: true | ||
|
||
Layout/SpaceAroundEqualsInParameterDefault: | ||
Enabled: true | ||
|
||
Layout/SpaceAroundKeyword: | ||
Enabled: true | ||
|
||
Layout/SpaceAroundOperators: | ||
Enabled: true | ||
|
||
Layout/SpaceBeforeComma: | ||
Enabled: true | ||
|
||
Layout/SpaceBeforeFirstArg: | ||
Enabled: true | ||
|
||
Style/DefWithParentheses: | ||
Enabled: true | ||
|
||
# Defining a method with parameters needs parentheses. | ||
Style/MethodDefParentheses: | ||
Enabled: true | ||
|
||
Style/FrozenStringLiteralComment: | ||
Enabled: false | ||
EnforcedStyle: always | ||
|
||
# Use `foo {}` not `foo{}`. | ||
Layout/SpaceBeforeBlockBraces: | ||
Enabled: true | ||
|
||
# Use `foo { bar }` not `foo {bar}`. | ||
Layout/SpaceInsideBlockBraces: | ||
Enabled: true | ||
|
||
# Use `{ a: 1 }` not `{a:1}`. | ||
Layout/SpaceInsideHashLiteralBraces: | ||
Enabled: true | ||
|
||
Layout/SpaceInsideParens: | ||
Enabled: true | ||
|
||
# Check quotes usage according to lint rule below. | ||
#Style/StringLiterals: | ||
# Enabled: true | ||
# EnforcedStyle: single_quotes | ||
|
||
# Detect hard tabs, no hard tabs. | ||
Layout/IndentationStyle: | ||
Enabled: true | ||
|
||
# Blank lines should not have any spaces. | ||
Layout/TrailingEmptyLines: | ||
Enabled: true | ||
|
||
# No trailing whitespace. | ||
Layout/TrailingWhitespace: | ||
Enabled: false | ||
|
||
# Use quotes for string literals when they are enough. | ||
Style/RedundantPercentQ: | ||
Enabled: true | ||
|
||
# Align `end` with the matching keyword or starting expression except for | ||
# assignments, where it should be aligned with the LHS. | ||
Layout/EndAlignment: | ||
Enabled: true | ||
EnforcedStyleAlignWith: variable | ||
AutoCorrect: true | ||
|
||
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. | ||
Lint/RequireParentheses: | ||
Enabled: true | ||
|
||
Style/RedundantReturn: | ||
Enabled: true | ||
AllowMultipleReturnValues: true | ||
|
||
Style/Semicolon: | ||
Enabled: true | ||
AllowAsExpressionSeparator: true |
11 changes: 11 additions & 0 deletions
11
samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.travis.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: ruby | ||
cache: bundler | ||
rvm: | ||
- 2.3 | ||
- 2.4 | ||
- 2.5 | ||
script: | ||
- bundle install --path vendor/bundle | ||
- bundle exec rspec | ||
- gem build x_auth_id_alias.gemspec | ||
- gem install ./x_auth_id_alias-1.0.0.gem |
9 changes: 9 additions & 0 deletions
9
samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/Gemfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
source 'https://rubygems.org' | ||
|
||
gemspec | ||
|
||
group :development, :test do | ||
gem 'rake', '~> 13.0.1' | ||
gem 'pry-byebug' | ||
gem 'rubocop', '~> 0.66.0' | ||
end |
Oops, something went wrong.