Skip to content

Commit

Permalink
web: set noopener and noreferrer on all external links (goauthentik#1…
Browse files Browse the repository at this point in the history
…0304)

Signed-off-by: Jens Langhammer <[email protected]>
  • Loading branch information
BeryJu authored Jul 1, 2024
1 parent f4ef8f5 commit 29f3e27
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion authentik/core/templates/login/base_full.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h1 class="pf-c-title pf-m-3xl">
</li>
{% endfor %}
<li>
<a href="https://goauthentik.io?utm_source=authentik">
<a rel="noopener noreferrer" target="_blank" href="https://goauthentik.io?utm_source=authentik">
{% trans 'Powered by authentik' %}
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion authentik/stages/email/templates/email/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
</tr>
<tr>
<td align="center">
Powered by <a href="https://goauthentik.io?utm_source=authentik&utm_medium=email">authentik</a>.
Powered by <a rel="noopener noreferrer" target="_blank" href="https://goauthentik.io?utm_source=authentik&utm_medium=email">authentik</a>.
</td>
</tr>
</table>
Expand Down
2 changes: 1 addition & 1 deletion internal/outpost/proxyv2/templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h1 class="pf-c-title pf-m-3xl">
<footer class="pf-c-login__footer">
<ul class="pf-c-list pf-m-inline">
<li>
<a href="https://goauthentik.io?utm_source=authentik_outpost&utm_campaign=proxy_error">
<a rel="noopener noreferrer" target="_blank" href="https://goauthentik.io?utm_source=authentik_outpost&utm_campaign=proxy_error">
Powered by authentik
</a>
</li>
Expand Down
9 changes: 8 additions & 1 deletion web/src/admin/admin-overview/AdminOverviewPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,14 @@ export class AdminOverviewPage extends AdminOverviewBase {

return html`<li>
${ex(
() => html`<a href="${url}" class="pf-u-mb-xl" target="_blank">${content}</a>`,
() =>
html`<a
href="${url}"
class="pf-u-mb-xl"
rel="noopener noreferrer"
target="_blank"
>${content}</a
>`,
() => html`<a href="${url}" class="pf-u-mb-xl" )>${content}</a>`,
)}
</li>`;
Expand Down
2 changes: 1 addition & 1 deletion web/src/admin/admin-overview/cards/VersionStatusCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ export class VersionStatusCard extends AdminStatusCard<Version> {
text = this.value.buildHash?.substring(0, 7);
link = `https://github.com/goauthentik/authentik/commit/${this.value.buildHash}`;
}
return html`<a href=${link} target="_blank">${text}</a>`;
return html`<a rel="noopener noreferrer" href=${link} target="_blank">${text}</a>`;
}
}
1 change: 1 addition & 0 deletions web/src/admin/blueprints/BlueprintForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export class BlueprintForm extends ModelForm<BlueprintInstance, string> {
${msg("See more about OCI support here:")}&nbsp;
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink(
"/developer-docs/blueprints/?utm_source=authentik#storage---oci",
)}"
Expand Down
1 change: 1 addition & 0 deletions web/src/admin/outposts/OutpostDeploymentModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class OutpostDeploymentModal extends ModalButton {
<a
target="_blank"
href="${docLink("/docs/outposts?utm_source=authentik#deploy")}"
rel="noopener noreferrer"
>${msg("View deployment documentation")}</a
>
</p>
Expand Down
9 changes: 6 additions & 3 deletions web/src/admin/outposts/OutpostForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,11 @@ export class OutpostForm extends ModelForm<Outpost, string> {
)}
</p>
<p class="pf-c-form__helper-text">
See
<a target="_blank" href="${docLink("/docs/outposts?utm_source=authentik")}"
>documentation</a
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink("/docs/outposts?utm_source=authentik")}"
>${msg("See documentation")}</a
>.
</p>
</ak-form-element-horizontal>
Expand Down Expand Up @@ -245,6 +247,7 @@ export class OutpostForm extends ModelForm<Outpost, string> {
${msg("See more here:")}&nbsp;
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink(
"/docs/outposts?utm_source=authentik#configuration",
)}"
Expand Down
1 change: 1 addition & 0 deletions web/src/admin/policies/expression/ExpressionPolicyForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export class ExpressionPolicyForm extends BasePolicyForm<ExpressionPolicy> {
<p class="pf-c-form__helper-text">
${msg("Expression using Python.")}
<a
rel="noopener noreferrer"
target="_blank"
href="${docLink("/docs/policies/expression?utm_source=authentik")}"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class PropertyMappingGoogleWorkspaceForm extends BasePropertyMappingForm<
${msg("Expression using Python.")}
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink("/docs/property-mappings/expression?utm_source=authentik")}"
>
${msg("See documentation for a list of all variables.")}
Expand Down
1 change: 1 addition & 0 deletions web/src/admin/property-mappings/PropertyMappingLDAPForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export class PropertyMappingLDAPForm extends BasePropertyMappingForm<LDAPPropert
${msg("Expression using Python.")}
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink("/docs/property-mappings/expression?utm_source=authentik")}"
>
${msg("See documentation for a list of all variables.")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class PropertyMappingMicrosoftEntraForm extends BasePropertyMappingForm<M
${msg("Expression using Python.")}
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink("/docs/property-mappings/expression?utm_source=authentik")}"
>
${msg("See documentation for a list of all variables.")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class PropertyMappingNotification extends ModelForm<NotificationWebhookMa
${msg("Expression using Python.")}
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink("/docs/property-mappings/expression?utm_source=authentik")}"
>
${msg("See documentation for a list of all variables.")}
Expand Down
1 change: 1 addition & 0 deletions web/src/admin/property-mappings/PropertyMappingRACForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export class PropertyMappingLDAPForm extends ModelForm<RACPropertyMapping, strin
${msg("Expression using Python.")}
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink(
"/docs/property-mappings/expression?utm_source=authentik",
)}"
Expand Down
1 change: 1 addition & 0 deletions web/src/admin/property-mappings/PropertyMappingSAMLForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class PropertyMappingSAMLForm extends BasePropertyMappingForm<SAMLPropert
${msg("Expression using Python.")}
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink("/docs/property-mappings/expression?utm_source=authentik")}"
>
${msg("See documentation for a list of all variables.")}
Expand Down
1 change: 1 addition & 0 deletions web/src/admin/property-mappings/PropertyMappingSCIMForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class PropertyMappingSCIMForm extends BasePropertyMappingForm<SCIMMapping
${msg("Expression using Python.")}
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink("/docs/property-mappings/expression?utm_source=authentik")}"
>
${msg("See documentation for a list of all variables.")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class PropertyMappingScopeForm extends BasePropertyMappingForm<ScopeMappi
${msg("Expression using Python.")}
<a
target="_blank"
rel="noopener noreferrer"
href="${docLink("/docs/property-mappings/expression?utm_source=authentik")}"
>
${msg("See documentation for a list of all variables.")}
Expand Down
2 changes: 1 addition & 1 deletion web/src/elements/Markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class Markdown extends AKElement {
const pathName = path.replace(".md", "");
const link = `docs/${baseName}${pathName}`;
const url = new URL(link, baseUrl).toString();
return `href="${url}" _target="blank"`;
return `href="${url}" _target="blank" rel="noopener noreferrer"`;
});
}

Expand Down
2 changes: 2 additions & 0 deletions web/src/flow/FlowExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ export class FlowExecutor extends Interface implements StageHost {
<li>
<a
href="https://goauthentik.io?utm_source=authentik&amp;utm_medium=flow"
target="_blank"
rel="noopener noreferrer"
>${msg("Powered by authentik")}</a
>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class LibraryPageApplicationEmptyList extends AKElement {
>
</div>
<div class="pf-c-empty-state__body">
<a href="${docLink("/docs/applications")}" target="_blank"
<a rel="noopener noreferrer" href="${docLink("/docs/applications")}" target="_blank"
>${msg("Refer to documentation")}</a
>
</div>
Expand Down

0 comments on commit 29f3e27

Please sign in to comment.