USACE / cwms-data-api

Corps Water Management System RESTful Data Service
MIT License
13 stars 14 forks source link

Create authorization module for testing and override mechanism #214

Closed MikeNeilson closed 10 months ago

MikeNeilson commented 2 years ago

I had already planned that we need to create a separate "authorization handler" for when we're on CWBI however in typing up instructions for someone to setup RADAR for testing I realized we also need one for test environments.

MikeNeilson commented 2 years ago

My tentative plan is to add a -D flag and when the system initializtion the authorizer use Class.forName to get the actual implementation... Services are another option but that seems excessive... or would it be better? Wouldn't mind the practice honestly.

@rma-rripken @adamkorynta @rma-psmorris

MikeNeilson commented 2 years ago

I was planning to do the actual work, but since I've asked for a specific comment/advice, there's the label.

adamkorynta commented 2 years ago

Services are almost trivial to set up and the service-annotations allow for ordering/superseding implementations. You also get type safety and don't have to worry about setting up something that get's you the authorizer implementation class name.

MikeNeilson commented 2 years ago

Okay, I was reading about it last week and honestly couldn't accept it could be that easy but the glowing review tips the scale.

MikeNeilson commented 2 years ago

wow, that was really easy... not the hard part... actually creating a usable "test" implementation.... going to depend on a lot on the CWMS database itself.