Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ jobs:
id-token: write
env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_CLIENT_ID: ${{ secrets.BW_CLIENT_ID }}
BW_CLIENT_SECRET: ${{ secrets.BW_CLIENT_SECRET }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ concurrency:

env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID || '9900000' }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_CLIENT_ID: ${{ secrets.BW_CLIENT_ID }}
BW_CLIENT_SECRET: ${{ secrets.BW_CLIENT_SECRET }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID || 'abc12345-6def-abc1-2345-6defabc12345' }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID || 'abc12345-6def-abc1-2345-6defabc12345' }}
BW_NUMBER: ${{ secrets.BW_NUMBER || '+19195551234' }}
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ concurrency:
cancel-in-progress: true

env:
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_CLIENT_ID: ${{ secrets.BW_CLIENT_ID }}
BW_CLIENT_SECRET: ${{ secrets.BW_CLIENT_SECRET }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ require 'bandwidth-sdk'

# Setup authorization
Bandwidth.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR_USERNAME'
config.password = 'YOUR_PASSWORD'
# Configure faraday connection
config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }

# Configure OAuth2 access token for authorization: OAuth2
config.access_token = 'YOUR_ACCESS TOKEN'
# Or use your client ID and client secret to obtain an access token
Expand Down Expand Up @@ -384,10 +378,6 @@ Class | Method | HTTP request | Description


Authentication schemes defined for the API:
### Basic

- **Type**: HTTP basic authentication

### OAuth2


Expand Down
31 changes: 12 additions & 19 deletions bandwidth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ info:
email: letstalk@bandwidth.com
version: 1.0.0
security:
- Basic: []
- OAuth2: []
tags:
- name: Messages
Expand Down Expand Up @@ -9309,7 +9308,6 @@ components:
data:
requestId: 004223a0-8b17-41b1-bf81-20732adf5590
status: IN_PROGRESS
results: []
errors: []
lookupInProgressExample:
summary: Numbers Lookup In Progress
Expand Down Expand Up @@ -9482,7 +9480,8 @@ components:
links: []
data: {}
errors:
- type: bad-request
- code: '1234'
type: bad-request
description: >-
Bad Request. Ensure that you have set the requestId as a URL path
parameter.
Expand All @@ -9495,7 +9494,6 @@ components:
- type: Unauthorized
description: You are not authorized to access this resource.
code: '1'
page: null
forbiddenExample:
summary: Forbidden Error
value:
Expand All @@ -9505,14 +9503,14 @@ components:
- type: Forbidden
description: You do not have permission to access this resource.
code: '2'
page: null
unsupportedMediaTypeExample:
summary: Unsupported Media Type Error
value:
links: []
data: {}
errors:
- type: invalid-content-type
- code: '1234'
type: invalid-content-type
description: >-
Invalid content-type. Ensure that your content-type header is set
to application/json.
Expand All @@ -9522,7 +9520,8 @@ components:
links: []
data: {}
errors:
- type: not-found
- code: '1234'
type: not-found
description: >-
RequestId not found. Ensure that the requestId used in the URL
path is valid and maps to a previous request that was submitted.
Expand All @@ -9532,7 +9531,8 @@ components:
links: []
data: {}
errors:
- type: rate-limiting
- code: '1234'
type: rate-limiting
description: >-
Rate limit exceeded. Wait for the time specified in the
Retry-After header before sending another request.
Expand Down Expand Up @@ -10129,19 +10129,12 @@ components:
updateEndpointBxmlRequestExample:
$ref: '#/components/examples/updateEndpointBxmlRequestExample'
securitySchemes:
Basic:
type: http
scheme: basic
description: >-
Basic authentication is a simple authentication scheme built into the
HTTP protocol. To use it, send your HTTP requests with an
`Authorization` header that contains the word `Basic` followed by a
space and a Base64-encoded string `username:password`.


- Example: `Authorization: Basic ZGVtbZpwQDU1dzByZA==`
OAuth2:
type: oauth2
description: >-
OAuth2 client credentials. For information on obtaining credentials, see
[Credentials
Management](https://dev.bandwidth.com/docs/account/credentials/management/).
flows:
clientCredentials:
tokenUrl: https://api.bandwidth.com/api/v1/oauth2/token
Expand Down
27 changes: 16 additions & 11 deletions custom_templates/configuration.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,25 @@ module {{moduleName}}
# config.api_key_prefix['api_key'] = 'Token'
attr_accessor :api_key_prefix

# Defines the username used with HTTP basic authentication.
# HTTP basic authentication is no longer supported. Always nil.
#
# @return [String]
attr_accessor :username
# @return [nil]
attr_reader :username

# Defines the password used with HTTP basic authentication.
# HTTP basic authentication is no longer supported. Always nil.
#
# @return [String]
attr_accessor :password
# @return [nil]
attr_reader :password

# @raise [ArgumentError] HTTP basic authentication is no longer supported
def username=(_username)
raise ArgumentError, 'HTTP basic authentication is no longer supported. Use client_id and client_secret instead.'
end

# @raise [ArgumentError] HTTP basic authentication is no longer supported
def password=(_password)
raise ArgumentError, 'HTTP basic authentication is no longer supported. Use client_id and client_secret instead.'
end

# Defines the client ID used with OAuth2.
#
Expand Down Expand Up @@ -265,11 +275,6 @@ module {{moduleName}}
access_token_getter.call
end

# Gets Basic Auth token string
def basic_auth_token
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
end

{{#authMethods}}
{{#isOAuth}}
# Gets Bearer auth token string
Expand Down
4 changes: 2 additions & 2 deletions custom_templates/gem.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ module {{moduleName}}
class << self
# Customize default settings for the SDK using block.
# {{moduleName}}.configure do |config|
# config.username = "xxx"
# config.password = "xxx"
# config.client_id = "xxx"
# config.client_secret = "xxx"
# end
# If no block given, return the default Configuration object.
def configure
Expand Down
30 changes: 5 additions & 25 deletions docs/CallsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ require 'time'
require 'bandwidth-sdk'
# setup authorization
Bandwidth.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'

# Configure OAuth2 access token for authorization: OAuth2
config.access_token = 'YOUR ACCESS TOKEN'
end
Expand Down Expand Up @@ -78,7 +74,7 @@ end

### Authorization

[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2)
[OAuth2](../README.md#OAuth2)

### HTTP request headers

Expand All @@ -101,10 +97,6 @@ require 'time'
require 'bandwidth-sdk'
# setup authorization
Bandwidth.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'

# Configure OAuth2 access token for authorization: OAuth2
config.access_token = 'YOUR ACCESS TOKEN'
end
Expand Down Expand Up @@ -153,7 +145,7 @@ end

### Authorization

[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2)
[OAuth2](../README.md#OAuth2)

### HTTP request headers

Expand All @@ -176,10 +168,6 @@ require 'time'
require 'bandwidth-sdk'
# setup authorization
Bandwidth.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'

# Configure OAuth2 access token for authorization: OAuth2
config.access_token = 'YOUR ACCESS TOKEN'
end
Expand Down Expand Up @@ -242,7 +230,7 @@ end

### Authorization

[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2)
[OAuth2](../README.md#OAuth2)

### HTTP request headers

Expand All @@ -265,10 +253,6 @@ require 'time'
require 'bandwidth-sdk'
# setup authorization
Bandwidth.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'

# Configure OAuth2 access token for authorization: OAuth2
config.access_token = 'YOUR ACCESS TOKEN'
end
Expand Down Expand Up @@ -318,7 +302,7 @@ nil (empty response body)

### Authorization

[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2)
[OAuth2](../README.md#OAuth2)

### HTTP request headers

Expand All @@ -341,10 +325,6 @@ require 'time'
require 'bandwidth-sdk'
# setup authorization
Bandwidth.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'

# Configure OAuth2 access token for authorization: OAuth2
config.access_token = 'YOUR ACCESS TOKEN'
end
Expand Down Expand Up @@ -397,7 +377,7 @@ nil (empty response body)

### Authorization

[Basic](../README.md#Basic), [OAuth2](../README.md#OAuth2)
[OAuth2](../README.md#OAuth2)

### HTTP request headers

Expand Down
Loading
Loading