DataONEorg / bookkeeper

Bookkeeper keeps track of DataONE product subscriptions and quotas for researchers using the extended services.
Other
1 stars 2 forks source link

Add DataONEAuthHelper getCustomerWithSubjectInfo(subject) #32

Closed gothub closed 4 years ago

gothub commented 4 years ago

To support the requestore parameter for QuotasResource.listQuotas() and UsagesResource.listUsages, overload DataONEAuthHelper to include a subject parameter. The current DataONEAuthHelper.getCustomerWIthSubjectInfo() accepts a JWT token, which then extracts the subject from the token and calls the CN accounts service to get subjectInfo.

The overloaded method will call the CN accounts service directly (with the specified subject) so won't require listQuotas, listUsages to pass a token to be parsed.

gothub commented 4 years ago

Note that it was not possible to overload getCustomerWithSubjectInfo() as the new method would have the same signature as the existing one, so a new, maybe more fitting name was used for a new method: createCustomerWithSubjectInfo(), which creates a new customer with the provided subject id. The CN is called to get subject info for this subject id.

Added in commit 986eb4509ee69afb7e1a01ebeb3ae1c7698add98 and also mistakenly in a commit for another issue in commit 937857e4ef6826987cd28bc2f368b6e802076658.