Skip to content

Commit

Permalink
Added optional shared key authentication for BPP Webhook communication
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek Y authored and Abhishek Y committed Jun 26, 2024
1 parent adaa914 commit 041caa4
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 151 deletions.
30 changes: 16 additions & 14 deletions config/config-sample-client-localhost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ responseCache:
# 2. webhook
# 3. pubSub
client:
synchronous:
synchronous:
mongoURL: "mongodb://127.0.0.1:27017/protocolserver-v2-response-cache"

#webhook:
# url: "https://beckn.free.beeceptor.com/clientURL"
#messageQueue:

#messageQueue:
# amqpURL: "amqp://guest:guest@localhost:5672"
# incomingQueue: "protocol-server-incoming"
# outgoingQueue: "protocol-server-outgoing"
Expand All @@ -49,25 +49,24 @@ app:
actions:
requests:
search:
ttl : "PT10S"
ttl: "PT10S"
init:
ttl : "PT10S"
ttl: "PT10S"
select:
ttl : "PT10S"
ttl: "PT10S"
confirm:
ttl : "PT10S"
ttl: "PT10S"
status:
ttl: "PT10S"
get_cancellation_reasons:
ttl: "PT10S"
get_rating_categories:
ttl: "PT10S"


responses:

responses:
on_search:
ttl: "PT10S"

on_init:
ttl: "PT10S"
on_select:
Expand All @@ -80,20 +79,20 @@ app:
ttl: "PT10S"
rating_categories:
ttl: "PT10S"

# Mandatory.
privateKey: "private key"
publicKey: "public key"

# Mandatory.
subscriberId: "dev.bap.faiz.protocol-server.com.dsep:jobs.BAP"
subscriberUri: "https://410e-45-248-79-20.ngrok.io/"

# Mandatory.
registryUrl: https://registry.becknprotocol.io/subscribers
auth: false
uniqueKey: "dev.bap.faiz.protocol-server.key"

# Mandatory.
city: "std:080"
country: "IND"
Expand All @@ -111,3 +110,6 @@ app:
# In minutes
syncInterval: 30
redis_db: 3

useHMACForWebhook: false
sharedKeyForWebhookHMAC: ""
31 changes: 17 additions & 14 deletions config/config-sample-network-localhost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ responseCache:
# 2. webhook
# 3. pubSub
client:
synchronous:
synchronous:
mongoURL: "mongodb://127.0.0.1:27017/protocolserver-v2-response-cache"

#webhook:
# url: "https://beckn.free.beeceptor.com/clientURL"
#messageQueue:

#messageQueue:
# amqpURL: "amqp://guest:guest@localhost:5672"
# incomingQueue: "protocol-server-incoming"
# outgoingQueue: "protocol-server-outgoing"
Expand All @@ -49,24 +49,24 @@ app:
actions:
requests:
search:
ttl : "PT10S"
ttl: "PT10S"
init:
ttl : "PT10S"
ttl: "PT10S"
select:
ttl : "PT10S"
ttl: "PT10S"
confirm:
ttl : "PT10S"
ttl: "PT10S"
status:
ttl : "PT10S"
ttl: "PT10S"
get_cancellation_reasons:
ttl: "PT10S"
get_rating_categories:
ttl: "PT10S"
responses:

responses:
on_search:
ttl: "PT10S"

on_init:
ttl: "PT10S"
on_select:
Expand All @@ -79,20 +79,20 @@ app:
ttl: "PT10S"
rating_categories:
ttl: "PT10S"

# Mandatory.
privateKey: "private key"
publicKey: "public key"

# Mandatory.
subscriberId: "dev.bap.faiz.protocol-server.com.dsep:jobs.BAP"
subscriberUri: "https://410e-45-248-79-20.ngrok.io/"

# Mandatory.
registryUrl: https://registry.becknprotocol.io/subscribers
auth: true
uniqueKey: "dev.bap.faiz.protocol-server.key"

# Mandatory.
city: "std:080"
country: "IND"
Expand All @@ -110,3 +110,6 @@ app:
# In minutes
syncInterval: 30
redis_db: 3

useHMACForWebhook: false
sharedKeyForWebhookHMAC: ""
25 changes: 14 additions & 11 deletions config/config-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ responseCache:
# 2. webhook
# 3. pubSub
client:
synchronous:
synchronous:
mongoURL: "mongodb://tvast:password@localhost:27017/protocol_server-v2?authSource=admin"

webhook:
url: "https://beckn.free.beeceptor.com/clientURL"
messageQueue:

messageQueue:
amqpURL: "amqp://guest:guest@localhost:5672"
incomingQueue: "protocol-server-incoming"
outgoingQueue: "protocol-server-outgoing"
Expand All @@ -49,30 +49,30 @@ app:
actions:
requests:
search:
ttl : "PT10S"
ttl: "PT10S"
init:
ttl : "PT10S"
responses:
ttl: "PT10S"

responses:
on_search:
ttl: "PT10S"

on_init:
ttl: "PT10S"

# Mandatory.
privateKey: "your private key"
publicKey: "your public key"

# Mandatory.
subscriberId: "dev.bap.protocol-server.com"
subscriberUri: "https://ayush.free.beeceptor.com/"

# Mandatory.
registryUrl: https://registry.becknprotocol.io/subscribers
auth: true
uniqueKey: "dev.bap.protocol-server.key"

# Mandatory.
city: "std:080"
country: "IND"
Expand All @@ -90,3 +90,6 @@ app:
# In minutes
syncInterval: 30
redis_db: 3

useHMACForWebhook: false
sharedKeyForWebhookHMAC: ""
25 changes: 14 additions & 11 deletions config/new-config-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ responseCache:
# 2. webhook
# 3. pubSub
client:
synchronous:
synchronous:
mongoURL: "mongodb://tvast:password@localhost:27017/protocol_server-v2?authSource=admin"

webhook:
url: "https://beckn.free.beeceptor.com/clientURL"
messageQueue:

messageQueue:
amqpUrl: "amqp://guest:guest@localhost:5672"
request-queue: "bap-protocol-server"
response-queue: "bap-protocol-client"
Expand All @@ -50,30 +50,30 @@ app:
actions:
requests:
search:
ttl : "PT10S"
ttl: "PT10S"
init:
ttl : "PT10S"
responses:
ttl: "PT10S"

responses:
on_search:
ttl: "PT10S"

on_init:
ttl: "PT10S"

# Mandatory.
privateKey: "your private key"
publicKey: "your public key"

# Mandatory.
subscriberId: "dev.bap.protocol-server.com"
subscriberUri: "https://ayush.free.beeceptor.com/"

# Mandatory.
registryUrl: https://registry.becknprotocol.io/subscribers
auth: true
uniqueKey: "dev.bap.protocol-server.key"

# Mandatory.
city: "std:080"
country: "IND"
Expand All @@ -91,3 +91,6 @@ app:
# In minutes
syncInterval: 30
redis_db: 3

useHMACForWebhook: false
sharedKeyForWebhookHMAC: ""
43 changes: 23 additions & 20 deletions config/samples/bap-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ responseCache:
# 2. webhook
# 3. pubSub
client:
synchronous:
synchronous:
mongoURL: "mongodb://MONGO_USERNAME:MONGO_PASSWORD@MONOG_URL:27017/MONGO_DB_NAME?authSource=admin"

#webhook:
# url: "https://beckn.free.beeceptor.com/clientURL"
#messageQueue:

#messageQueue:
# amqpURL: "amqp://guest:guest@localhost:5672"
# incomingQueue: "protocol-server-incoming"
# outgoingQueue: "protocol-server-outgoing"
Expand All @@ -49,33 +49,33 @@ app:
actions:
requests:
search:
ttl : "PT15S"
ttl: "PT15S"
init:
ttl : "PT10S"
ttl: "PT10S"
select:
ttl : "PT10S"
ttl: "PT10S"
confirm:
ttl : "PT10S"
ttl: "PT10S"
status:
ttl : "PT10S"
ttl: "PT10S"
track:
ttl : "PT10S"
ttl: "PT10S"
cancel:
ttl : "PT10S"
ttl: "PT10S"
update:
ttl : "PT10S"
ttl: "PT10S"
rating:
ttl : "PT10S"
ttl: "PT10S"
support:
ttl : "PT10S"
ttl: "PT10S"
get_cancellation_reasons:
ttl : "PT10S"
ttl: "PT10S"
get_rating_categories:
ttl : "PT10S"
ttl: "PT10S"
cancellation:
ttl : "PT10S"
ttl: "PT10S"

responses:
responses:
on_search:
ttl: "PT15S"
on_init:
Expand All @@ -99,8 +99,8 @@ app:
cancellation_reasons:
ttl: "PT10S"
rating_categories:
ttl: "PT10S"
ttl: "PT10S"

# Mandatory.
privateKey: "PRIVATE_KEY"
publicKey: "PUBLIC_KEY"
Expand All @@ -113,7 +113,7 @@ app:
registryUrl: REGISTRY_URL
auth: false
uniqueKey: "BAP_SUBSCRIBER_ID_KEY"

# Mandatory.
city: "std:080"
country: "IND"
Expand All @@ -131,3 +131,6 @@ app:
# In minutes
syncInterval: 30
redis_db: 3

useHMACForWebhook: false
sharedKeyForWebhookHMAC: ""
Loading

0 comments on commit 041caa4

Please sign in to comment.