Initial SAML based authentication in usermgmt component
Signed-off-by: Akshay Gaikwad <akshay.gaikwad@rafay.co>
Update SAMLAuth middleware
- Get username from request body
- Validate for exiwstng session
- Redirect to IDP authentication when no valid session
Modification in SAML middlewares
- Reduce duplicate code by new function createSAMLMiddleware
Restructure saml package
- Moved SAML Middlewares to middleware.go
- Embed samlsp.Middleware into own struct
Use EntityDAO from common and mock Idp model for testing
Signed-off-by: Akshay Gaikwad <akshay.gaikwad@rafay.co>
Add IDP API definitions
Signed-off-by: Akshay Gaikwad <akshay.gaikwad@rafay.co>
Add interface for IdpService
Add id to UpdateIdp proto message
Add metadata_url to UpdateIdp message and limit to ListIdps rpc
Implement Idp Service methods
Update Idp model
Remove main.go and mocked idp model
Generate ACS URL and SAML SP cert
Change Id type in proto as well as in IDP model
Update IDP model struct tags
Set TimeFormat for IDP service
Update generateSpCert() and generateAcsURL()
Add idpServer which is wrapper around idpService
idpServer is a gRPC controller.
Add back-end validations for idp service
This includes:
- Move entity_dao.go to common since it is generic database operation
interface for all the components.
- Added `GetX` method to EntityDAO interface. It get entity that matches
provided field and value both. It is useful in case where service
lookup for database entities not based on id, name.
Signed-off-by: Akshay Gaikwad <akshay.gaikwad@rafay.co>