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

fix: auth #3

Merged
merged 2 commits into from
Sep 9, 2024
Merged
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: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ NEXT_OTEL_VERBOSE=0
# Inference
INFERENCE_URL=http://127.0.0.1:8001
INFERENCE_MODEL_NAME=summarizer_medical_journals_qa
INFERENCE_MODEL_VERSION=120240905190000
INFERENCE_MODEL_VERSION=120240905190000

# Atlas credentials
ATLAS_ROOT_USER=root
ATLAS_ROOT_PASSWORD=changeme
9 changes: 6 additions & 3 deletions src/components/article-hit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ export const ArticleHit = ({ hit }: { hit: Hit<Article> }) => {
<h1 className="mb-2 text-lg font-medium text-foreground">
{hit.resource.data.title}
</h1>
<p className="text-sm text-muted-foreground">
{highestHitsHighlight && <HtmlDisplay html={highestHitsHighlight} />}
</p>
{highestHitsHighlight && (
<HtmlDisplay
className="text-sm text-muted-foreground"
html={highestHitsHighlight}
/>
)}
{/* {passageHighlight && <PassageHighlight highlight={passageHighlight} />} */}
</article>
);
Expand Down
3 changes: 3 additions & 0 deletions src/pages/api/[...path].ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ async function proxy(req: NextApiRequest, res: NextApiResponse) {
req.url = req.url.replace('/api', '');
}

// We need to add basic auth
req.headers.authorization = `Basic ${Buffer.from(`${process.env.ATLAS_ROOT_USER}:${process.env.ATLAS_ROOT_PASSWORD}`).toString('base64')}`;

proxyServer.web(
req,
res,
Expand Down
Loading