Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Identity Service API Contract #18

Closed
lakshayman opened this issue Dec 28, 2021 · 0 comments
Closed

[RFC] Identity Service API Contract #18

lakshayman opened this issue Dec 28, 2021 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement Improving something existing feature task A big ticket item that needs to come up as a feature question Further information is requested

Comments

@lakshayman
Copy link
Collaborator

lakshayman commented Dec 28, 2021

Identity Service API Contracts

New User Object

{
  'id': string,
  'username': string,
  'first_name': string,
  'last_name': string,
  'email': string,
  'phone': number,
  'yoe': number,
  'company': string,
  'designation': string,
  'img': string,
  'github_id': string,
  'linkedin_id': string,
  'twitter_id': string,
  'instagram_id': string,
  'website': string,
  'github_display_name': string,
  'isMember': boolean,
  'userType': string,
  'tokens': {},
  'status': string,
  'identityURL': string,
  'identityStatus': string
}

Health Log object

{
  type: "identityHealth",
  timestamp: timestamp,
  body: string

Requests

Route Description
PATCH /users/identityURL Sets the identityurl for a user having param username
GET /users/chaincode Returns the chaincode after generating and updating new and distinct chaincode
POST /users/verify Sets the identityStatus to PENDING and calls the identity service
GET /users/profileDiffs Returns the profile diffs with the PENDING approval
PATCH /users/:username Update the user if requested by authorized person
PATCH /users/rejectDiff Sets the approval key in user's latest profile diff to NOT APPROVED

PATCH /users/identityURL

Sets the identityURL for a user having param username

  • Params
    None

  • Query
    None

  • Body
    {identityURL : <identityURL>}

  • Headers
    None

  • Cookie
    User Cookies

  • Success Response:

  • Code: 200

    • Content:
      {
          message: 'updated identity URL!!'
      }
      
  • Error Response:

    • Code: 500
      • Content: { 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }

GET /users/chaincode

Returns the chaincode after generating and updating new and distict chaincode

  • Params
    None

  • Query
    None

  • Body
    None

  • Headers
    None

  • Cookie
    User Cookies

  • Success Response:

  • Code: 200

    • Content:
      {
          message: 'Generated New Chaincode!!'
          chaincode: <new chaincode>
      }
      
  • Error Response:

    • Code: 500
      • Content: { 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }

POST /users/verify

Sets the identityStatus to PENDING and calls the identity service

  • Params
    None

  • Query
    None

  • Body
    None

  • Headers
    None

  • Cookie
    User Cookies

  • Success Response:

  • Code: 200

    • Content:
      {
          message: 'Your request has been queued successfully'
      }
      
  • Error Response:

    • Code: 500
      • Content: { 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }

GET /users/profileDiffs

Returns the profile diffs with the PENDING approval

  • Params
    None

  • Query
    None

  • Body
    None

  • Headers
    None

  • Cookie
    User Cookies

  • Success Response:

  • Code: 200

    • Content:
      {
          message: 'Profile Diffs returned successfully!',
          profileDiffs: [ ]
      }
      
  • Error Response:

    • Code: 500
      • Content: { 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }

PATCH /users/:username

Update the user and sets the lastDiff to APPROVED if requested by an authorized person

  • Params
    None

  • Query
    username: string

  • Body
    {
    'first_name': string,
    'last_name': string,
    'email': string,
    'phone': number,
    'yoe': number,
    'company': string,
    'designation': string,
    'github_id': string,
    'linkedin_id': string,
    'twitter_id': string,
    'instagram_id': string,
    'website': string,
    
}

  • Headers
    None

  • Cookie
    User Cookies

  • Success Response:

  • Code: 200

    • Content:
      {
          message: 'Updated user's data successfully!!!'
      }
      
  • Error Response:

    • Code: 500
      • Content: { 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }

PATCH /users/rejectDiff

Sets the approval key in users latest profile diff to NOT APPROVED

  • Params
    None

  • Query
    username: string

  • Body
    {
    username: string
    
}

  • Headers
    None

  • Cookie
    User Cookies

  • Success Response:

  • Code: 200

    • Content:
      {
          message: 'Rejected profileDiff successfully!!!'
      }
      
  • Error Response:

    • Code: 500
      • Content: { 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement Improving something existing feature task A big ticket item that needs to come up as a feature question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants