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

Automate lambda list and revise lambda page #1127

Merged
merged 12 commits into from
Dec 10, 2021
2 changes: 1 addition & 1 deletion DocsDevREADME.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,6 @@ Some sections are better suited to being driven by data. Jekyll makes this easy

Examples of that are the customers page and the quotes widget.

You can also go from asciidoc to liquid syntax. Examples of that are the 'related posts' section mentioned above, the themes form/api template docs, and the example apps.
You can also go from asciidoc to liquid syntax. Examples of that are the 'related posts' section mentioned above, the themes form/api template docs, and the example apps. Note that you can't use liquid syntax in any include files. See https://github.com/asciidoctor/jekyll-asciidoc/issues/166 for more details about this issue.
mooreds marked this conversation as resolved.
Show resolved Hide resolved

The theme pages are kinda complex because they a data file which is iterated over and conditionally generates asciidoc. This ascii doc is then included. Because you can't do includes of includes (that I could figure out), the liquid file has to be included in the top level file.
12 changes: 9 additions & 3 deletions build.savant
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
* Copyright (c) 2016-2021, FusionAuth, All Rights Reserved
*/

fusionauthWebsiteStyleVersion = "0.3.41"
fusionauthWebsiteStyleVersion = "0.3.42"

project(group: "io.fusionauth", name: "fusionauth-site", version: "3.0.0", licenses: ["ApacheV2_0"]) {
workflow {
standard()
fetch {
cache()
url(url: "https://repository.savantbuild.org")
}
publish {
cache()
}
}

publishWorkflow {
subversion(repository: "http://svn.inversoft.org/savant")
subversion(repository: "https://svn.savantbuild.org")
}

dependencies {
Expand Down
97 changes: 97 additions & 0 deletions site/_data/lambdas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# list of lambdas

# field data:
# displayName: User friendly name
# shortDisplayName: User friendly name, shortened. Used in nav menu if available.
# menuIcon: font-awesome css classes, like fa-apple fab. used in nav menu.
# typeText: what is the API type name. Should match the java enum value from https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/domain/io.fusionauth.domain.LambdaType.json
# version: version where it was introduced. like 1.26.0. Omit this key if we don't have a version this field was introduced in (or it was introduced when lambdas were introduced).
# docLink: relative link to the lambda doc page (not the API doc)

- displayName: JWT Populate
typeText: JWTPopulate
docLink: /docs/v1/tech/lambdas/jwt-populate/
menuIcon: fa-chart-scatter fas
- displayName: OpenID Connect Reconcile
typeText: OpenIDReconcile
docLink: /docs/v1/tech/lambdas/openid-connect-response-reconcile/
menuIcon: fa-openid fab
- displayName: SAML v2 Reconcile
typeText: SAMLv2Reconcile
docLink: /docs/v1/tech/lambdas/samlv2-response-reconcile/
menuIcon: fa-id-badge fal
- displayName: SAML v2 Populate
typeText: SAMLv2Populate
docLink: /docs/v1/tech/lambdas/samlv2-populate-reconcile/
menuIcon: fa-id-badge fal
- displayName: External JWT Reconcile
typeText: ExternalJWTReconcile
docLink: /docs/v1/tech/lambdas/external-jwt-reconcile/
version: 1.17.0
menuIcon: fa-empire fab
- displayName: Apple Reconcile
typeText: AppleReconcile
docLink: /docs/v1/tech/lambdas/apple-reconcile/
version: 1.17.0
menuIcon: fa-apple fab
- displayName: Facebook Reconcile
typeText: FacebookReconcile
docLink: /docs/v1/tech/lambdas/facebook-reconcile/
version: 1.17.0
menuIcon: fa-facebook fab
- displayName: Google Reconcile
typeText: GoogleReconcile
docLink: /docs/v1/tech/lambdas/google-reconcile/
version: 1.17.0
menuIcon: fa-google fab
- displayName: HYPR Reconcile
typeText: HYPRReconcile
docLink: /docs/v1/tech/lambdas/hypr-reconcile/
version: 1.17.0
menuIcon: fa-fingerprint fal
- displayName: Twitter Reconcile
typeText: TwitterReconcile
docLink: /docs/v1/tech/lambdas/twitter-reconcile/
version: 1.17.0
menuIcon: fa-twitter fab
- displayName: LDAP Connector Reconcile
typeText: LDAPConnectorReconcile
docLink: /docs/v1/tech/lambdas/ldap-connector-reconcile/
version: 1.18.0
menuIcon: fa-project-diagram fas
- displayName: Client Credentials JWT Populate
shortDisplayName: Client Cred. JWT Populate
typeText: ClientCredentialsJWTPopulate
docLink: /docs/v1/tech/lambdas/client-credentials-jwt-populate/
version: 1.28.0
menuIcon: fa-user-robot fas
- displayName: Epic Games Reconcile
typeText: EpicGamesReconcile
docLink: /docs/v1/tech/lambdas/epic-games-reconcile/
version: 1.28.0
menuIcon: fa-gamepad fal
- displayName: LinkedIn Reconcile
typeText: LinkedInReconcile
docLink: /docs/v1/tech/lambdas/linkedin-reconcile/
version: 1.23.0
menuIcon: fa-linkedin fab
- displayName: Steam Reconcile
typeText: SteamReconcile
docLink: /docs/v1/tech/lambdas/steam-reconcile/
version: 1.28.0
menuIcon: fa-steam fab
- displayName: Sony Playstation Network Reconcile
typeText: SonyPSNReconcile
docLink: /docs/v1/tech/lambdas/sony-playstation-network-reconcile/
version: 1.28.0
menuIcon: fa-playstation fab
- displayName: Twitch Reconcile
typeText: TwitchReconcile
docLink: /docs/v1/tech/lambdas/twitch-reconcile/
version: 1.28.0
menuIcon: fa-twitch fab
- displayName: Xbox Reconcile
typeText: XboxReconcile
docLink: /docs/v1/tech/lambdas/xbox-reconcile/
version: 1.28.0
menuIcon: fa-xbox fab
2 changes: 1 addition & 1 deletion site/_includes/_head.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<!-- CSS -->
<link rel="stylesheet" href="/assets/css/font-awesome-5.12.1.min.css"/>
<link rel="stylesheet" href="/assets/css/fusionauth-website-style-0.3.41.css">
<link rel="stylesheet" href="/assets/css/fusionauth-website-style-0.3.42.css">

<!-- Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700&display=swap">
Expand Down
4 changes: 4 additions & 0 deletions site/_includes/docs/_lambda_toc.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{% assign lambdas = site.data.lambdas | sort: 'displayName' %}
{% for lambda in lambdas %}
* link:{{lambda.docLink}}[{{lambda.displayName}}]
{% endfor %}
21 changes: 21 additions & 0 deletions site/_includes/docs/_lambda_type_api.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% assign showRequired = false %}{% if requestParameter != "true" %}
{% if singleRequest == "true" %}
{% assign fieldPrefix = 'lambda.' %}
{% assign showRequired = 'true' %}
{% elsif singleResponse == "true" %}
{% assign fieldPrefix = 'lambda.' %}
{% else %}
{% assign fieldPrefix = 'lambda``[x]``.' %}
{%endif %}
{% else %}
{% assign showRequired = 'true' %}
{% assign fieldPrefix = '' %}
{%endif %}

[field]#{{fieldPrefix}}type# [type]#[String]# {% if showRequired %}[required]#Required#{% endif %}::
The lambda type. The possible values are:
+
{% assign lambdas = site.data.lambdas | sort: 'typeText' %}
{% for lambda in lambdas %}
* `{{lambda.typeText}}` {%if singleRequest == "true" and lambda.version %}[since]#Available since {{lambda.version}}#{%endif%}
{% endfor %}
25 changes: 5 additions & 20 deletions site/_layouts/doc.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -284,26 +284,11 @@
<a href="#" class="sub-menu"><i class="fal fa-fw fa-code"></i> Lambdas <i class="fal fa-chevron-{% if page.url contains "/lambdas/" %}up{% else %}down{% endif %} fa-fw"></i></a>
<ul>
<li {% if page.url == "/docs/v1/tech/lambdas/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/">Overview</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/apple-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/apple-reconcile/"><i class="fab fa-fw fa-apple"></i> Apple Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/client-credentials-jwt-populate/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/client-credentials-jwt-populate/"><i class="fas fa-fw fa-user-robot"></i> Client Cred. JWT Populate</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/epic-games-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/epic-games-reconcile/"><i class="fal fa-fw fa-gamepad"></i> Epic Games Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/external-jwt-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/external-jwt-reconcile/"><i class="fab fa-fw fa-empire"></i> External JWT Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/facebook-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/facebook-reconcile/"><i class="fab fa-fw fa-facebook"></i> Facebook Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/google-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/google-reconcile/"><i class="fab fa-fw fa-google"></i> Google Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/hypr-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/hypr-reconcile/"><i class="fal fa-fw fa-fingerprint"></i> HYPR Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/jwt-populate/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/jwt-populate/"><i class="fad fa-fw fa-chart-scatter"></i>JWT Populate</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/ldap-connector-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/ldap-connector-reconcile/"><i class="fas fa-fw fa-project-diagram"></i> LDAP Connector Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/linkedin-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/linkedin-reconcile/"><i class="fab fa-fw fa-linkedin"></i> LinkedIn Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/openid-connect-response-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/openid-connect-response-reconcile/"><i class="fab fa-openid"></i> OpenID Connect Reconcile</a></li>
{% comment %}<li {% if page.url == "/docs/v1/tech/lambdas/nintendo-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/nintendo-reconcile/">Nintendo Reconcile</a></li>{% endcomment %}
<li {% if page.url == "/docs/v1/tech/lambdas/samlv2-response-populate/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/samlv2-response-populate/"><i class="fal fa-fw fa-id-badge"></i> SAML v2 Populate</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/samlv2-response-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/samlv2-response-reconcile/"><i class="fal fa-fw fa-id-badge"></i> SAML v2 Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/sony-playstation-network-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/sony-playstation-network-reconcile/"><i class="fab fa-fw fa-playstation"></i> Sony PSN Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/steam-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/steam-reconcile/"><i class="fab fa-fw fa-steam"></i> Steam Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/twitch-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/twitch-reconcile/"><i class="fab fa-fw fa-twitch"></i> Twitch Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/twitter-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/twitter-reconcile/"><i class="fab fa-fw fa-twitter"></i> Twitter Reconcile</a></li>
<li {% if page.url == "/docs/v1/tech/lambdas/xbox-reconcile/" %}class="active"{% endif %}><a href="/docs/v1/tech/lambdas/xbox-reconcile/"><i class="fab fa-fw fa-xbox"></i> Xbox Reconcile</a></li>

{% comment %}Don't add a new lambda here. Add it to the site/_data/lambdas.yaml file and the menu item will be generated.{% endcomment %}
{% assign lambdas = site.data.lambdas | sort: 'displayName' %}
{% for lambda in lambdas %}
<li {% if page.url == lambda.docLink %}class="active"{% endif %}><a href="{{lambda.docLink}}"><i class="fa-fw {{lambda.menuIcon}}"></i> {%if lambda.shortDisplayName%}{{lambda.shortDisplayName}}{%else%}{{lambda.displayName}}{%endif%}</a></li>
{% endfor %}
</ul>
</li>
<li {% if page.url contains "/tech/identity-providers/" %} class="open"{% endif %}>
Expand Down
2 changes: 1 addition & 1 deletion site/assets/css/fusionauth-login-style.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions site/docs/v1/tech/apis/_lambda-request-body-suffix.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[source,json]
.Example Request JSON
----
include::../../../src/json/lambdas/request.json[]
----
20 changes: 0 additions & 20 deletions site/docs/v1/tech/apis/_lambda-request-body.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,3 @@ Whether or not this Lambda is enabled.
[field]#lambda.name# [type]#[String]# [required]#Required#::
The name of the lambda.

[field]#lambda.type# [type]#[String]# [required]#Required#::
The lambda type. The possible values are:
+
* `JWTPopulate`
* `OpenIDReconcile`
* `SAMLv2Reconcile`
* `SAMLv2Populate`
* `AppleReconcile` &nbsp; [since]#Available since 1.17.0#
* `ExternalJWTReconcile` &nbsp; [since]#Available since 1.17.0#
* `FacebookReconcile` &nbsp; [since]#Available since 1.17.0#
* `GoogleReconcile` &nbsp; [since]#Available since 1.17.0#
* `HYPRReconcile` &nbsp; [since]#Available since 1.17.0#
* `TwitterReconcile` &nbsp; [since]#Available since 1.17.0#
* `LDAPConnectorReconcile` &nbsp; [since]#Available since 1.18.0#

[source,json]
.Example Request JSON
----
include::../../../src/json/lambdas/request.json[]
----
6 changes: 6 additions & 0 deletions site/docs/v1/tech/apis/_lambda-response-body-suffix.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[source,json]
.Example Response JSON
----
include::../../../src/json/lambdas/response.json[]
----
20 changes: 0 additions & 20 deletions site/docs/v1/tech/apis/_lambda-response-body.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,3 @@ The link:/docs/v1/tech/reference/data-types/#instants[instant] that the lambda w
[field]#lambda.name# [type]#[String]#::
The name of the lambda.

[field]#lambda.type# [type]#[String]#::
The lambda type. The possible values are:
+
* `JWTPopulate`
* `OpenIDReconcile`
* `SAMLv2Reconcile`
* `SAMLv2Populate`
* `AppleReconcile` &nbsp; [since]#Available since 1.17.0#
* `ExternalJWTReconcile` &nbsp; [since]#Available since 1.17.0#
* `FacebookReconcile` &nbsp; [since]#Available since 1.17.0#
* `GoogleReconcile` &nbsp; [since]#Available since 1.17.0#
* `HYPRReconcile` &nbsp; [since]#Available since 1.17.0#
* `TwitterReconcile` &nbsp; [since]#Available since 1.17.0#
* `LDAPConnectorReconcile` &nbsp; [since]#Available since 1.18.0#

[source,json]
.Example Response JSON
----
include::../../../src/json/lambdas/response.json[]
----
6 changes: 6 additions & 0 deletions site/docs/v1/tech/apis/_lambda-responses-body-suffix.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[source,json]
.Example Response JSON
----
include::../../../src/json/lambdas/responses.json[]
----
20 changes: 0 additions & 20 deletions site/docs/v1/tech/apis/_lambda-responses-body.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,3 @@ The link:/docs/v1/tech/reference/data-types/#instants[instant] that the lambda w
[field]#lambda``[x]``.name# [type]#[String]#::
The name of the lambda.

[field]#lambda``[x]``.type# [type]#[String]#::
The lambda type. The possible values are:
+
* `JWTPopulate`
* `OpenIDReconcile`
* `SAMLv2Reconcile`
* `SAMLv2Populate`
* `AppleReconcile` &nbsp; [since]#Available since 1.17.0#
* `ExternalJWTReconcile` &nbsp; [since]#Available since 1.17.0#
* `FacebookReconcile` &nbsp; [since]#Available since 1.17.0#
* `GoogleReconcile` &nbsp; [since]#Available since 1.17.0#
* `HYPRReconcile` &nbsp; [since]#Available since 1.17.0#
* `TwitterReconcile` &nbsp; [since]#Available since 1.17.0#
* `LDAPConnectorReconcile` &nbsp; [since]#Available since 1.18.0#

[source,json]
.Example Response JSON
----
include::../../../src/json/lambdas/responses.json[]
----
36 changes: 22 additions & 14 deletions site/docs/v1/tech/apis/lambdas.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: doc
title: Lambdas APIs
description: APIs for creating, retrieving, updating and deleting lambdas
---
:page-liquid:

== Overview

Expand Down Expand Up @@ -46,13 +47,21 @@ The Id to use for the new Lambda. If not specified a secure random UUID will be

include::docs/v1/tech/apis/_lambda-request-body.adoc[]

{%capture singleRequest %}true{% endcapture %}
{% include docs/_lambda_type_api.liquid %}
include::docs/v1/tech/apis/_lambda-request-body-suffix.adoc[]
{%capture singleRequest %}{% endcapture %}

=== Response

The response for this API contains the Lambda that was created.

include::docs/v1/tech/apis/_standard-post-response-codes.adoc[]

{%capture singleResponse %}true{% endcapture %}
include::docs/v1/tech/apis/_lambda-response-body.adoc[]
{% include docs/_lambda_type_api.liquid %}
include::docs/v1/tech/apis/_lambda-response-body-suffix.adoc[]

== Retrieve a Lambda

Expand All @@ -79,20 +88,9 @@ link:/docs/v1/tech/apis/authentication#api-key-authentication[icon:lock[type=fas
==== Request Parameters

[.api]
[field]#type# [type]#[String]# [required]#Required#::
The type of Lambdas to retrieve. The possible values are:
+
* `JWTPopulate`
* `OpenIDReconcile`
* `SAMLv2Reconcile`
* `SAMLv2Populate`
* `AppleReconcile` &nbsp; [since]#Available since 1.17.0#
* `ExternalJWTReconcile` &nbsp; [since]#Available since 1.17.0#
* `FacebookReconcile` &nbsp; [since]#Available since 1.17.0#
* `GoogleReconcile` &nbsp; [since]#Available since 1.17.0#
* `HYPRReconcile` &nbsp; [since]#Available since 1.17.0#
* `TwitterReconcile` &nbsp; [since]#Available since 1.17.0#
* `LDAPConnectorReconcile` &nbsp; [since]#Available since 1.18.0#
{%capture requestParameter %}true{% endcapture %}
{% include docs/_lambda_type_api.liquid %}
{%capture requestParameter %}{% endcapture %}

[.api-authentication]
link:/docs/v1/tech/apis/authentication#api-key-authentication[icon:lock[type=fas]] Retrieve a Lambda by Id
Expand All @@ -114,9 +112,15 @@ The response for this API contains either a single Lambda or all of the Lambdas.

include::docs/v1/tech/apis/_standard-get-response-codes.adoc[]

{%capture singleResponse %}true{% endcapture %}
include::docs/v1/tech/apis/_lambda-response-body.adoc[]
{% include docs/_lambda_type_api.liquid %}
include::docs/v1/tech/apis/_lambda-response-body-suffix.adoc[]

{%capture singleResponse %}false{% endcapture %}
include::docs/v1/tech/apis/_lambda-responses-body.adoc[]
{% include docs/_lambda_type_api.liquid %}
include::docs/v1/tech/apis/_lambda-responses-body-suffix.adoc[]

== Update a Lambda

Expand All @@ -142,14 +146,18 @@ include::docs/v1/tech/apis/_patch-support.adoc[]
The unique Id of the Lambda to update.

include::docs/v1/tech/apis/_lambda-put-request-body.adoc[]
// no type include here because you can't change the type of a lambda after you create it.

=== Response

The response for this API contains the Lambda that was updated.

include::docs/v1/tech/apis/_standard-put-response-codes.adoc[]

{%capture singleResponse %}true{% endcapture %}
include::docs/v1/tech/apis/_lambda-response-body.adoc[]
{% include docs/_lambda_type_api.liquid %}
include::docs/v1/tech/apis/_lambda-response-body-suffix.adoc[]

== Delete a Lambda

Expand Down
Loading