db2rest
db2rest copied to clipboard
Support API Key Auth
DB2Rest needs to support API Key Auth. The source of API Key auth data can be
- file system in this case the user is responsible for creating the API Keys
- external API that provides the API Keys and the mappings (In this case this external end point should be polled periodically to refresh the configuration). The config can also be cached in an in memory cache like apache ignite which also allows overflow to file and running sql to query.
The configuration is shown below :
` name: db2rest-security
resourceRoles:
- resource: "/v1/rdbms/pgdb/actor/**"
method: post
roles:
- role2
- role3
- role4
- resource: "/api/v2/host"
method: get
roles:
- role2
- role3
- role4
excludedResources:
- resource: "/v1/rdbms/**" method: get
- resource: "/v1/rdbms/pgdb/factor" method: post
- resource: "/v1/rdbms/**" method: put
- resource: "/v1/rdbms/**" method: delete
apiKeys:
- key: apikey1 roles: [role1,role6] active: true
- key: apikey2 roles: [role1,role4]
- key: apiKey3 roles: [role3] `
If active
attribute is missing then the default value is false
in which case DB2Rest should not allow the call.