identity-codes-security
v0.0.1
Published
Implements the BYU identity code API securities in a single module.
Downloads
3
Readme
identity-codes-security
Implements the BYU identity code API securities in a single module.
Parameters
configuration - an object that supplies the follow parameters:
- server - instance of the server (like express).
- wso2_request_instance - instance of byu-wso2-request.
- code_api_name - a string that is used in the basepath of the selective-middleware package.
- [ group_name ] - an optional BYU group id for verifying person group permissions.
- [ handler ] - an optional function for formatting error responses to the client used in the byu-group-mem package.
Example
See the examples on the byu-group-mem page and the selective-middleware page
Instead of the BYU identity code api security middleware looking like the following:
api.use(select({
base_path: '/domains/identity/levels_of_education',
GET: ['/:variable/logs'],
PUT: ['/:variable'],
POST: [''],
DELETE: ['/:variable'],
prefix: group_mem({
wso2_request_instance: wso2,
group_name: 'identity-codes-admin'
})
}));
It has been simplified to the following with the use of this package:
security({
server: api,
wso2_request_instance: wso2,
code_api_name: 'levels_of_education',
});