Skip to content
Open
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: 5 additions & 1 deletion web/Areas/Directory/Services/VMACSService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ namespace Viper.Areas.Directory.Services
{
public class VMACSService
{
// Fixed token required by the internal VMACS trust endpoint (not a rotating secret).
private const string VmacsAuthToken = "06232005";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsedwards Should this be a config value?


private static HttpClient sharedClient = new()
{
BaseAddress = new Uri("https://vmacs-vmth.vetmed.ucdavis.edu"),
Expand All @@ -21,7 +24,8 @@ protected VMACSService() { }
public static async Task<VMACSQuery?> Search(String? loginID)
{

string request = $"/trust/query.xml?dbfile=3&index=CampusLoginId&find={loginID}&format=CHRIS4&AUTH=06232005".ToString();
string encodedLoginId = Uri.EscapeDataString(loginID ?? string.Empty);
string request = $"/trust/query.xml?dbfile=3&index=CampusLoginId&find={encodedLoginId}&format=CHRIS4&AUTH={VmacsAuthToken}";
using HttpResponseMessage response = await sharedClient.GetAsync(request);
if (!response.IsSuccessStatusCode)
{
Expand Down
Loading