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

[MAIN] Add created at timestamps when listing resource servers and delegations #348

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,8 @@ paths:
type: string
url:
type: string
createdAt:
type: string
owner:
type: object
required:
Expand Down Expand Up @@ -1593,6 +1595,7 @@ paths:
- id: bc51dfff-ee8b-4438-8c0c-5881a482e124
name: COP Resource Server
url: rs.cop.in
createdAt: 2023-06-21T13:17:10.433408
owner:
email: [email protected]
name:
Expand Down Expand Up @@ -2256,6 +2259,8 @@ paths:
role:
type: string
minLength: 1
createdAt:
type: string
owner:
type: object
properties:
Expand Down Expand Up @@ -2324,6 +2329,7 @@ paths:
url: foobar.iudx.io
role: consumer
server: Foobar
createdAt: 2023-06-21T13:17:10.433408
owner:
email: [email protected]
name:
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/iudx/aaa/server/policy/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public class Constants {
"Requested resource is a PII resource - provider cannot access directly";

public static final String LIST_DELEGATION_AS_DELEGATOR_OR_DELEGATE =
"SELECT d.id, d.user_id, url, roles.user_id AS delegator_id, lower(roles.role::text) AS role, name AS server "
+ "FROM delegations AS d JOIN roles ON roles.id = d.role_id"
"SELECT d.id, d.user_id, url, roles.user_id AS delegator_id, lower(roles.role::text) AS role, name AS server"
+ ", d.created_at AS \"createdAt\" FROM delegations AS d JOIN roles ON roles.id = d.role_id"
+ " JOIN resource_server ON"
+ " roles.resource_server_id = resource_server.id"
+ " WHERE d.status = 'ACTIVE' AND roles.status = 'APPROVED'"
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/iudx/aaa/server/registration/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ public class Constants {
public static final String SQL_GET_RS_IDS_BY_URL =
"SELECT id, url FROM resource_server WHERE url = ANY($1::text[])";

public static final String SQL_GET_ALL_RS = "SELECT id, name, url, owner_id FROM resource_server";
public static final String SQL_GET_ALL_RS =
"SELECT id, name, url, owner_id, created_at AS \"createdAt\" FROM resource_server";

public static final String SQL_GET_CLIENTS_FORMATTED =
"SELECT client_name as \"clientName\", client_id as \"clientId\" "
Expand Down
Loading