Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

feature: Human User Creation Endpoint #24

Merged
merged 7 commits into from
Feb 16, 2024
Merged

feature: Human User Creation Endpoint #24

merged 7 commits into from
Feb 16, 2024

Conversation

multipletwigs
Copy link
Collaborator

@multipletwigs multipletwigs commented Feb 12, 2024

Description of the pull request

Changes made

New Features

  • Added in an endpoint, /users that allows for the creation of a human user with User role.
  • The endpoint returns a token for that particular human user as part of its response.
  • Added in a guard for the endpoint, requiring the CREATE_USER permission with valid tokens.
  • Added in appropriate returnValues.ts consisting of success and failure statuses and messages.
  • Added in some more user metadata, such as collecting email and name information.

Chores

  • When configuring for UpStash, added in TLS support in redisConfig. No configurations done yet.

Related issues

#10

Testings done

Added Tests

  • Test for creating a user and ensuring it is saved in RedisDB.
  • Test for guards, including authorised and non-authorised flows
  • Test that this user can create threads, and can create messages in their own thread
  • Added in utils for creating human users

Screenshots (if any)

image
POST-ing to this endpoint creates a user in redis (explorer on upstash)

Checklist

  • I have written tests
  • My code does not produce new errors
  • I gave myself a code review before asking others.

@multipletwigs multipletwigs marked this pull request as draft February 12, 2024 17:19
@multipletwigs multipletwigs marked this pull request as ready for review February 15, 2024 00:16
Copy link
Collaborator

@GuiBibeau GuiBibeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is solid and follows patterns!

@GuiBibeau GuiBibeau merged commit 13f67e9 into AkeruAI:main Feb 16, 2024
1 check passed
@multipletwigs multipletwigs deleted the feature/POST-human-user branch February 18, 2024 11:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants