Skip to content

Commit

Permalink
Merge pull request #9 from ayeshLK/client_gen
Browse files Browse the repository at this point in the history
Add security schemas to the Guidewire InsuranceNow client
  • Loading branch information
ayeshLK committed Mar 27, 2024
2 parents 3148d4e + b0e3b6c commit c848eb0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ballerina/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public isolated client class Client {
# + config - The configurations to be used when initializing the `connector`
# + serviceUrl - URL of the target service
# + return - An error if connector initialization failed
public isolated function init(string serviceUrl, ConnectionConfig config = {}) returns error? {
http:ClientConfiguration httpClientConfig = {httpVersion: config.httpVersion, timeout: config.timeout, forwarded: config.forwarded, poolConfig: config.poolConfig, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, validation: config.validation};
public isolated function init(ConnectionConfig config, string serviceUrl) returns error? {
http:ClientConfiguration httpClientConfig = {auth: config.auth, httpVersion: config.httpVersion, timeout: config.timeout, forwarded: config.forwarded, poolConfig: config.poolConfig, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, validation: config.validation};
do {
if config.http1Settings is ClientHttp1Settings {
ClientHttp1Settings settings = check config.http1Settings.ensureType(ClientHttp1Settings);
Expand Down
2 changes: 2 additions & 0 deletions ballerina/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import ballerina/http;
# Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
@display {label: "Connection Config"}
public type ConnectionConfig record {|
# Configurations related to client authentication
http:BearerTokenConfig|http:CredentialsConfig auth;
# The HTTP version understood by the client
http:HttpVersion httpVersion = http:HTTP_2_0;
# Configurations related to HTTP/1.x protocol
Expand Down
11 changes: 11 additions & 0 deletions docs/spec/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3788,3 +3788,14 @@ components:
required:
- code
- message
securitySchemes:
BasicAuth:
type: http
scheme: basic
BearerAuth:
type: http
scheme: bearer

security:
- BasicAuth: []
- BearerAuth: []

0 comments on commit c848eb0

Please sign in to comment.