yasithdev opened a new pull request, #164:
URL: https://github.com/apache/airavata-portals/pull/164

   ## Summary
   Migrate `CredentialSummaryViewSet` reads from the Thrift client to the gRPC 
credential facade, continuing the Track D read-family repoint. Reuses the 
existing serializer via a protobuf→Thrift-attribute adapter, so the portal's 
REST contract is byte-for-byte unchanged.
   
   - `get_list`, `get_instance`, and the `ssh`/`password` actions now call 
`request.airavata.credential.get_all_credential_summaries` / 
`get_credential_summary`.
   - Write actions (`create_ssh`, `create_password`, `destroy`) stay on Thrift 
pending D3.
   - New `credential_summary` adapter maps the protobuf message to the Thrift 
attribute names the serializer reads.
   - **Enum-by-name bridge:** proto and Thrift `SummaryType` assign different 
integers to the same member name (proto `SSH=1` vs Thrift `SSH=0`), so the 
adapter converts the enum by NAME (reusable `_thrift_enum` helper), and 
`proto_summary_type` converts the other direction for facade requests. Passing 
the raw proto int into the serializer's `ThriftEnumField` would have mislabeled 
SSH as PASSWD.
   - `CredentialSummarySerializer.userHasWriteAccess` resolves via the gRPC 
sharing helper.
   
   ## Test plan
   - `manage.py check` clean.
   - Empty list path returns 200 against the live backend (token auth → claims 
→ gRPC facade → adapter → serializer → JSON).
   - Structural adapter test: adapter exposes all seven Thrift fields; enum 
bridges by name (proto SSH(1) → Thrift SSH(0)); `persistedTime` stays an int.
   - Offline serializer render with real protobuf data confirms `type` labels 
as `SSH`/`PASSWD` and `persistedTime` renders ISO.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to