From 362f86dd6887647a7e876c0c6b6786a266a596dc Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Wed, 14 Jun 2023 13:46:41 +1200 Subject: [PATCH] DOC Quote all yaml service definitions (#285) Strings starting with a `%` must be explicitly quoted in YAML. --- .../01_Templates/03_Requirements.md | 4 ++-- en/02_Developer_Guides/05_Extending/05_Injector.md | 8 ++++---- en/02_Developer_Guides/05_Extending/06_Aspects.md | 12 ++++++------ .../09_Security/03_Authentication.md | 8 ++++---- .../09_Security/05_Rate_Limiting.md | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/en/02_Developer_Guides/01_Templates/03_Requirements.md b/en/02_Developer_Guides/01_Templates/03_Requirements.md index 00f536aa9..4ec329c5d 100644 --- a/en/02_Developer_Guides/01_Templates/03_Requirements.md +++ b/en/02_Developer_Guides/01_Templates/03_Requirements.md @@ -275,7 +275,7 @@ SilverStripe\Core\Injector\Injector: SilverStripe\Assets\Storage\GeneratedAssetHandler.custom-generated-assets: class: SilverStripe\Assets\Flysystem\GeneratedAssets properties: - Filesystem: %$League\Flysystem\Filesystem.custom-filesystem + Filesystem: '%$League\Flysystem\Filesystem.custom-filesystem' # Assign this generator to the requirements builder SilverStripe\View\Requirements_Backend: properties: @@ -370,7 +370,7 @@ SilverStripe\Core\Injector\Injector: SilverStripe\View\Requirements_Backend: properties: MinifyCombinedFiles: true - Minifier: %$MyProject\MyMinifier + Minifier: '%$MyProject\MyMinifier' ``` [alert] diff --git a/en/02_Developer_Guides/05_Extending/05_Injector.md b/en/02_Developer_Guides/05_Extending/05_Injector.md index 975773cd7..c2b71475e 100644 --- a/en/02_Developer_Guides/05_Extending/05_Injector.md +++ b/en/02_Developer_Guides/05_Extending/05_Injector.md @@ -316,12 +316,12 @@ name: MyController --- App\MyController: dependencies: - permissions: %$App\PermissionService + permissions: '%$App\PermissionService' SilverStripe\Core\Injector\Injector: App\PermissionService: class: App\RestrictivePermissionService properties: - database: %$App\MySQLDatabase + database: '%$App\MySQLDatabase' App\MySQLDatabase: constructor: 0: 'dbusername' @@ -432,7 +432,7 @@ SilverStripe\Core\Injector\Injector: class: App\JSONServiceImplementor properties: Serialiser: App\JSONSerialiser - App\GZIPJSONProvider: %$App\JSONServiceDefinition + App\GZIPJSONProvider: '%$App\JSONServiceDefinition' ``` `Injector::inst()->get(GZIPJSONProvider::class)` will then be an instance of `App\JSONServiceImplementor` with the injected @@ -448,7 +448,7 @@ SilverStripe\Core\Injector\Injector: App\Connector: properties: AsString: true - App\ServiceConnector: %$Connector + App\ServiceConnector: '%$Connector' ``` Both `App\Connector` and `App\ServiceConnector` will have the `AsString` property set to true, but the resulting diff --git a/en/02_Developer_Guides/05_Extending/06_Aspects.md b/en/02_Developer_Guides/05_Extending/06_Aspects.md index 37f165084..7cb28f59c 100644 --- a/en/02_Developer_Guides/05_Extending/06_Aspects.md +++ b/en/02_Developer_Guides/05_Extending/06_Aspects.md @@ -106,7 +106,7 @@ Next, this should be bound into an instance of the `Aspect` class SilverStripe\Core\Injector\Injector: MySQLWriteDbAspect: properties: - writeDb: %$WriteMySQLDatabase + writeDb: '%$WriteMySQLDatabase' ``` Next, we need to define the database connection that will be used for all non-write queries @@ -135,10 +135,10 @@ SilverStripe\Core\Injector\Injector: MySQLDatabase: class: AopProxyService properties: - proxied: %$ReadMySQLDatabase + proxied: '%$ReadMySQLDatabase' beforeCall: query: - - %$MySQLWriteDbAspect + - '%$MySQLWriteDbAspect' ``` The two important parts here are in the `properties` declared for the object. @@ -163,7 +163,7 @@ SilverStripe\Core\Injector\Injector: database: read_database MySQLWriteDbAspect: properties: - writeDb: %$WriteMySQLDatabase + writeDb: '%$WriteMySQLDatabase' WriteMySQLDatabase: class: MySQLDatabase constructor: @@ -175,10 +175,10 @@ SilverStripe\Core\Injector\Injector: MySQLDatabase: class: AopProxyService properties: - proxied: %$ReadMySQLDatabase + proxied: '%$ReadMySQLDatabase' beforeCall: query: - - %$MySQLWriteDbAspect + - '%$MySQLWriteDbAspect' ``` ## Changing what a method returns diff --git a/en/02_Developer_Guides/09_Security/03_Authentication.md b/en/02_Developer_Guides/09_Security/03_Authentication.md index 269326a18..c0ef9b78b 100644 --- a/en/02_Developer_Guides/09_Security/03_Authentication.md +++ b/en/02_Developer_Guides/09_Security/03_Authentication.md @@ -71,7 +71,7 @@ SilverStripe\Core\Injector\Injector: SilverStripe\Security\Security: properties: Authenticators: - myauthenticator: %$MyVendor\MyProject\Authenticator\MyAuthenticator + myauthenticator: '%$MyVendor\MyProject\Authenticator\MyAuthenticator' ``` If there is no authenticator registered, `Authenticator` will try to fall back on the default provided authenticator (`default`), which can be changed using the following config, replacing the MemberAuthenticator with your authenticator: ```yaml @@ -84,7 +84,7 @@ SilverStripe\Core\Injector\Injector: SilverStripe\Security\Security: properties: Authenticators: - default: %$MyVendor\MyProject\Authenticator\MyAuthenticator + default: '%$MyVendor\MyProject\Authenticator\MyAuthenticator' ``` By default, the `SilverStripe\Security\MemberAuthenticator\MemberAuthenticator` is seen as the default authenticator until it's explicitly set in the config. @@ -136,12 +136,12 @@ SilverStripe\Core\Injector\Injector: properties: LDAPSettings: - URL: https://my-ldap-location.com - CascadeInTo: %$SilverStripe\Security\MemberAuthenticator\SessionAuthenticationHandler + CascadeInTo: '%$SilverStripe\Security\MemberAuthenticator\SessionAuthenticationHandler' SilverStripe\Security\AuthenticationHandler: class: SilverStripe\Security\RequestAuthenticationHandler properties: Handlers: - ldap: %$MyProject\LDAP\Authenticator\LDAPAuthenticator + ldap: '%$MyProject\LDAP\Authenticator\LDAPAuthenticator' ``` CascadeInTo is used to defer login or logout actions to other authenticators, after the first one has been logged in. In the example of LDAP authenticator, this is useful to check e.g. the validity of the Session (is the user still logged in?) and if not, or it's LDAP login period has expired, only then validate against the external service again, limiting the amount of requests to the external service. diff --git a/en/02_Developer_Guides/09_Security/05_Rate_Limiting.md b/en/02_Developer_Guides/09_Security/05_Rate_Limiting.md index 85e4dc82d..50eb92134 100644 --- a/en/02_Developer_Guides/09_Security/05_Rate_Limiting.md +++ b/en/02_Developer_Guides/09_Security/05_Rate_Limiting.md @@ -53,7 +53,7 @@ Or if you want to apply your middleware to a specific route: SilverStripe\Control\Director: rules: special/section: - Controller: %$MyRateLimitedController + Controller: '%$MyRateLimitedController' ``` ## Applying rate limiting across an entire application