Routing problem after upgrading from LTS 8 to LTS 9 (RealURL -> Core routing) - typo3

After migrating our site from version 8 LTS to version 9 LTS, I have some configuration problems with the routing.
With RealURL we use the fixedPostVars, 'noMatch' => 'bypass'.
For example with this URL
http://Mysite/my-page/mysubpage
?tx_extension[action]=show
&tx_extension[controller]=Researchers
&tx_extension[fullName]=FirstNameWithÉ-LastName
&tx_extension[id]=37
&cHash=f077e6ab99d456c1d0431603186c32cf
We would like to have
http://Mysite/my-page/mysubpage/FirstNameWithC-LastNameWithe/37
For now I can get
http://Mysite/my-page/mysubpage/FirstNameWith%2527-LastName/37
?tx_extension%5Baction%5D=show
&tx_extension%5Bcontroller%5D=Researchers
&cHash=067d606ab30ace24e7cf347bdf89b011
I tried several configurations without success.
So how can I do to hide the controller, the action and the cHash.
Also, how to handle accented characters in URL.
This is my configuration for routeEnhancers
ListResearchers:
type: Plugin
limitToPages:
- 2706
- 2707
routePath: '/{name}/{uid}'
namespace: 'tx_extension'
_arguments:
name: 'fullName'
uid: 'id'

fullName has a too huge value space to be there without requirements/aspects. That will produce ?cHash.
In your case (string), you can use the PersistedAliasMapper or write a custom aspect.
uid will need requirements. (If you want to use it. You could get rid of it with PersistedAliasMapper)

Related

How to use conditions in OpenAPI Generator's Mustache templates?

I'm using OAS3 generator for Java as a Maven plugin to generate POJOs, controllers, delegates etc for my APIs with the Mustache templates from the openapi-generator repository: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache
I'm trying to edit this template so that the "#Controller" annotation is generated only if a condition is met. I've searched for multiple solutions for this and one of them was using "vendorExtensions".
I've made the following contract with x-generateController vendorExtension:
openapi: 3.0.0
info:
title: User API
description: API for user changes
contact:
name: xxx
url: xxx
email: xxx
license:
name: xxx
url: xxx
version: 1.0.0
tags:
- name: user
x-generateController: True
paths:
/users:
...
And then in the Mustache template file I have put the following:
{{#vendorExtensions.x-generateController}}
#Controller("{{classname}}")
{{/vendorExtensions.x-generateController}}
The generator works just fine without this condition but it seems like it doesn't take into account x-generateController. In fact, if I try to just place it as a comment like this:
// {{vendorExtensions.x-generateController}}
I get only "// " and an empty space. I've also tried putting it at the "endpoint level" and not in the "info level" and the problem is the same.
Is there anything more that I should've done in the configuration? Is there any alternative for a condition in the Mustache template?

Invalid label selector for kubernetes.core.k8s_info ansible inside operator

I am trying to filter out the the deployments which are not of my current version using ansible.
- name: Filter and get old deployment
kubernetes.core.k8s_info:
api_version: v1
kind: Deployment
namespace: "my_namespace"
label_selectors:
- curr_version notin (1.1.0)
register: old_deployments
Expected the output to give the list of deployments not having curr_version equal to 1.1.0
But I am getting this error
{"level":"error","ts":1665557104.5018141,"logger":"proxy","msg":"Unable to convert label selectors for the client","error":"invalid selector: [curr_version notin (1.1.0)]","stacktrace":"net/http.serverHandler.ServeHTTP\n\t/usr/lib/golang/src/net/http/server.go:2879\nnet/http.(*conn).serve\n\t/usr/lib/golang/src/net/http/server.go:1930"}
I referenced the pattern matching from here - https://github.com/abikouo/kubernetes.core/blob/08596fd05ba7190a04e7112270a38a0ce32095dd/plugins/module_utils/selector.py#L39
According to the pattern the above selector looks fine.
Even I tried to change the selector line as this (for testing purpose) -
- curr_version notin ("1.1.0")
But getting error as below.
{"level":"error","ts":1665555657.2939646,"logger":"requestfactory","msg":"Could not parse request","error":"unable to parse requirement: values[0][curr_version]: Invalid value: \"\\\"1.1.0\\\"\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')","stacktrace":"net/http.serverHandler.ServeHTTP\n\t/usr/lib/golang/src/net/http/server.go:2879\nnet/http.(*conn).serve\n\t/usr/lib/golang/src/net/http/server.go:1930"}
{"level":"error","ts":1665555657.2940943,"logger":"proxy","msg":"Unable to convert label selectors for the client","error":"invalid selector: [curr_version notin (\"1.1.0\")]","stacktrace":"net/http.serverHandler.ServeHTTP\n\t/usr/lib/golang/src/net/http/server.go:2879\nnet/http.(*conn).serve\n\t/usr/lib/golang/src/net/http/server.go:1930"}
I am not sure where am I wrong. I tried to find out the possible workaround but was not able to find it anywhere.
Although I am guessing second issue is just because the label selector is a string and the pattern doesn't allows to have quotes in the string. Which is understood.
Other information which might be useful
kubernetes.core.k8s version - 2.2.3
operator-sdk version - 1.23.0
ansible version - 2.9.27
python - 3.6.8
EDIT
I am using ose-ansible-operator image v4.10 to build an operator. I am unable to see the same error in local. But I am able to when going to operator.

FOSRestBundle routes versioning

I wanted to implement versioning of endpoints for my project.. turns out the FOSRestBundle implementation is not quite clear so I wanted to implement like follow:
Symfony 5.4
FOSRestBundle 3
see below annotation.yaml file:
v2_controllers:
resource: ../../src/Controller/V2/
type: annotation
prefix: /v2
name_prefix: 'api_v2_'
controllers:
resource: ../../src/Controller/
type: annotation
name_prefix: 'api_'
kernel:
resource: ../../src/Kernel.php
type: annotation
when I run this command php bin/console debug:router --show-controllers
I get the following result:
..
..
...
api_offer_list GET ANY ANY /offer-list/{productId}/{pageType}/ App\Controller\V2\OfferListV2Controller::offerListAction()
api_v2_offer_list GET ANY ANY /v2/offer-list/{productId}/{pageType}/ App\Controller\V2\OfferListV2Controller::offerListAction()
...
..
You can see that the new version is also overriding the older endpoint for some weird reasons
and finally here's my fos_rest.yaml config:
# Read the documentation: https://symfony.com/doc/master/bundles/FOSRestBundle/index.html
fos_rest:
param_fetcher_listener: true
Inside the controller directory, you need to create two separate directories, one for v1 and the other for v2 and this should solve the problem.
Controller/
v1/
v2/

Custom field name not showing in Filebeat

Below is how im trying to add a custom fiels name in my filebeat 7.2.0
filebeat.inputs:
- type: log
enabled: true
paths:
- D:\Oasis\Logs\Admin_Log\*
- D:\Oasis\Logs\ERA_Log\*
- D:\OasisServices\Logs\*
processors:
- add_fields:
fields:
application: oasis
and with this, im expecting a new field called application whose data entries will be 'oasis'.
But i dont get any.
I also tried
fields:
application: oasis/'oasis'
Help me with this.
If you want to add a customized field for every log, you should put the "fields" configuration in the same level of type. Try the following:
- type: log
enabled: true
paths:
- D:\Oasis\Logs\Admin_Log\*
- D:\Oasis\Logs\ERA_Log\*
- D:\OasisServices\Logs\*
fields.application: oasis
There are two ways to add custom fields on filebeat, using the fields option and using the add_fields processor.
To add fields using the fields option, your configuration needs to be something like the one below.
filebeat.inputs:
- type: log
paths:
- 'D:/path/to/your/files/*'
fields:
custom_field: 'custom field value'
fields_under_root: true
To add fields using the add_fields processor, you can try the following configuration.
filebeat.inputs:
- type: log
paths:
- 'D:/path/to/your/files/*'
processors:
- add_fields:
target: ''
fields:
custom_field: 'custom field value'
Both configurations will create a field named custom_field with the value custom field value in the root of your document.
The fields option can be used per input and the add_fields processor is applied to all the data exported by the filebeat instance.
Just remember to pay attention to the indentation of your configuration, if it is wrong filebeat won't work correctly or even start.

Do AWS-SAM templates support lifecycleconfiguration settings?

Does anyone know if SAM templates support Lifecycleconfigruation settings? I see within standard cloudformation definitions you can define the lifecycle of objects like:
BucketName: "Mys3Bucket"
LifecycleConfiguration:
Rules:
- AbortIncompleteMultipartUpload:
DaysAfterInitiation: 7
Status: Enabled
- ExpirationInDays: 14
...
But this seems to fail when used in a SAM template. Am I doing something wrong or is this not part of the serverless application model definition?
It works for me using the SAM CLI 1.15.0, although documentation seems sparse (hence my landing on this question while trying to figure it out).
The SAM template snippet below successfully creates a bucket and sets an appropriate lifecycle rule.
Resources:
Bucket1:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: !Sub "${BucketName}"
AccessControl: Private
VersioningConfiguration:
Status: Enabled
LifecycleConfiguration:
Rules:
- ExpirationInDays: 6
Status: Enabled