added endpoint documentation
This commit is contained in:
@@ -9,5 +9,5 @@
|
|||||||
- [x] AuthService usage
|
- [x] AuthService usage
|
||||||
- [x] AuthMiddleware usage
|
- [x] AuthMiddleware usage
|
||||||
- [ ] AdminPages usage
|
- [ ] AdminPages usage
|
||||||
- [ ] Endpoints usage
|
- [x] Endpoints usage
|
||||||
- [ ] Blazor pages usage
|
- [ ] Blazor pages usage
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# HopFrame Endpoints
|
||||||
|
HopFrame currently only supports endpoints for authentication out of the box.
|
||||||
|
|
||||||
|
> **Hint:** with the help of the [repositories](../repositories.md) you can very easily create missing endpoints for HopFrame components yourself.
|
||||||
|
|
||||||
|
## All currently supported endpoints
|
||||||
|
|
||||||
|
> **Hint:** you can use the build-in [swagger](https://swagger.io/) ui to explore and test all endpoints of your application __including__ HopFrame endpoints.
|
||||||
|
|
||||||
|
### SecurityController
|
||||||
|
Base endpoint: `api/v1/authentication`\
|
||||||
|
**Important:** All primitive data types (including `string`) are return as a [`SingleValueResult`](./models.md#SingleValueResult)
|
||||||
|
|
||||||
|
|
||||||
|
| Method | Endpoint | Payload | Returns |
|
||||||
|
| ------ | -------- | ------- | ------- |
|
||||||
|
| PUT | login | [UserLogin](./models.md#UserLogin) | access token (string) |
|
||||||
|
| POST | register | [UserRegister](./models#UserRegister) | access token (string) |
|
||||||
|
| GET | authenticate | | access token (string) |
|
||||||
|
| DELETE | logout | | |
|
||||||
|
| DELETE | delete | [UserPasswordValidation](./models.md#UserPasswordValidation) | |
|
||||||
|
|||||||
@@ -30,4 +30,4 @@ They help you sending the right `HttpStatusCode` with the right data.
|
|||||||
return LogicResult<string>.Ok("Hello, World!");
|
return LogicResult<string>.Ok("Hello, World!");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
**Hint:** You can also provide an error message for status codes that are not in the 200 range.
|
> **Hint:** You can also provide an error message for status codes that are not in the 200 range.
|
||||||
33
docs/api/models.md
Normal file
33
docs/api/models.md
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# HopFrame Models
|
||||||
|
All models used by the RestAPI are listed below
|
||||||
|
|
||||||
|
## SingleValueResult
|
||||||
|
```csharp
|
||||||
|
public struct SingleValueResult<TValue>(TValue value) {
|
||||||
|
public TValue Value { get; set; } = value;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## UserLogin
|
||||||
|
```csharp
|
||||||
|
public class UserLogin {
|
||||||
|
public string Email { get; set; }
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## UserRegister
|
||||||
|
```csharp
|
||||||
|
public class UserRegister {
|
||||||
|
public string Username { get; set; }
|
||||||
|
public string Email { get; set; }
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## UserPasswordValidation
|
||||||
|
```csharp
|
||||||
|
public sealed class UserPasswordValidation {
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user