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

Enhancing security features #23

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
23 changes: 23 additions & 0 deletions code/API_definitions/dedicated-network-accesses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ paths:
- Accesses
summary: Get a list of device accesses to dedicated networks, optionally filtered for a given device and/or for a given dedicated network
operationId: listNetworkAccesses
security:
- oAuth2:
- dedicated-network:accesses:read
parameters:
- name: networkId
in: query
Expand Down Expand Up @@ -59,6 +62,9 @@ paths:
- Accesses
summary: Create a device access to a dedicated network with given configuration
operationId: createNetworkAccess
security:
- oAuth2:
- dedicated-network:access:create
requestBody:
content:
application/json:
Expand Down Expand Up @@ -96,6 +102,9 @@ paths:
- Accesses
summary: Get a device access to the dedicated network and its configuration
operationId: readNetworkAccess
security:
- oAuth2:
- dedicated-network:access:read
parameters:
- name: accessId
in: path
Expand Down Expand Up @@ -128,6 +137,9 @@ paths:
- Accesses
summary: Delete a device access to the dedicated network
operationId: deleteNetworkAccess
security:
- oAuth2:
- dedicated-network:access:delete
parameters:
- name: accessId
in: path
Expand All @@ -152,6 +164,17 @@ paths:
$ref: "#/components/responses/Generic503"

components:
securitySchemes:
oAuth2:
type: oauth2
flows:
clientCredentials:
tokenUrl: https://api.example.com/oauth/token
scopes:
dedicated-network:accesses:read: Read a list of accesses
dedicated-network:access:create: Create a device access
dedicated-network:access:read: Read a device access
dedicated-network:access:delete: Delete a device access

parameters:
x-correlator:
Expand Down
15 changes: 15 additions & 0 deletions code/API_definitions/dedicated-network-profiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ paths:
- Profiles
summary: Read dedicated network profiles
operationId: readNetworkProfiles
security:
- oAuth2:
- dedicated-network:profiles:read
parameters:
- $ref: "#/components/parameters/x-correlator"
responses:
Expand Down Expand Up @@ -50,6 +53,9 @@ paths:
- Profiles
summary: Read a dedicated network profile
operationId: readNetworkProfile
security:
- oAuth2:
- dedicated-network:profile:read
parameters:
- name: profileId
in: path
Expand Down Expand Up @@ -78,6 +84,15 @@ paths:
$ref: "#/components/responses/Generic503"

components:
securitySchemes:
oAuth2:
type: oauth2
flows:
clientCredentials:
tokenUrl: https://api.example.com/oauth/token
scopes:
dedicated-network:profiles:read: Read network profiles
dedicated-network:profile:read: Read a network profile

parameters:
x-correlator:
Expand Down
25 changes: 24 additions & 1 deletion code/API_definitions/dedicated-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ paths:
- Networks
summary: Get a list of dedicated networks
operationId: listNetworks
security:
- oAuth2:
- dedicated-network:networks:read
parameters:
- $ref: "#/components/parameters/x-correlator"
responses:
Expand Down Expand Up @@ -52,6 +55,9 @@ paths:
- Networks
summary: Request to create a dedicated network
operationId: createNetwork
security:
- oAuth2:
- dedicated-network:network:create
requestBody:
required: true
content:
Expand Down Expand Up @@ -137,6 +143,9 @@ paths:
- Networks
summary: Get the current information about a dedicated network
operationId: readNetwork
security:
- oAuth2:
- dedicated-network:network:read
parameters:
- name: networkId
in: path
Expand All @@ -158,8 +167,11 @@ paths:
delete:
tags:
- Networks
summary: Destroy a dedicated network
summary: Delete a dedicated network
operationId: deleteNetwork
security:
- oAuth2:
- dedicated-network:network:delete
parameters:
- name: networkId
in: path
Expand All @@ -185,6 +197,17 @@ paths:

components:
securitySchemes:
oAuth2:
type: oauth2
flows:
clientCredentials:
tokenUrl: https://api.example.com/oauth/token
scopes:
dedicated-network:networks:read: Read a list of networks
dedicated-network:network:create: Create a network
dedicated-network:network:read: Read a network
dedicated-network:network:delete: Delete a network

notificationsBearerAuth:
description: Bearer authentication for notifications
type: http
Expand Down