Skip to content

Commit

Permalink
Updated API requests for frontend client
Browse files Browse the repository at this point in the history
  • Loading branch information
dapolach committed Sep 18, 2024
1 parent 69851d4 commit d95de7b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 23 deletions.
34 changes: 18 additions & 16 deletions backend/api.http
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Authorization: Bearer {{$auth.token("frontend")}}

### Register member
POST {{host}}/memberRegistrations
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}
Content-Type: application/json

{
Expand All @@ -30,31 +30,31 @@ Content-Type: application/json

### Get all members (compact details)
GET {{host}}/members?view=compact
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}
Accept: application/json

### Get all members (full details)
GET {{host}}/members?view=full
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}
Accept: application/json

### GET single member
GET {{host}}/members/1
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

### Suggest registration number
GET {{host}}/registrationNumber?sex=MALE&dateOfBirth=2020-10-11
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

### GET Edit member form data
GET {{host}}/members/1/editMemberInfoForm
Content-Type: application/json
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

### PUT Edit member form data
PUT {{host}}/members/1/editMemberInfoForm
Content-Type: application/json
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

{
"identityCard": null,
Expand All @@ -75,7 +75,7 @@ Authorization: Bearer {{$auth.token("test")}}
"bankAccount": null,
"dietaryRestrictions": null,
"drivingLicence": [],
"medicCourse": false,
"medicCourse": true,
"firstName": "John",
"lastName": "Dow",
"dateOfBirth": "2020-02-10",
Expand All @@ -85,33 +85,35 @@ Authorization: Bearer {{$auth.token("test")}}

### Membership suspension info
GET {{host}}/members/1/suspendMembershipForm
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

### Suspend membership
POST {{host}}/members/1/suspendMembershipForm
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

### Get ORIS user info data
GET {{host}}/oris/userInfo/ZBM8003
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

### GET ORIS user info data - unknown reg num
GET {{host}}/oris/userInfo/ZBM8002
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

### Get List of available grants
GET {{host}}/grants
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

### Get Member grants Form data
GET {{host}}/members/1/changeGrantsForm
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

### Update member grants
PUT {{host}}/members/1/changeGrantsForm
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}
Content-Type: application/json

{
"grants": ["members:register"]
}
}

###
24 changes: 17 additions & 7 deletions backend/authorization_server.http
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
### OIDC metadata
GET {{host}}/.well-known/openid-configuration



### OIDC UserInfo
GET {{host}}/oidc/userinfo
Authorization: Bearer {{$auth.token("test")}}
Authorization: Bearer {{$auth.token("frontend")}}

### OAuth2 token introspection - ID token
POST {{host}}/oauth2/introspect
Authorization: Basic test test
Content-Type: application/x-www-form-urlencoded

token={{$auth.idToken("test")}}
token={{$auth.idToken("frontend")}}

### OAuth2 token introspection - access token
POST {{host}}/oauth2/introspect
Authorization: Basic test test
Content-Type: application/x-www-form-urlencoded

token={{$auth.token("test")}}
token={{$auth.token("frontend")}}

### OAuth2 refresh token use
### OAuth2 refresh token use (implicit)
POST {{host}}/oauth/token
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {{clientId}} {{clientSecret}}

grant_type=refresh_token&client_id= {{clientId}}&refresh_token={{refresh_token}}

###
### OAuth2 refresh token use (PKCE)
POST {{host}}/oauth/token
Content-Type: application/x-www-form-urlencoded

grant_type=refresh_token&
client_id=frontend&
client_secret=...&
code_verifier=...&
refresh_token=...




0 comments on commit d95de7b

Please sign in to comment.