JanssenProject / jans

An open source enterprise digital identity platform for CIAM or workforce... Janssen is a distribution of standards-based, developer friendly, components that are engineered to work together in any cloud. #OAuth #OpenID #FIDO
https://docs.jans.io
Apache License 2.0
480 stars 75 forks source link

fix:(scim-cli) multiple option with same name (Query User resources) #2382

Closed manojs1978 closed 2 years ago

manojs1978 commented 2 years ago

Describe the bug multiple option with same name (Query User resources)

To Reproduce Steps to reproduce the behavior: please check below screenshot 1 and 7 option are same in scim-cli user menu and both have same functionality which is not working

Expected behavior there should be only one option with "Query User resources" functionality

Screenshots image

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

devrimyatar commented 2 years ago

They are different and both are working.

This is option 1

Query User resources (see section 3.4.2 of RFC 7644)
----------------------------------------------------

«A comma-separated list of attribute names to return in the response. Type: string»
attributes:                                                                                                                                                    

«When specified, the response will contain a default set of attributes minus those listed here (as a comma-separated list). Type: string»
excludedAttributes:                                                                                                                                            

«An expression specifying the search criteria. See section 3.4.2.2 of RFC 7644. Type: string»
Example: userName eq "jhon" and meta.lastModified gt "2011-05-13T04:42:34Z"
filter:                                                                                                                                                        

«The 1-based index of the first query result. Type: integer»
startIndex: 1                                                                                                                                                  

«Specifies the desired maximum number of query results per page. Type: integer»
count: 10                                                                                                                                                      

«The attribute whose value will be used to order the returned responses. Type: string»
sortBy:                                                                                                                                                        

«Order in which the sortBy param is applied. Allowed values are "ascending" and "descending". Type: string»
sortOrder:                                                                                                                                                     
Calling Api with parameters: {'start_index': 1, 'count': 10}
Please wait while retreiving data ...

+----+--------------------------------------+------------+--------------------+----------+
|    | id                                   | userName   | displayName        | active   |
+====+======================================+============+====================+==========+
|  1 | b28a8407-8a63-4e23-9b82-2d65f54d0c24 | admin      | Default Admin User | True     |
+----+--------------------------------------+------------+--------------------+----------+
|  2 | 4bb09918-7cd2-4440-a4e8-ef1449341d20 | devrim     | Devrim Yatar       | False    |
+----+--------------------------------------+------------+--------------------+----------+
b: back, w: write result, q: quit, x: logout and quit

Selection: 1                                                                                                                                                   
{ 'active': True,
  'addresses': None,
  'displayName': 'Default Admin User',
  'emails': [ { 'display': None,
                'primary': False,
                'type': None,
                'value': 'admin@snap.gluu.org'}],
  'entitlements': None,
  'externalId': None,
  'groups': [ { '$ref': 'https://snap.gluu.org/jans-scim/restv1/v2/Groups/60B7',
                'display': 'Jannsen Manager Group',
                'type': 'direct',
                'value': '60B7'}],
  'id': 'b28a8407-8a63-4e23-9b82-2d65f54d0c24',
  'ims': None,
  'locale': None,
  'meta': { 'created': None,
            'lastModified': None,
            'location': 'https://snap.gluu.org/jans-scim/restv1/v2/Users/b28a8407-8a63-4e23-9b82-2d65f54d0c24',
            'resourceType': 'User'},
  'name': { 'familyName': 'User',
            'formatted': 'Admin Admin User',
            'givenName': 'Admin',
            'honorificPrefix': None,
            'honorificSuffix': None,
            'middleName': 'Admin'},
  'nickName': 'Admin',
  'password': None,
  'phoneNumbers': None,
  'photos': None,
  'preferredLanguage': None,
  'profileUrl': None,
  'roles': None,
  'schemas': ['urn:ietf:params:scim:schemas:core:2.0:User'],
  'timezone': None,
  'title': None,
  'urn:ietf:params:scim:schemas:extension:gluu:2.0:User': None,
  'userName': 'admin',
  'userType': None,
  'x509Certificates': None}
b: back, w: write result, q: quit, x: logout and quit

This is Option 7

user
----
1 Query User resources (see section 3.4.2 of RFC 7644)
2 Allows creating a User resource via POST (see section 3.3 of RFC 7644)
3 Retrieves a User resource by Id (see section 3.4.1 of RFC 7644)
4 Updates a User resource (see section 3.5.1 of RFC 7644). Update works in a replacement fashion: every
attribute value found in the payload sent will replace the one in the existing resource representation. Attributes 
not passed in the payload will be left intact.

5 Deletes a user resource
6 Updates one or more attributes of a User resource using a sequence of additions, removals, and 
replacements operations. See section 3.5.2 of RFC 7644

7 Query User resources (see section 3.4.2 of RFC 7644)
b: back, q: quit, x: logout and quit

Selection: 7                                                                                                                                                   

«Type: array of string separated by _,»
schemas:                                                                                                                                                       

«A list of attribute names to return in the response. Type: array of string separated by _,»
attributes:                                                                                                                                                    

«When specified, the response will contain a default set of attributes minus those listed here. Type: array of string separated by _,»
excludedAttributes:                                                                                                                                            

«An expression specifying the search criteria. See section 3.4.2.2 of RFC 7644. Type: string»
Example: userName eq "jhon" and meta.lastModified gt "2011-05-13T04:42:34Z"
filter:                                                                                                                                                        

«The attribute whose value will be used to order the returned responses. Type: string»
sortBy:                                                                                                                                                        

«Order in which the sortBy param is applied. Allowed values are "ascending" and "descending". Type: string»
sortOrder:                                                                                                                                                     

«The 1-based index of the first query result. Type: integer»
startIndex: 1                                                                                                                                                  

«Specifies the desired maximum number of query results per page. Type: integer»
count: 10                                                                                                                                                      

Populate optional fields? n                                                                                                                                    
Obtained Data:

{
  "schemas": [],
  "attributes": [],
  "excludedAttributes": [],
  "filter": null,
  "sortBy": null,
  "sortOrder": null,
  "startIndex": 1,
  "count": 10
}
b: back, n: no, y: yes, q: quit, x: logout and quit

Continue? y                                                                                                                                                    
Please wait while posting data ...

{
  "Resources": [
    {
      "externalId": null,
      "userName": null,
      "name": {
        "familyName": "Yatar",
        "givenName": "Devrim",
        "middleName": null,
        "honorificPrefix": null,
        "honorificSuffix": null,
        "formatted": null
      },
      "displayName": null,
      "nickName": null,
      "profileUrl": null,
      "title": null,
      "userType": null,
      "preferredLanguage": null,
      "locale": null,
      "timezone": null,
      "active": null,
      "password": null,
      "emails": null,
      "phoneNumbers": null,
      "ims": null,
      "photos": null,
      "addresses": null,
      "groups": null,
      "entitlements": null,
      "roles": null,
      "x509Certificates": null,
      "urn:ietf:params:scim:schemas:extension:gluu:2.0:User": null,
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "id": "b28a8407-8a63-4e23-9b82-2d65f54d0c24",
      "meta": null
    },
    {
      "externalId": null,
      "userName": null,
      "name": {
        "familyName": "Yatar",
        "givenName": "Devrim",
        "middleName": null,
        "honorificPrefix": null,
        "honorificSuffix": null,
        "formatted": null
      },
      "displayName": null,
      "nickName": null,
      "profileUrl": null,
      "title": null,
      "userType": null,
      "preferredLanguage": null,
      "locale": null,
      "timezone": null,
      "active": null,
      "password": null,
      "emails": null,
      "phoneNumbers": null,
      "ims": null,
      "photos": null,
      "addresses": null,
      "groups": null,
      "entitlements": null,
      "roles": null,
      "x509Certificates": null,
      "urn:ietf:params:scim:schemas:extension:gluu:2.0:User": null,
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "id": "4bb09918-7cd2-4440-a4e8-ef1449341d20",
      "meta": null
    }
  ],
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 2,
  "startIndex": 1,
  "itemsPerPage": 2
}
b: back, q: quit, x: logout and quit
devrimyatar commented 2 years ago

@jgomer2001 May be we can change this description: https://github.com/JanssenProject/jans/blob/main/jans-scim/server/src/main/resources/jans-scim-openapi.yaml#L1493

devrimyatar commented 2 years ago

Option 7 is removed in commit https://github.com/JanssenProject/jans/commit/98ac92023bd2c0603fb825bbc436b6e0aa336ceb