angularjs - Solution to replace clear text with encrypted form in request and response payload at rest -
i apologize horrible title. not think of better. best in explaining question here.
i have existing rest api endpoints work clear id fields, taskid, userid, profileid, etc. writing angularjs based front-end, call these existing api endpoints get/post data. e.g. once user logins, api endpoint used validation login information, returns userid (unique identifier of logged-in user) in response. next, userid came last call's response used fetch list of tasks (each identified uniquely taskid) associated user. , futrther, taskid used fetch task details.
in above communication, ids - userid, taskid on client side in clear. want implement solution without changing apis, can replace clear ids encrypted tokens:
- user logins username/password. api returns user object userid , other ids in object encrypted. so, there response transformer encrypts pre-defined id fields before response sent client
- now, frontend component use encrypted id further calls. calls api /myapi/tasks/user/{encrypteduserid} tasks user.
- there filter on server, intercepts api requests , decrypts pre-defined id fields before passing request real api method.
my questions:
- is there open source api/framework available, can leverage implement solution?
- is there different/better way achieve same goals trying achieve solution?
- any reference implementation can refer implementing request interceptor , response transformer, encrypts/decrypts pre-defined id fields depending upon object being transmitted?
any inputs/suggestions/comments welcome , appreciated. please let me know if guys think question/topic belong elsewhere.
Comments
Post a Comment