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

docs(UST-1374): middleware-headers extension #7154

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lukasborawski
Copy link
Collaborator

πŸ”— Linked issue

Internal task.

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSDoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR provides documentation for the @vsf-enterprise/middleware-headers package.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

changeset-bot bot commented May 14, 2024

⚠️ No Changeset found

Latest commit: e6407a9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@lukasborawski lukasborawski changed the title docs(ust-1374): middleware-headers extension docs(UST-1374): middleware-headers extension May 14, 2024
@lukasborawski lukasborawski requested a review from rohrig May 14, 2024 13:05
The extension also ships with a predefined `cacheControlRules` value. You can opt-in to using this by setting `cacheControl` to true.

```typescript
/* This is just for presentation purposes; the code is part of the package internals. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to explain what this value is in the docs? People would probably want to know before implementing it and it would be nicer to have here rather than making them dig through source code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mattmaribojoc You have it down below.

The Middleware Response Headers [extension](/middleware/guides/extensions) enables the addition of custom response headers, which can be particularly useful for managing application caching or establishing security rules.

With this extension, you can overwrite or set headers for specific API methods or apply them globally across your application.
It can be implemented for any Unified Alokai Backend integration that exposes API methods and allows the addition of custom headers.
Copy link
Contributor

Choose a reason for hiding this comment

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

How does a developer know if this is the case? Is it documented in each integration?

and allows the addition of custom headers

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rohrig Well, you'll notice where and when your headers were applied, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, let me be more clear. The docs state "It can be implemented for any Unified Alokai Backend integration that exposes API methods and allows the addition of custom headers."

How does the develop know if a given integration allows the addition of custom headers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rohrig All of the middleware allows.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What's your suggestion? Should I mention that? Where are we heading here? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

It was a legitimate question. If certain criteria must be met for this to be the case, then tell the developer how they can check it. If all integrations allow it then I would just say that. πŸ™‚

docs/content/3.middleware/2.guides/6.headers.md Outdated Show resolved Hide resolved
docs/content/3.middleware/2.guides/6.headers.md Outdated Show resolved Hide resolved
lukasborawski and others added 2 commits May 20, 2024 13:46
Co-authored-by: Richard Rohrig <45824492+rohrig@users.noreply.github.com>
Co-authored-by: Richard Rohrig <45824492+rohrig@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants