auth-framework 0.5.0-rc18

A comprehensive, production-ready authentication and authorization framework for Rust applications
Documentation
# User Management Endpoints

profile:
    get:
        tags:
            - Users
        summary: Get the authenticated user's profile
        operationId: getUserProfile
        security:
            - bearerAuth: []
        responses:
            "200":
                description: User profile retrieved
                content:
                    application/json:
                        schema:
                            allOf:
                                - $ref: "../schemas/common.yaml#/ApiResponse"
                                - type: object
                                  properties:
                                      data:
                                          $ref: "../schemas/users.yaml#/UserProfile"
            "401":
                $ref: "../components/responses.yaml#/Unauthorized"

    put:
        tags:
            - Users
        summary: Update the authenticated user's profile
        operationId: updateUserProfile
        security:
            - bearerAuth: []
        requestBody:
            required: true
            content:
                application/json:
                    schema:
                        $ref: "../schemas/users.yaml#/UpdateProfileRequest"
        responses:
            "200":
                description: Profile updated successfully
                content:
                    application/json:
                        schema:
                            allOf:
                                - $ref: "../schemas/common.yaml#/ApiResponse"
                                - type: object
                                  properties:
                                      data:
                                          $ref: "../schemas/users.yaml#/UserProfile"
            "400":
                $ref: "../components/responses.yaml#/BadRequest"
            "401":
                $ref: "../components/responses.yaml#/Unauthorized"

changePassword:
    post:
        tags:
            - Users
        summary: Change the authenticated user's password
        operationId: changePassword
        security:
            - bearerAuth: []
        requestBody:
            required: true
            content:
                application/json:
                    schema:
                        $ref: "../schemas/users.yaml#/ChangePasswordRequest"
        responses:
            "200":
                description: Password changed successfully
                content:
                    application/json:
                        schema:
                            $ref: "../schemas/common.yaml#/ApiResponse"
            "400":
                $ref: "../components/responses.yaml#/BadRequest"
            "401":
                $ref: "../components/responses.yaml#/Unauthorized"

sessions:
    get:
        tags:
            - Users
        summary: List the authenticated user's active sessions
        operationId: getUserSessions
        security:
            - bearerAuth: []
        responses:
            "200":
                description: Active sessions retrieved
                content:
                    application/json:
                        schema:
                            allOf:
                                - $ref: "../schemas/common.yaml#/ApiResponse"
                                - type: object
                                  properties:
                                      data:
                                          type: array
                                          items:
                                              $ref: "../schemas/users.yaml#/SessionInfo"
            "401":
                $ref: "../components/responses.yaml#/Unauthorized"

sessionById:
    delete:
        tags:
            - Users
        summary: Revoke one active session
        operationId: revokeUserSession
        security:
            - bearerAuth: []
        parameters:
            - name: session_id
              in: path
              required: true
              schema:
                  type: string
              example: "session_123"
        responses:
            "200":
                description: Session revoked successfully
                content:
                    application/json:
                        schema:
                            $ref: "../schemas/common.yaml#/ApiResponse"
            "401":
                $ref: "../components/responses.yaml#/Unauthorized"
            "403":
                $ref: "../components/responses.yaml#/Forbidden"
            "404":
                $ref: "../components/responses.yaml#/NotFound"

userProfileById:
    get:
        tags:
            - Users
            - Admin
        summary: Get another user's profile (admin only)
        operationId: getUserProfileById
        security:
            - bearerAuth: []
        parameters:
            - name: user_id
              in: path
              required: true
              schema:
                  type: string
              example: "user_123"
        responses:
            "200":
                description: User profile retrieved
                content:
                    application/json:
                        schema:
                            allOf:
                                - $ref: "../schemas/common.yaml#/ApiResponse"
                                - type: object
                                  properties:
                                      data:
                                          $ref: "../schemas/users.yaml#/UserProfile"
            "401":
                $ref: "../components/responses.yaml#/Unauthorized"
            "403":
                $ref: "../components/responses.yaml#/Forbidden"
            "404":
                $ref: "../components/responses.yaml#/NotFound"