Customizations

Hi Toby,
Great extension! Thanx.
1 Question I have though is that I need to change the CSP header you default have. How can I do modifications to that?
1 Remark I have that with these current settings A+ is not reached yet. A is, probably because the new feature policy is not implemented yet.
Regards

Hey owingruters! Sorry for the delayed reply. The easiest way to modify would be to fork the project and add what you need to the CSP header. I don't know that I'll add the Feature Policy header as it's pretty implementation specific & I'm likely moving away from this extension since MSFT is making good progress in implementing some of the functionality into the web apps natively.
Thanks for the feedback!

Thanx Toby. Do you have some more information on the progress MS is making?
A link or something with what's there and what are the plans?
Thanx again. Love the work you did
Owin
Op vr 31 aug. 2018 05:49 schreef Toby Meyer<EMAIL_ADDRESS>
Hey owingruters! Sorry for the delayed reply. The easiest way to modify
would be to fork the project and add what you need to the CSP header. I
don't know that I'll add the Feature Policy header as it's pretty
implementation specific & I'm likely moving away from this extension since
MSFT is making good progress in implementing some of the functionality into
the web apps natively.
Thanks for the feedback!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/toby-meyer/AzSecurityPackRedirectAndHeadersMed/issues/5#issuecomment-417543775,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALCR1_Jn2jacdk1sdIz34U2_BGKgl2Qrks5uWLJDgaJpZM4WGgah
.

Hey @owingruters ; here's an example of something recently introduced:
https://blogs.msdn.microsoft.com/benjaminperkins/2017/11/30/how-to-make-an-azure-app-service-https-only/
... which forces https for the PaaS service in question. This an other improvements have made me think it may be better to force some of the stuff we do in this plugin (CSP, etc) into the CICD pipeline for the code & leverage the newer security features introduced in Azure.


Krakend with localstack

how to test lambda function which is created in localstack in krakend.
i tried below code.
{       "endpoint": "/call-a-lambda/{lambda}",       "backend": [         {           "extra_config": {             "github.com/devopsfaith/krakend-lambda": {               "function_param_name": "lambda_handler",               "region": "ap-south-1",               "max_retries": 1             }           },           "host": [             "http://localhost:4574"           ]         }       ]     }

I think this is what you're looking for: https://github.com/devopsfaith/krakend-lambda/blob/master/README.md

@kpacha through cli its working but how to configure this in krakend.json as i tried but no success

the documentation regarding how to configure krakend for AWS lambda: https://www.krakend.io/docs/backends/lambda/#lambda-configuration
for localstack, you'll also need to add these two properties to the section:
	"region":   "us-east-1",
	"endpoint": "http://<IP_ADDRESS>:4574"

being the endpoint the addr to your lambda service on localstack

@kpacha
 {
      "endpoint": "/call-a-lambda/{lambda}",
      "method": "GET",
      "backend": [
        {
          "extra_config": {
            "github.com/devopsfaith/krakend-lambda": {
              "function_param_name": "lambda",
              "region": "ap-south-1",
              "max_retries": 3
            }
          },
          "host": [
            "http://localhost"
          ]
        }
      ]
    }

added above config and added aws credentials  in aws config
on curl request i get following error
[GIN] 2020/09/28 - 18:22:43 | 500 |     186.839µs |             ::1 | GET      /call-a-lambda/krakend-poc-lambda
Error #01: InvalidParameter: 1 validation error(s) found.

minimum field size of 1, InvokeInput.FunctionName.

the documentation is wrong on that point. It should be "function_param_name": "Lambda", as stated at the amqp documentation:

Parameters' first character uppercased
Notice the capitalization of the first letter of the parameter names at the configuration below. For instance, when an endpoint parameter is defined as {route}, define it in the config as Route.

@kpacha
So after hitting on /call-a-lambda/{lambda}
we are getting status code - 200
But nothing in response
Expected output should be - {"statusCode": 200, "resp": "Hello from Lambda!"}
Please find the config below
{
"endpoint": "/call-a-lambda/{lambda}",
"method": "GET",
"output_encoding": "json",
"backend": [
{
"extra_config": {
"github.com/devopsfaith/krakend-lambda": {
"function_param_name": "Lambda",
"region": "ap-south-1",
"max_retries": 3
}
},
"host": [
"http://localhost:9000"
]
}
]
}
And after adding below config
{
"endpoint": "/call-a-lambda/{lambda}",
"method": "GET",
"output_encoding": "json",
"backend": [
{
"encoding": "json",
"extra_config": {
"github.com/devopsfaith/krakend-lambda": {
"function_param_name": "Lambda",
"region": "ap-south-1",
"max_retries": 3
}
},
"host": [
"http://localhost:9000"
]
}
]
}
we are getting this in response:
{"errorMessage":"'str' object has no attribute 'get'","errorType":"AttributeError","stackTrace":[["/var/runtime/awslambda/bootstrap.py",303,"handle_event_request","context = LambdaContext(invokeid, context_objs, client_context, invoked_function_arn)"],["/var/runtime/awslambda/bootstrap.py",473,"init","self.client_context.client = make_obj_from_dict(Client, self.client_context.client)"],["/var/runtime/awslambda/bootstrap.py",432,"make_obj_from_dict","set_obj_from_dict(obj, _dict)"],["/var/runtime/awslambda/bootstrap.py",440,"set_obj_from_dict","setattr(obj, field, _dict.get(field, None))"]]}

@kpacha
by adding first letter uppercase it worked but I'm not getting the response. I tried same lambda in aws api gateway it worked,
i used below configuration. Please help
{
      "endpoint": "/call-a-lambda/{lambda}",
      "method": "GET",
      "output_encoding": "no-op",
      "backend": [
        {
          "encoding": "no-op",
          "extra_config": {
            "github.com/devopsfaith/krakend-lambda": {
              "function_param_name": "Lambda",
              "region": "ap-south-1",
              "max_retries": 1
            }
          },
          "host": [
            "http://localhost:9000"
          ]
        }
      ]
    }

lambda functions are expected to return a json payload, so you can't go with no-op pipes.
the backend will always use a json decoder, no matter what encoding value is passed at the configuration.
the endpoint is able to manipulate the generated data and return it to the client using any of the output_encoding options but the no-op

@kpacha
i tried using json and i got error
{"errorMessage":"'str' object has no attribute 'get'","errorType":"AttributeError","stackTrace":[["/var/runtime/awslambda/bootstrap.py",303,"handle_event_request","context = LambdaContext(invokeid, context_objs, client_context, invoked_function_arn)"],["/var/runtime/awslambda/bootstrap.py",473,"init","self.client_context.client = make_obj_from_dict(Client, self.client_context.client)"],["/var/runtime/awslambda/bootstrap.py",432,"make_obj_from_dict","set_obj_from_dict(obj, _dict)"],["/var/runtime/awslambda/bootstrap.py",440,"set_obj_from_dict","setattr(obj, field, _dict.get(field, None))"]]}
and same lambda function works in AWS api gateway

is your lambda returning a json payload? is that the payload it is returning and the result krakend is giving to you?

@kpacha
I used below lambda function:
import json
def lambda_handler(event, context):
    # TODO implement
    x =  {"name":"John", "age":30, "city":"New York"}
    headers = {
        'Access-Control-Allow-Origin': '*',
        'Access-Control-Allow-Headers': 'Content-Type',
        'Access-Control-Allow-Methods': 'OPTIONS,POST,GET'
    }
    return {
        'statusCode': 200,
        'body': json.dumps(x),
        'headers': headers,
        'isBase64Encoded': True
    }

i also tried returning plain json paylod as {"name":"John", "age":30, "city":"New York"}
And this is my krakend json file:
{
  "version": 2,
  "extra_config": {
    "github_com/devopsfaith/krakend-cors": {
      "allow_origins": [
        "*"
      ],
      "expose_headers": [
        "Content-Length",
        "*"
      ],
      "max_age": "12h",
      "allow_methods": [
        "GET",
        "HEAD",
        "POST",
        "PUT",
        "DELETE",
        "CONNECT",
        "OPTIONS",
        "TRACE",
        "PATCH"
      ],
      "allow_headers": [
        "*"
      ]
    }
  },
  "timeout": "9000ms",
  "cache_ttl": "300s",
  "output_encoding": "json",
  "name": "test_ops",
  "port": 9000,
  "host": [
    "http://localhost:5005"
  ],
  "endpoints": [
    {
      "endpoint": "/lambda/{lambda}",
      "output_encoding": "json",
      "backend": [
        {
          "extra_config": {
            "github.com/devopsfaith/krakend-lambda": {
              "function_param_name": "Lambda",
              "region": "ap-south-1",
              "max_retries": 1
            }
          }
        }
      ]
    }
  ]
}

After running the curl request i got below error: curl -i "http://localhost:9000/lambda/krakend-poc-lambda"
HTTP/1.1 200 OK
Cache-Control: public, max-age=300
Content-Type: application/json; charset=utf-8
Vary: Origin
X-Amz-Executed-Version: $LATEST
X-Krakend: Version 1.1.1
X-Krakend-Completed: true
Date: Wed, 30 Sep 2020 15:02:11 GMT
Content-Length: 602

{"errorMessage":"'str' object has no attribute 'get'","errorType":"AttributeError","stackTrace":[["/var/runtime/awslambda/bootstrap.py",303,"handle_event_request","context = LambdaContext(invokeid, context_objs, client_context, invoked_function_arn)"],["/var/runtime/awslambda/bootstrap.py",473,"__init__","self.client_context.client = make_obj_from_dict(Client, self.client_context.client)"],["/var/runtime/awslambda/bootstrap.py",432,"make_obj_from_dict","set_obj_from_dict(obj, _dict)"],["/var/runtime/awslambda/bootstrap.py",440,"set_obj_from_dict","setattr(obj, field, _dict.get(field, None))"]]}

please help me where i went wrong

please, can you run
aws lambda invoke --function-name krakend-poc-lambda out.json
cat out.json

and
aws lambda invoke --function-name krakend-poc-lambda --client-context eyJjbGllbnQiOiJLcmFrZW5EIiwgInZlcnNpb24iOiIxLjEuMSJ9 out2.json
cat out2.json

and paste the results?

@kpacha
on running aws lambda invoke --function-name krakend-poc-lambda out.json
Result:
{"statusCode": 200, "body": {"name": "John", "age": 30, "city": "New York"}, "headers": {"Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "Content-Type", "Access-Control-Allow-Methods": "OPTIONS,POST,GET"}, "isBase64Encoded": true}

And
on running : aws lambda invoke --function-name krakend-poc-lambda --client-context eyJjbGllbnQiOiJLcmFrZW5EIiwgInZlcnNpb24iOiIxLjEuMSJ9 out2.json
Result:
{"errorMessage": "'str' object has no attribute 'get'", "errorType": "AttributeError", "stackTrace": [["/var/runtime/awslambda/bootstrap.py", 303, "handle_event_request", "context = LambdaContext(invokeid, context_objs, client_context, invoked_function_arn)"], ["/var/runtime/awslambda/bootstrap.py", 473, "__init__", "self.client_context.client = make_obj_from_dict(Client, self.client_context.client)"], ["/var/runtime/awslambda/bootstrap.py", 432, "make_obj_from_dict", "set_obj_from_dict(obj, _dict)"], ["/var/runtime/awslambda/bootstrap.py", 440, "set_obj_from_dict", "setattr(obj, field, _dict.get(field, None))"]]}

please, check the latest release. The error should be removed.
There is a misunderstanding with the expected content of the client context, so we've remove it temporarily.
Thanks fro the heads up and helping with the troubleshooting!

@kpacha Thanks for the help!

@kpacha Thank you for the prompt replies..


Remove Undertow MpJwtPrincipalHandler

See THORN-2416

Clearly there is a JIRA, so I wonder why it isn't mentioned in the commit messages, but LGTM otherwise :-)

Hmm, not sure about the MP RestClient TCK failures on Windows...
retest this please

@Ladicek MP JWT is not involved in any way in the MP RestClient tests

I get that, but it's failing and I don't recall seeing those failures before :-)

Hmm, test failures are caused by empty test report files... Probably not a big deal.

Whoops, sorry for deleting your branch :-)


I can't filter by a Uuid Column, the .eq method give me an error

Description
Hi all, first, thanks for all the great job with Sea-orm, and before hand thanks for all your help. Take in account that I'm totally new to sea-orm, so maybe I'm making something wrong, I read the documentation without lucky to resolve the issue.
I'm migrating from diesel, orm. I have an issue when I try to filter by a column of type Uuid, the .eq method give me this
id: &Uuid
Go to Uuid
the trait bound sea_orm::Value: From<&uuid::Uuid> is not satisfied
the following implementations were found:
<sea_orm::Value as From<&'a [u8]>>
<sea_orm::Value as From<&'a str>>
<sea_orm::Value as From>
<sea_orm::Value as From>

Steps to Reproduce

make sure you have a table with an Uuid field in postgres
use the cli tool to generate the entities from the database.
then make a select query and filter by 2 fields one of them a Uuid, something like:
  let result = brand::Entity::find()    .filter(brand::Column::DeletedOn.is_null())    .filter(brand::Column::Id.eq(id))    .into_model::<BrandWithAuditEntity>()    .all(conn)    .await?;

Expected Behavior
the query should work
Actual Behavior
I got an error saying: the trait bound sea_orm::Value: From<&uuid::Uuid> is not satisfied
the following implementations were found:
<sea_orm::Value as From<&'a [u8]>>
<sea_orm::Value as From<&'a str>>
<sea_orm::Value as From>
<sea_orm::Value as From>
Reproduces How Often
is it always reproducible?
yes
Versions
[dependencies.sea-orm]
version = "^0.8.0"
uuid = { version = "1.1.2", features = ["serde", "v4"] }

Thanks for the updates :D


[Event Request] - New event OnBeforeExitAfterPostItemJnlAppliedToList inside 5815 "Undo Sales Shipment Line"

Hello, please consider adding the following event to Codeunit 5815 "Undo Sales Shipment Line"
    [IntegrationEvent(false, false)]
    local procedure OnBeforeExitAfterPostItemJnlAppliedToList(var ItemJnlLine: Record "Item Journal Line"; var SalesShptLine: record "Sales Shipment Line")
    begin
    end;

and call it accordingly inside the "PostItemJnlLine" procedure:
...
...
                    ItemJnlPostLine.Run(ItemJnlLine);
                    OnPostItemJnlLineOnAfterRunItemJnlPostLine(ItemJnlLine);
                    RemQtyBase -= ItemJnlLine.Quantity;
                    if ItemLedgEntryNotInvoiced.Next() = 0 then;
                until (RemQtyBase = 0);

                exit(ItemJnlLine."Item Shpt. Entry No.");
            end;

            UndoPostingMgt.PostItemJnlLineAppliedToList(
                ItemJnlLine, TempApplyToEntryList, Quantity - "Quantity Invoiced", "Quantity (Base)" - "Qty. Invoiced (Base)", TempGlobalItemLedgEntry, TempGlobalItemEntryRelation, "Qty. Shipped Not Invoiced" <> Quantity);

            **OnBeforeExitAfterPostItemJnlAppliedToList(ItemJnlLine, SalesShptLine);**

            exit(0); // "Item Shpt. Entry No."
        end;
    end;

Thanks!

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 52544.


[AUTOPATCHER-kernel] Kernel upgrade to version <IP_ADDRESS> - branch main

[AUTOPATCHER-kernel] Kernel upgrade to version <IP_ADDRESS> - branch main
Upgrade pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=460630&view=results
buddy build -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=463289&view=results

LGTM


Show more information for applied Column Dictionary and Code Table

Is your feature request related to a problem? Please describe.
It is difficult to check the information of the Column Dictionary and Code Table applied to Metadata Column.

Management Metadata

Exploration Data

Describe the solution you'd like
When hovering over it is necessary to show the summary information layer.
Like this.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

@thinkcsww
The issue content is described in Wireframe.

Code Table Layer

Column Dictionary Layer
Please remove the Dictionary Catalog from the scope of development.
The Detail button should only be exposed in Management and not in Exploration.

@ufoscw
1.

Is it right to show this part in layer ?

Do you mean implement layer except Detail button and Dictionary Catalog?

@thinkcsww

yes.
Please except Dictionary Catalog.
and except "Detail" button in case of Exploration > Detail view Layer.

@ufoscw
Sorry i'm little bit confused.
Is it right?
Implement code table and dictionary layer in two screen

management-> exploration -> metadata -> columns

Except Dictionary Catalog
Include Detail button

Exploration -> detail modal -> columns

Except Dictionary Catalog and Detail button

@thinkcsww
yes. right.

@ufoscw
thanks

@ufoscw

Need codeTable.codes data but i think api is not working

@thinkcsww
please use code table detail api when layer open.
(GET) /api/codetables/{id}?projection=forDetailView

@ufoscw
Thanks

@thinkcsww
Please just disable the magnifying glass icon, not the entire text.


Fix for MDT Divide by Zero Error

Fixes all the jq lookups for the nonexistent time value for MDT monitor/glucose.json. Make it look at nightscout/glucose.json instead.
Changed the order of when the nightscout/glucose.json report was called at the end of the MDT reformatting  instead of the beginning of the upload so that this time can be used. and still be accurate.
this has the added benefit of fixing the super long upload times for CGM data that I was seeing as well.

This change will check for any type of cgm and place that in a new data cgmtype. So if in the future anyone needs to do anything special for any of the cgm types everything is already there for it..
I figured getting that data from the oref0-runagain.sh seams like a logical way of doing that.

I was thinking about this the other day, we need to get someone that is not using MDT to test this and make sure it still works for them

Worked fine for me using G4-upload just now.

Just opened https://github.com/Bender1061/oref0/pull/2 to clean up the code a bit.  It shouldn't change functionality at all, so I'm fine merging this to dev once that is merged.  Or, if @Bender1061 isn't available to merge my PR to his branch, I can just merge straight from mdt-div-zero to dev.

Looks good, I won't be able to test till tonight though

Works good 👍 Lets merge it!


Initial Implementation of ExistsQuery

Implements ExistsQuery that returns all document where a field has some value.
Fixes #2159

@imotov The approach is ok. I would

[ ] ditch the doc ids buffering. It makes your code more complex, and I suspect it makes it slower than the trivial implementation. @PSeitz may have a different view on this.
[ ] possibly change the spec of what to do if the column is not found
[ ] add unit tests

The other half of the ticket is to integrate this into the ExistsQuery of quickwit:

[ ] disabling exists query indexing for fast fields
[ ] plug that implementation instead.

One tricky thing will be to test what happens when facing a fast field or when facing a dynamic field.

Codecov Report
Patch coverage: 69.38% and project coverage change: -0.05% :warning:

Comparison is base (73cb717) 94.24% compared to head (7acdd67) 94.20%.
Report is 1 commits behind head on main.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2160      +/-   ##
==========================================
- Coverage   94.24%   94.20%   -0.05%
==========================================
  Files         320      321       +1
  Lines       62368    62659     +291
==========================================
+ Hits        58778    59027     +249
- Misses       3590     3632      +42

Files Changed
Coverage Δ

src/query/mod.rs
100.00% <ø> (ø)

src/query/range_query/mod.rs
95.65% <ø> (ø)

columnar/src/dynamic_column.rs
64.67% <45.45%> (-1.23%)
:arrow_down:

src/query/exist_query.rs
68.04% <68.04%> (ø)

columnar/src/column_index/mod.rs
96.49% <100.00%> (+0.33%)
:arrow_up:

src/query/range_query/fast_field_range_query.rs
99.08% <100.00%> (ø)

... and 3 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

possibly change the spec of what to do if the column is not found

I have implemented it to be consistent with other queries that I have seen. So, if field doesn't exists or not fast - it returns an error. I can see how returning nothing if the field doesn't exist might make sense, but it might also be pretty confusing. Returning nothing if field is not fast can be really confusing to users.

I have implemented it to be consistent with other queries that I have seen. So, if field doesn't exists or not fast - it returns an error. I can see how returning nothing if the field doesn't exist might make sense, but it might also be pretty confusing. Returning nothing if field is not fast can be really confusing to users.

Non-Existence should return an empty result on JSON fields, since they may be non-existing only on some segments.

@PSeitz @imotov there is a bit of a semantic problem in our discussion. When we say the field is absent, we are talking of Field in the sense of tantivy schema. Not (Field, Path).
If it is not available, meaning resolve path has return None, I think it makes sense to return an error.
In quickwit, we will need to have some logic to be a little bit more lenient, in order to handle changes of schema.
That logic is already pretty solid, and exists in the conversion from QueryAst to tantivy query.

@PSeitz, @fulmicoton  so, the way it is implemented right now if you have a json field called foo and you try to run presence query on foo.bar, it will return an error if foo doesn't exists and it will return an empty result set if foo exists and is defined as json field but none of the json documents have bar inside of them. I updated the test in e4e5225 to demonstrate these scenarios.

Can somebody merge this in? I am not authorized to merge pull requests in this repository.

Turned out that the issue was in quickwit and not here. OK to merge.


[Modules] Update allowed version values

Description
Updated the version parameter in the main.bicep file to allow version 15, and set the default version to 15.
#3950
Pipeline references

Pipeline

Type of Change

[ ] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Update to documentation

Checklist

[x] I'm sure there are no other open Pull Requests for the same update/change
[x] My corresponding pipelines / checks run clean and green without any errors or warnings
[x] My code follows the style guidelines of this project
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation (readme)
[x] I did format my code

@microsoft-github-policy-service agree company="Defra"

Much appreciated @ppotturi :)


fix(glance): image stream worker count

What this PR does / why we need it:

[x] Smoke testing completed

If yes, write the release branches name in the below format and submit the related cherry-pick PR:

release/3.11

/lgtm


add __all__ and remove UnsetValue.__str__ in utils module

rerun

@dyq666 Can you provide description of what is going on directly and how this improves it? Also please take a look at this Travis failed tests. It is important to have checks on the code to ensure its valid and working.

Thanks for your interest, but I don't think these changes are necessary at this time.


How to send emoji in SendPhotoAsync()

Hello.
I want to send emoji in SendPhotoAsync() can you help me?
please give me this code, i tested anything but i can not send still.

Hi,
To send Emoji no need that you use SendPhotoAsync().  you can use SendTextMessageAsync() and pass the Unicode of Emoji as message text.
Also you can fine the complete Emoji Unicode Table here ->
http://apps.timwhitlock.info/emoji/tables/unicode

Thank you but doesn work.
this is my code :
token.SendTextMessageAsync("MyChanell Id",
"U+1F601", true, true, 0, null, ParseMode.Html);

Try to use "U0001F601" instead of your emoji's code. IntelliSense will remark it to you.

Hello,
Search for "C# escape unicode", that should help. It's something like \u1060.
Kind regards,
Martijn Verbakel

Try to use "\U0001F601" instead of your emoji's code. IntelliSense will remark it to you.

I used your suggestions but dont work!
For changing unicodes to emoji i use this function :
static string DecodeEncodedNonAsciiCharacters(string value)
{
return Regex.Replace(
value,
@"\u(?[a-zA-Z0-9]{4})",
m =>
{
return ((char)int.Parse(m.Groups["Value"].Value, NumberStyles.HexNumber)).ToString();
});
}
But still no result.
Here is a list of emoji codes : http://apps.timwhitlock.info/emoji/tables/unicode

It worked, first list is wrong as i see, because second list works fine with this function.

Hi,
you said second list worked,
but i can't find out which list worked?
can you send an example?
thanks in advance

I think he is referring to this list: http://apps.timwhitlock.info/emoji/tables/unicode
Which are then used as "My message \U0001F601" for sending.

Thanks for your help,
but when i send "My message \U0001F601" as input to DecodeEncodedNonAsciiCharacters method,
I receive Parsing Error so I've change the method like this:
static string DecodeEncodedNonAsciiCharacters2(string value)
{
return Regex.Replace(
value,
@"\u(?[a-zA-Z0-9]{4})",
m =>
{
return ((char)int.Parse(m.Groups["Value"].Value, NumberStyles.HexNumber )).ToString();
});
}
So this worked with that input,
Any way Thank you.

You can find emoji code point list in https://emojipedia.org/telegram
for example for Grinning Face With Smiling Eyes we use code point "U+1F601" this is "0x1F601"
now for send text use below code:
await Api.SendTextMessageAsync(message.Chat.Id, char.ConvertFromUtf32(0x1F601));

You can just write emojis in a string.
client.SendTextMessageAsync(chatId, "😄");

If you are running Windows 10, enable its touch keyboard and type emojis using that.

That's amazing answer it's work for me i want to send emoji on telegram bot using c# and i am visit this page i got my answer thanks a lot..


Consolidate When and Where on RuleForEach

At the moment there are 2 ways of applying conditions to RuleForEach. If you use When, it applies to the whole property (as with RuleFor), and Where allows filtering individual collection elements.
I'd like to get rid of Where and change the semantics for When so they apply to each element in the collection. This is a breaking change, so probably best to hold of until 9.0.
The original behavior (condition against the entire property) can be preserved by any of the following:

Wrapping the RuleForEach in a root-level When
Mixing root and collection semantics using RuleFor(...).ForEach() (due either in 8.2 or 9)

Consider making this change apply to all extension methods on RuleForEach, so everything applies to the collection element, as is implied by the name RuleForEach.

Decided against doing this. Closing.


panic in LazyRefValidator::lazy_compile with jsonschema 0.21

With jsonschema 0.21, I get a panic out of jsonschema which is hard to debug because of missing detail information:
panicked at .../index.crates.io-6f17d22bba15001f/jsonschema-0.21.0/src/keywords/ref_.rs:103:61:
Invalid schema: ValidationError { instance: Null, kind: Referencing(InvalidUri(Resolve(ResolveError(InvalidBase)))), instance_path: JsonPointer([]), schema_path: JsonPointer([]) }

The schemas in question are relatively reference heavy, I can try to pinpoint it more closely but wanted to report it already.

It seems that the failing schema uses local references like this:
{
    "$id": "/schemas/base/spatial",
    "location": {
        "$id": "#/location",
        "type": "object",
        "properties": {
            "location": {
                "type": "string"
            },
            "coordinates": {
                "$ref": "#/lat-lon-coords"
            }
        },
        "required": [
            "location",
            "coordinates"
        ],
        "additionalProperties": false
    },
    "lat-lon-coords": {
        "$id": "#/lat-lon-coords",
        "type": "object",
        "properties": {
            "lat": {
                "type": "number",
                "minimum": -90,
                "maximum": 90
            },
            "lon": {
                "type": "number",
                "minimum": -180,
                "maximum": 180
            }
        },
        "required": [
            "lat",
            "lon"
        ]
    },
}

It panics when trying to compile the #/location schema which itself references the sibling schema #/lat-lon-coords. It might be that the references are not completely sound wrt the spec, in any case jsonschema should not panic...

Thank you so much for reporting! I'll take a look at it soon :)

Thanks for this useful library ;)

Thanks for fixing the panic, @Stranger6667. Now the panic is gone but the regression itself is not fixed. It still says InvalidBase as the only indication of what might be wrong. So, for us this is still a regression from 0.20.

I might be misunderstand the specification but I think the above case is similar to the case described in https://json-schema.org/understanding-json-schema/structuring#defs:
{
  "$id": "https://example.com/schemas/customer",

  "type": "object",
  "properties": {
    "first_name": { "$ref": "#/$defs/name" },
    "last_name": { "$ref": "#/$defs/name" },
    "shipping_address": { "$ref": "/schemas/address" },
    "billing_address": { "$ref": "/schemas/address" }
  },
  "required": ["first_name", "last_name", "shipping_address", "billing_address"],

  "$defs": {
    "name": { "type": "string" }
  }
}

The $defs syntax is a convention where to put sub-schemas which we didn't adopt but afaics there's nothing that would disallow plain #/xyz references from working.

Pasting in the above schema into the test you added works, so probably we now arrived a different but related issue after all. Will investigate, the problem is still that I have to add printlns to jsonschema to figure out which sub-schema file is the problem...

hi @jrudolph
I believe that the issue is in the $id value, in the original example it is a JSON pointer, but for such cases, internally a fake URI base is used, so it should be fine (I've added a test with a minimized version of your schema).
After finishing with drafts support I plan to address error messages and there will be much more context for such cases, which will also pinpoint the exact error location & will have a more descriptive message.
However, maybe some immediate patches to this specific area of URIs will help, I'll take a look (maybe just adding the input values to the error message will help with debugging)

That sounds good and I'll also try to debug where the problem is now.

I added printlns and a panic at the right position and ended up with this:
Trying to resolve id: #/location base: https://example.org/schemas/base/spatial#/location
Invalid URI: base URI/IRI with fragment
stack backtrace:
   0: rust_begin_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
   2: <referencing::error::Error as core::convert::From<fluent_uri::error::ResolveError>>::from
             at /home/johannes/git/opensource/_2024/jsonschema-rs/crates/jsonschema-referencing/src/error.rs:183:9
   3: <core::result::Result<T,F> as core::ops::try_trait::FromResidual<core::result::Result<core::convert::Infallible,E>>>::from_residual
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1989:27
   4: referencing::uri::resolve_against
             at /home/johannes/git/opensource/_2024/jsonschema-rs/crates/jsonschema-referencing/src/uri.rs:13:8
   5: referencing::resolver::Resolver::in_subresource
             at /home/johannes/git/opensource/_2024/jsonschema-rs/crates/jsonschema-referencing/src/resolver.rs:164:37
   6: jsonschema::compiler::Context::in_subresource
             at /home/johannes/git/opensource/_2024/jsonschema-rs/crates/jsonschema/src/compiler.rs:73:24
   7: jsonschema::compiler::compile
             at /home/johannes/git/opensource/_2024/jsonschema-rs/crates/jsonschema/src/compiler.rs:353:15
   8: jsonschema::keywords::ref_::LazyRefValidator::lazy_compile::{{closure}}
             at /home/johannes/git/opensource/_2024/jsonschema-rs/crates/jsonschema/src/keywords/ref_.rs:145:13

So, it does not happen inside the document but when reference from an outside schema. I'll try to figure out a test case.

Here's a failing test case for ref_.rs:
#[test]
    fn test_relative_base_uri_in_referenced_schema_doc() {
        let schema = json!({
            "$id": "https://example.com/root",
            "properties": {
                "location": {
                    "$ref": "/indirection#/$defs/baz",
                }
            }
        });

        struct MyRetrieve {}
        impl Retrieve for MyRetrieve {
            fn retrieve(
                &self,
                uri: &Uri<&str>,
            ) -> Result<Value, Box<dyn std::error::Error + Send + Sync>> {
                println!("Retrieving {}", uri);
                match uri.path().to_string().as_ref() {
                    "/indirection" => Ok(json!({
                        "$id": "/indirection",
                        "$defs": { // another issue is that $defs is required here
                            "baz": {
                                "$id": "#/$defs/baz",
                                "$ref": "/types/#foo"
                            }
                        }
                    })),
                    "/types" => Ok(json!({
                        "$id": "/types",
                        "foo": {
                            "$id": "#/foo",
                            "$ref": "#/bar"
                        },
                        "bar": {
                            "$id": "#/bar",
                            "type": "integer"
                        },
                    })),
                    _ => panic!("Not found"),
                }
            }
        }

        let validator = Validator::options()
            .with_draft(Draft::Draft201909)
            .with_retriever(MyRetrieve {})
            .build(&schema)
            .expect("Invalid schema");

        assert!(validator.is_valid(&json!(2)));
    }

Thanks, that would help me a lot! I merged a change for better URI-related errors and will take a look at the issue soon

Great, thanks!

Right now, the reference resolving process works as follows:

Resolving /indirection#/$defs/baz:

Drop the fragment and look for a resource with "$id": "/indirection"
Treat the fragment as a JSON pointer, resolving to {"$id": "#/$defs/baz", "$ref": "/types/#foo"}.

Resolving /types/#foo:

Look for a resource with "$id": "/types/" (likely a typo, should be /types without trailing slash).
Treat foo as an anchor, which doesn't exist in the schema.

The issue appears to be a typo in /types/#foo. It should likely be /types#/foo, which would be treated as a pointer within the /types resource.
This version should work, but there is an issue with eager resolving that does not check baz in the /indirection resource:
# root (note that there is no $id)
{
    "$ref": "/indirection#/baz"
}

# /indirection
{
    "$id": "/indirection",
    "baz": {
        "$ref": "/types#/foo"
    }
}

# /types
{
    "$id": "/types",
    "foo": {
        "$ref": "#/bar"
    },
    "bar": {
        "type": "integer"
    }
}

But it works with Python's jsonschema:
import jsonschema
from referencing import Registry, Resource
from referencing.jsonschema import DRAFT201909

a = {
    "$id": "/indirection",
    "baz": {"$ref": "/types#/foo"},
}

b = {
    "$id": "/types",
    "foo": {"$ref": "#/bar"},
    "bar": {"type": "integer"},
}

def retrieve(uri):
    contents = {"/indirection": a, "/types": b}[uri]
    return Resource.from_contents(contents, default_specification=DRAFT201909)

registry = Registry(retrieve=retrieve)
schema = {
    "$ref": "/indirection#/baz",
}
validator = jsonschema.Draft201909Validator(schema, registry=registry)
assert validator.is_valid(2)
assert not validator.is_valid("key")

So, there is definitely a bug with eager ref resolving which should be fixed.
On the schema side, do you think that my assumption about the typo is correct?
At least this is my understanding of the resolution process, which was more or less ported from Python's referencing and appears to be correct (given it passes the referencing test suite + the official JSON Schema test suite). If there is any aspect about the schema structure that I've missed, please, let me know.

Oh indeed, the trailing slash is a typo, but is that really related to the error which complains about a fragment in the base URL?

I think it is misleading right now:
Failed to resolve '/types/#foo' against 'https://example.com/indirection#/$defs/baz': base URI/IRI with fragment

That actually could be just Unresolvable: /types/#foo or something like that.

For me it still fails without the trailing slash. Basically, I'd like to have both tests passing that I added here:
https://github.com/Stranger6667/jsonschema-rs/compare/master...jrudolph:jsonschema-rs:hash-references?expand=1

I think it is misleading right now:
Failed to resolve '/types/#foo' against 'https://example.com/indirection#/$defs/baz': base URI/IRI with fragment

Not sure why that would be misleading? Isn't it an error coming directly out of fluent_uri::UriRef::resolve_against and happens because the base has a fragment defined?

Sorry for the delay, I am going to make a new release with the current changes (as there are quite a lot of things already) and will follow up a bit later next week with fixes on the issues we've discussed here. Right now I don't have much time to dive into resolving to implement a proper fix.

Not sure why that would be misleading? Isn't it an error coming directly out of fluent_uri::UriRef::resolve_against and happens because the base has a fragment defined?

Oh, you're right. Now I re-read it and it makes sense, as with that typo it becomes a URI with a fragment. My intention was to find a way to make the error more connected with what is defined in the schema, so there is something actionable in the message

Sorry for the delay, I am going to make a new release with the current changes (as there are quite a lot of things already) and will follow up a bit later next week with fixes on the issues we've discussed here. Right now I don't have much time to dive into resolving to implement a proper fix.

Yeah, no hurry, we can stay on 0.20 for the time being, just wanting to make sure that we will have a path forward in the future.

My intention was to find a way to make the error more connected with what is defined in the schema, so there is something actionable in the message

Indeed, that's already a great improvement.

Thanks, I'll try to see if it worked.

I finally got to checking the new version. The error message is now much better but resolution still fails... looking into it

I created a reproducer at https://github.com/Stranger6667/jsonschema/pull/633. The issue is that $id fields still seem to include the fragment during resolving basically against itself...

I created a new ticket for the problem described above. I could look into it, if you could give me a hint where to start looking.

Hi! Thanks, I am on vacation till Monday. Will reply as soon as I get back


{VM} Clean up Network SDK dependencies

Related command

Description

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature

This checklist is used to make sure that common guidelines for a pull request are followed.

[ ] The PR title and description has followed the guideline in Submitting Pull Requests.

[ ] I adhere to the Command Guidelines.

[ ] I adhere to the Error Handling Guidelines.

VM

May I ask why the current design tends to add the network multi-version folders under each module which depends on it, rather than directly call the multi-version folders from the network module?
I have concerned that these may cause some multi profile code duplication, increase the number of files and package size (may have little actual impact), and may increase the maintenance cost of bug fix in the future.
Maybe I lack some context at present, so I don't consider it comprehensively. I'm looking forward to hearing your design ideas~

May I ask why the current design tends to add the network multi-version folders under each module which depends on it, rather than directly call the multi-version folders from the network module? I have concerned that these may cause some multi profile code duplication, increase the number of files and package size (may have little actual impact), and may increase the maintenance cost of bug fix in the future. Maybe I lack some context at present, so I don't consider it comprehensively. I'm looking forward to hearing your design ideas~ 😉

That's a good question. The short answer is to decouple the modules. As you can see the network commands generated for vm module use 2020-01-01 however in network module they are 2022-05-01. That avoids a lot of bump up works. We use compact algorithm to reduce such size increase in packaging stage.

That's a good question. The short answer is to decouple the modules. As you can see the network commands generated for vm module use 2020-01-01 however in network module they are 2022-05-01. That avoids a lot of bump up works. We use compact algorithm to reduce such size increase in packaging stage.

OK, LGTM. If Code Gen can support batch upgrade of the dependent RP folders for multiple modules at the same time in the future, this will help us better maintain the additional multi-profile folders


Reference to tool codecov in tools.cake needs to be updated

Reference to codecov 1.4.0 in tools.cake should be updated to 1.7.0

This issue was created by mistake while I was investigating an issue in the Cake.AddinDiscoverer tool. Please ignore.

THis should still be updated 😄

It's blocked by #368. AddinDiscoverer does not suggest upgrading a tool reference when a previous issue+pullrequest is still open.

@Jericho I am aware of the existing issue+PR.
I just said that because this issue was opened by a mistake.


Update dashboard.php

Few additional translation

Codecov Report

Merging #31 (d769e32) into 2.5 (747d52e) will decrease coverage by 0.12%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##                2.5      #31      +/-   ##
============================================
- Coverage     55.89%   55.76%   -0.13%
  Complexity     1265     1265
============================================
  Files           275      275
  Lines          4804     4804
============================================
- Hits           2685     2679       -6
- Misses         2119     2125       +6

Impacted Files
Coverage Δ
Complexity Δ

app/Integrations/Core/System.php
79.48% <0.00%> (-10.26%)
13.00% <0.00%> (ø%)

app/Presenters/ComponentPresenter.php
94.73% <0.00%> (-5.27%)
10.00% <0.00%> (ø%)

app/Http/Controllers/Dashboard/ApiController.php
50.00% <0.00%> (-2.50%)
9.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 747d52e...d769e32. Read the comment docs.

@Yves911 thanks for these.
In future if you have multiple translation changes just pop in one PR for them all rather than separate ones for each one as it makes sense for them all to be grouped under the functionality of "french translations" which file has changes doesn't really matter.


Fix picker bugs

Fix bugs in Picker on Gtk:

Exception on creation because Attributes is null
Not setting initial value

@aarani please review

I can't understand Core(Gtk): fix picker not setting initial value can you explain it more  in the commit msg?

I can't understand Core(Gtk): fix picker not setting initial value can you explain it more in the commit msg?

So what happened before was that SetValues changed values of Gtk widget, that would in turn trigger handler's OnNativeViewChanged, and it would reset virtualView.SelectedIndex. And in the end, the initial value would not be set.
Something like this.

I can't understand Core(Gtk): fix picker not setting initial value can you explain it more in the commit msg?

So what happened before was that SetValues changed values of Gtk widget, that would in turn trigger handler's OnNativeViewChanged, and it would reset virtualView.SelectedIndex. And in the end, the initial value would not be set. Something like this.

Please add to commit msg what you just said to me.

@aarani updated commit message

@webwarrior-ws why didn't you push 1 by 1?

@webwarrior-ws why didn't you push 1 by 1?

CI was broken at that stage so it would fail in any case.
Now I've pushed 1 by 1.


Pass store failure to store operation

@bot-gradle test and merge

I've triggered a build for you. Click here to see all failures if there's any.