67 Commits
Author SHA1 Message Date
Akshay GaikwadandGitHub c4ac043b5e feat: Support more than one IdP groups mapping (#172)
Allow mapping more than one IdP groups to an OIdC identity. This
commit upgrades the kratos version (v0.11.0). Kratos v0.11.0 parses
all id token claims into `raw_claims`. The `raw_claims` can be used in
JsonNet mapper to map non-standard claims like `groups` to identity
traits.

Fixes #109

This also includes:
* Remove verbose bug debug logs
* Removes elasticsearch service from docker compose file

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>
2023-03-30 12:43:57 +05:30
Akshay GaikwadandGitHub 1f64d80729 Auto-generate password and force reset (#124)
* Upgrade kratos service to v0.10.1

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* Upgrade kratos-client-go to v0.10.1

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* generate password feature for kratos admin creation

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* Add forceReset property in user spec

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* added forcereset in the init script

Signed-off-by: mabhi <abhijit.mukherjee@infracloud.io>

* Resolve conflicts

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* Stdout default admin password in initialize script

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* setting password for new user and sending default password in create user response

Signed-off-by: mabhi <abhijit.mukherjee@infracloud.io>

* added new endpoint to service force reset flag update after resetting complete outside authz

Signed-off-by: mabhi <abhijit.mukherjee@infracloud.io>

* removed unnecessary overhead in the forcereset endpoint and updated user type proto to remove unused fields

Signed-off-by: mabhi <abhijit.mukherjee@infracloud.io>
2023-01-27 18:32:11 +05:30
Abhijit MukherjeeandGitHub cd55d2d1da record user.login event by kratos hooks (#111)
* record user.login event by kratos hooks

Signed-off-by: mabhi <abhijit.mukherjee@infracloud.io>

* added test case for create login auditlog

Signed-off-by: mabhi <abhijit.mukherjee@infracloud.io>

* updated change log

Signed-off-by: mabhi <abhijit.mukherjee@infracloud.io>
2022-12-26 11:55:19 +05:30
Abhijit MukherjeeandGitHub d7d57cb2d0 Fix modify userinfo service to include scope in response (#108)
Fix modify userinfo service to include scope in response
2022-12-05 15:33:16 +05:30
Akshay Gaikwad bde018a3c7 Use max select query for user last access time 2022-11-03 18:16:22 +05:30
Akshay Gaikwad 8f8bac25ea Add last login time in user API 2022-11-01 15:57:37 +05:30
vivekhiwarkar 6bf6e80a9b Fixing buf lint issue 2022-08-25 18:26:34 +05:30
vivekhiwarkar 411bc6049a changes for review comments 2022-08-22 12:06:13 +05:30
vivekhiwarkar 43b3bc8c7b review comment changes 2022-08-18 16:11:15 +05:30
vivekhiwarkar 9741ceca77 Adding audit points 2022-08-17 12:42:00 +05:30
Abin Simon dded075b1b Explicitly fail on empty role in user mapping 2022-06-16 14:56:04 +05:30
Abin Simon 98bb6d554c Add testing for idp groups 2022-06-16 14:56:04 +05:30
Nirav ParikhandGitHub da6f02bbbc Merge pull request #164 from paralus/rename-to-paralus
Rename code to paralus
2022-06-10 13:36:06 +05:30
Abin Simon 38f937bfcf User GetM instead of GetByID when fetching user
This is necessary as we do not have `trash` in case of user and
GetByID explects that column to be available.
2022-06-10 09:04:26 +05:30
Akshay Gaikwad b67fcacf87 Rename go module name and its usage 2022-06-08 17:21:22 +05:30
Akshay Gaikwad 318907b215 Modify Kratos traits to hold single string group
Due to the ORY Kratos claims which has no group/groups, and as
discussed regarding mapping idp groups to Claims.Team which is string
type, Added idpGroup to kratos trait which is also string type. Both
Identity idpGroup and Claim.Team can be mapped without fail in mapper
config.
2022-06-06 12:16:08 +05:30
niravparikh05 ad193fbf98 removed desc from user traits 2022-05-27 15:15:58 +05:30
Abin SimonandGitHub 14750dc41a Merge pull request #149 from RafayLabs/even-more-fixes
Fix errors, unique filter, oidc
2022-05-27 13:57:50 +05:30
Abin Simon 8054b75c88 Lowercase error messages 2022-05-27 13:51:28 +05:30
Nirav ParikhandGitHub c3320a8234 Merge pull request #145 from RafayLabs/ns-dev
Namespace related development changes
2022-05-27 12:30:42 +05:30
niravparikh05 0210f0f2d3 renamed column namespace_id to namespace 2022-05-27 12:23:22 +05:30
Abin Simon 446ae18798 Don't let users delete their own accounts 2022-05-24 12:27:41 +05:30
Abin Simon c576932eda Create /user/:username/forgotpassword endpoint 2022-05-24 12:08:37 +05:30
niravparikh05 8ab85e57c9 changes to support namespaces 2022-05-23 12:42:51 +05:30
Abin Simon bdc1052662 Cleanup some TODO items 2022-05-20 11:27:29 +05:30
Abin Simon aabf2e600e Fix group filter for users
The following could be used as an optimisation when we are filtering
just by user, but decided to omit as of now.

```
usrs, err = dao.ListFilteredUsersWithGroup(ctx, s.db,
    []uuid.UUID{}, groupId, queryOptions.Q, queryOptions.Type,
    queryOptions.OrderBy, queryOptions.Order,
    int(queryOptions.Limit), int(queryOptions.Offset))
```
2022-05-20 10:29:35 +05:30
Akshay Gaikwad 2e4d802995 Fix: Type assertion error on IdPGroups 2022-05-17 13:16:59 +05:30
Abin Simon 5c68a33537 Prevent combining idp and managed groups 2022-05-13 16:24:58 +05:30
Abin Simon f3de101f94 Update User spec to include IDPGroups 2022-05-13 13:37:07 +05:30
Akshay Gaikwad a0424f4000 Modify groupaccount table instead of just policy rules 2022-05-12 18:11:10 +05:30
Akshay Gaikwad 5e7fc110b2 Add IdP groups in Identities table
The idp_groups is list of groups IdP user belongs to that is returning
in the OIdC providers token response. The flow of Idp Group mapping is
as follows:
    OIdC Provider (OP) return custom claim with groups in a token when
    authentication event
        |
    The value of custom claim is mapped to `idp_groups` of identity
    traint using JsonNet mapper.
        |
    On inserting/updating/deleting `identities` table, Postgresql
    sends a pg_notification with
    `PG_OPERATION,IDENTITY_ID,IDENTITY_TRAIN` as a payload.
       |
    The `pkg/service/user.UserService.UpdateIdpUserGroupPolicy` update
    the casbin policies for each notification based on payload received.
2022-05-12 12:32:30 +05:30
niravparikh05 101c005312 fixes for permissions and user group assoc 2022-04-26 19:56:36 +05:30
Nirav ParikhandGitHub a9cd4e842e multiple kratos clients for session validation and identity creation (#114)
* multiple kratos clients for session validation and identity creation

* fixed review comments

* switching few logs to debug
2022-04-21 11:52:20 +05:30
Abin Simon 309b1a4bda Add warning about DEV mode when calling userinfo 2022-04-14 16:55:48 +05:30
Abin Simon 3f43536ad0 Don't panic if user is not available 2022-04-14 16:25:14 +05:30
Nirav ParikhandGitHub a6268da716 Merge pull request #101 from RafayLabs/authz-next
Tiny tweaks to authz
2022-04-13 12:13:18 +05:30
Abin Simon 9190ac81f2 Make UserInfo not require authz 2022-04-13 12:07:51 +05:30
niravparikh05 e45547a453 changes to support dev mode testing 2022-04-12 12:37:34 +05:30
Abin Simon 0ebb1a1339 Add audit log write
https://blog.sandipb.net/2018/05/03/using-zap-creating-custom-loggers/
2022-04-08 17:42:26 +05:30
Abin Simon d9d0bc3585 Fix and cleanup tests 2022-04-08 17:42:26 +05:30
Abin SimonandAbin Simon 729009d7fb Add basic audit logging setup 2022-04-08 17:42:26 +05:30
niravparikh05 8397d88836 fix for casbin duplicate issue during init and removing all deletes from init 2022-04-07 17:57:37 +05:30
Abin Simon df72864d09 Add option to filter by user auth mode
Pass in type=password or type=oidc to pick the mode
2022-04-06 15:03:01 +05:30
Abin Simon 66c7cc7f10 Filter from all users list if we have don't have filters 2022-04-06 14:01:32 +05:30
Abin Simon 5306d6a2c6 Send recovery url back after user creation 2022-04-06 13:39:36 +05:30
nirav-rafay 639ff1da30 addressed review comments, changes for custom roles and sso users 2022-04-04 11:41:58 +05:30
nirav-rafay ce9063e990 rebasing with fixes for ui 2022-04-01 12:03:42 +05:30
Abin Simon 94bb70cb6d Merge sentry view table models 2022-03-31 13:37:11 +05:30
Abin Simon 1ed5a3e876 Rework session handling to prevent cyclic import
imports github.com/RafayLabs/rcloud-base/internal/fixtures
imports github.com/RafayLabs/rcloud-base/pkg/service
imports github.com/RafayLabs/rcloud-base/pkg/auth/v3
imports github.com/RafayLabs/rcloud-base/pkg/service
2022-03-30 14:00:05 +05:30
Abin Simon ff4f5d160e Switch from permission to permissions for userinfo 2022-03-29 16:02:29 +05:30