Commit Graph

14 Commits

Author SHA1 Message Date
abin-rafay
35edd2dee5 Authz integration for usermgmt (#19)
* Update dependencies from authz
* authz: fix log import path
* Authz related creation steps
* Fix typo: Namesapce -> Namespace
* Add tests for role creation interaction with authz
* Switch to using names for policy and group creation in authz
* Group creation not udpates casbin db
* Fix reading db address from env
* Tiny typo fix in readme
* Simplify error handling in usermgmt server
* Rework test setup
* Fix all current tests
* Complete authz integration
* Drop unnecessary dependency on adminsrv in usermgmt
2022-02-21 17:11:11 +05:30
akshay196-rafay
8990aa8942 Change IdP and OIDC Provider lookup to name from Id (#18)
* Move oidc provider model

* Change apiVersion of Idp and Oidc provider to 'system.k8smgmt.io/v3'

* Change IdP Get, Udpate, Delete to name instead of an Id

* Change Oidc Provider Get, Update, Delete to name instead of an Id

* Deprecated AcsURL from Idp db table

AcsURL is generated dynamically per request. This change is made
particularly considering case where application host is changed after
adding IdP. Storing AcsURL in table will create hard coupling between
application host and Idp configuration. OIDC provider service is
following same approach for callback url.

* Idp: Load application HTTP Url in main.go

* OIDC Provider: Reuse Kratos Url from main.go
2022-02-21 16:58:10 +05:30
abin-rafay
464a1014db User management (#8)
multiple fixes and refactored to support from id to name, added resource roles, permissions script and improved test coverage
2022-02-03 11:04:01 +05:30
Akshay Gaikwad
d5b8fa3466 Implement OIDC provider Update and Delete methods 2022-01-25 18:35:48 +05:30
Akshay Gaikwad
f93962e5f2 Add structure for OIdC provider service 2022-01-25 18:33:55 +05:30
Akshay Gaikwad
9f8ebe2fd8 Change name of Idp Service methods
Being consistent with other resource names.
2022-01-21 12:34:06 +05:30
Akshay Gaikwad
ed0390cb8c Update Idp service according to GVK spec 2022-01-19 13:50:21 +05:30
Akshay Gaikwad
d794603d7f Add DeleteIdp rpc method
Signed-off-by: Akshay Gaikwad <akshay.gaikwad@rafay.co>
2022-01-17 13:12:25 +05:30
Akshay Gaikwad
8464307c1e SAML Authentication and IDP Service
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
2022-01-17 11:29:55 +05:30
Abin Simon
64a70363db Simplify server package for usermgmt 2022-01-13 10:29:54 +05:30
Abin Simon
9a189f4bb6 Return updated status back to client on error 2022-01-12 17:35:38 +05:30
Abin Simon
d8b8fab1ff Move user management to new strucutre 2022-01-12 17:35:38 +05:30
Abin Simon
544a2d6bb0 Basic CRUD operations on role can now be done 2022-01-12 17:35:37 +05:30
Abin Simon
769acb9c80 Complete basic setup for groups in usermgmt 2022-01-12 17:35:37 +05:30