Add NSFWDetectionResult

Hey, the current version is missing all parameters regarding NSFW detection. In this PR I added them for both, the V2 and V3 API.

Hi @GigaDroid, thank you for your contribution. We have added these parameters in version 0.5.3, you can upgrade to the latest version. Thanks again.


try to exclude asserts from coverage

Coverage remained the same at 96.451% when pulling 3e6afdc5a0f7167dad7db2925ae5fa1a8bee02d8 on try-to-exclude-asserts-from-coverage into 4a281a8fd5c339dbb79976ab6fc8de3df2518f56 on main.

The change did not help coverage, so closing this experimental PR.


[ahead/behind] parse git result on serverside

ensure that the return type is always an array. before it was either a string or a number.
adding tests.

Rebased. I think the tests I added would be a good addition to make sure that everything works as expected.


Update 01-getting-started.md

static keyword is missing

The infolist method is only static on resources.


added notification when uncordoning

when reboot & uncordoning is successful -> notification will be sent.
Fixes: https://github.com/weaveworks/kured/issues/585
AFTER:
[kured-bot](https://app.slack.com/team)
APP
[1:26 PM](https://kured-tesing-personal.slack.com/archives)
Draining node kind-worker2
[1:26](https://kured-tesing-personal.slack.com/archives)
Rebooting node kind-worker2
[1:27](https://kured-tesing-personal.slack.com/archives)
Node: kind-worker2 rebooted&uncordoned successfully!

That looks good, thanks. I just would propose to introduce a message-template parameter as we have it already for the other notifications to stay in sync.

@ckotzbauer
AFTER:
kured-bot
APP  2:00 PM
Draining node kind-worker
2:00
Rebooting node kind-worker
New
2:02
Node kind-worker rebooted & uncordoned successfully!

Great, thanks for the flag.
Can you please add it to the README here and here as well? Then I'm finally happy 😆

Great, thanks for the flag. Can you please add it to the README here and here as well? Then I'm finally happy laughing

Done.
Readme, and charts/values as well.

@ckotzbauer thanks for making this PR even better :)

Thanks for the readme change @atighineanu.
Sorry again, but can we do the chart-values change in a separate PR? We have to split chart- and non-chart-changes due to the release-process.

Thanks for the readme change @atighineanu. Sorry again, but can we do the chart-values change in a separate PR? We have to split chart- and non-chart-changes due to the release-process.

DONE


Update SDS integration tests

Use ServiceEntry in the Vault integration test.
Remove redundant mesh policy and destination rule for mTLS, since global.mtls.enabled=true.

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: lei-tang
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: quanjielin
If they are not already assigned, you can assign the PR to them by writing /assign @quanjielin in a comment when ready.
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

tests/integration/security/OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

https://github.com/istio/istio/issues/13439

@lei-tang: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/e2e-simpleTests.sh
db1ace70428df93081b738516e66fa1f6162249c
link
/test e2e-simpleTests-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

/test e2e-simpleTests-master

https://github.com/istio/istio.io/pull/4200

/lgtm

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: incfly, lei-tang
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

tests/integration/security/OWNERS [incfly]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lei-tang: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/istio-presubmit.sh
db1ace70428df93081b738516e66fa1f6162249c
link
/test istio-presubmit-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

/test istio-presubmit-master

@lei-tang: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

prow/integ-security-k8s-presubmit-tests.sh
db1ace70428df93081b738516e66fa1f6162249c
link
/test integ-security-k8s-presubmit-tests-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.


Add additional argument to mail highlighting

Resolve merge conflicts between a change in the hi function and the addition
of mail highlighting.

Duplicate of #308. Please close the pull request.


How to integrate?

How do i put it on my website?

Just include log.js (or log.min.js using a <script> tag. That’s it!

Just include log.js (or log.min.js) using a <script> tag. That’s it!


Integration with JupyterHub

Is it possible to configure JupyterHub and/or JupyterLab so that I can Lab within Hub?

Closing this issue as a duplicate
https://github.com/jupyterhub/jupyterhub/issues/725#issuecomment-245584865

(and for completeness, the answer in the comment is "Yes, it's possible." and the comment tells what to do.)


https://tddwizard.com/ has been down a long time.

Hangs when trying to look at https://tddwizard.com/ and it's been like that for weeks. (Don't know how else to let you know).

Thank you, I'm aware that it's offline but it doesn't have priority for me at the moment


AMNESIA World [PCSG00276]

App summary

App name: AMNESIA World
App serial: PCSG00276
App version: 1.00

Vita3K summary

Version: v0.1.8
Build number: 3173
Commit hash: https://github.com/vita3k/vita3k/commit/42d6b4ef
CPU backend: Dynarmic
GPU backend: OpenGL

Test environment summary

Tested by: Dystnine
OS: Windows 7
CPU: INTEL I3 4100U
GPU: AMD HD8500M
RAM: 8 GB

Issues

Everything is works
Screenshots

Log
PCSG00276.log
Recommended labels

Playable

i have downloaded and installed vita3k emulator, and tried to play this game, but I can't. I have the game AMNESIA World, App serial: PCSG00276, App version: 1.00 just like yours. I tried to install it by going to "file" , then "install .vpk". but it doesn't work. can you tell me how do you load this game with the vita3k emulator?

i have downloaded and installed vita3k emulator, and tried to play this game, but I can't. I have the game AMNESIA World, App serial: PCSG00276, App version: 1.00 just like yours. I tried to install it by going to "file" , then "install .vpk". but it doesn't work. can you tell me how do you load this game with the vita3k emulator?

It's normal that you can't load vitamindump on this emulator.

how did you install it though?

Good afternoon, how to download this game?


Amazon Bedrock: add examples

As we do for other core integrations, we should create one or more simple examples about:

Amazon Bedrock Generator and Chat Generator
Amazon Bedrock Embedders

We should put them in integrations/amazon_bedrock/examples
Useful resources:

integration page
docs
cookbook

@lambda-science I tag you, since I know you are a Bedrock lover :smiley:
If you have time and are interested, feel free to open a PR.


[$250] Expense - Merchant's ‘Duplicate’ error message does not disappear after changing i

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Version Number: v9.0.67-1
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers<EMAIL_ADDRESS>Issue reported by: Applause Internal Team
Action Performed:

Open the URL: https://staging.new.expensify.com/
Create a WS
Create and submit an expense to the WS with: Amount: 123, Merchant: hhh
Repeat step 3
Click on 'Search' between Settings & Inbox
Find the expense and do a click on it
Change the merchant name

Expected Result:
After changing the merchant's name, the error message below merchant should disappear.
Actual Result:
After changing the merchant's name, the error message persists. (If you change the amount, the error disappear. However, the error appears below the merchant and it is understood that it is caused by the merchant, not by the amount)
Workaround:
Unknown
Platforms:

[ ] Android: Standalone
[ ] Android: HybridApp
[ ] Android: mWeb Chrome
[ ] iOS: Standalone
[ ] iOS: HybridApp
[ ] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[x] MacOS: Desktop

Screenshots/Videos
https://github.com/user-attachments/assets/7dc347fc-3c25-414d-b665-0c811e5e87d6

View all open jobs on GitHub
Upwork Automation - Do Not Edit

Upwork Job URL: https://www.upwork.com/jobs/~021861836931662502944
Upwork Job ID:<PHONE_NUMBER>662502944
Last Price Increase: 2024-11-27

Issue OwnerCurrent Issue Owner: @sobitneupane

Proposal
Please re-state the problem that we are trying to solve in this issue.
After changing the merchant's name, the error message persists. (If you change the amount, the error disappear. However, the error appears below the merchant and it is understood that it is caused by the merchant, not by the amount)
What is the root cause of that problem?
duplicatedTransaction violation is mapping to merchant although the reason is the dup amount
https://github.com/Expensify/App/blob/3541c88fa1f2f9208dda09ab5b478c4342127f3b/src/hooks/useViolations.ts#L21
What changes do you think we should make in order to solve the problem?
Change this to amount
https://github.com/Expensify/App/blob/3541c88fa1f2f9208dda09ab5b478c4342127f3b/src/hooks/useViolations.ts#L21
What alternative solutions did you explore? (Optional)

Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense - Merchant's ‘Duplicate’ error message does not disappear after changing i
What is the root cause of that problem?
When calling the UpdateMoneyRequestMerchant api, Backend didn't return the correct response if the transaction is not duplicated.

What changes do you think we should make in order to solve the problem?
For solving this on frontend side. we should add the onyxData merge block at the above line of API call in the updateMoneyRequestMerchant when the transaction is not duplicated.
    onyxData.successData?.push({
        onyxMethod: Onyx.METHOD.MERGE,
        key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`,
        value: null,
    });

And we should find the duplicated transaction id and set it as null too.
What alternative solutions did you explore? (Optional)
We can also solve this to send the correct response from Backend.
Contributor details
Your Expensify account email<EMAIL_ADDRESS>Upwork Profile Link: https://www.upwork.com/freelancers/~01aff093c9a804b145

Proposal
Please re-state the problem that we are trying to solve in this issue.
Expense - Merchant's ‘Duplicate’ error message does not disappear after changing i
What is the root cause of that problem?
After changing the merchant name, UpdateMoneyRequestMerchant api doesn't return the correct response.
The duplicatedTransaction violation should depend on the merchant name, but it seems, now backend trigger this violation based on the amount.
What changes do you think we should make in order to solve the problem?
We should fix the backend logic to consider the merchant name, not the amount.
What alternative solutions did you explore? (Optional)
I'm not sure when we should show 'Duplicate' warning but if we have to show this on the expenses where both amount and merchant name are the same, then we should fix the current workflow.

Thanks for the proposal, everyone.
@nkdengineer, could you please provide more details in your proposal, particularly in the root cause section? The current statement seems to validate your solution but doesn't provide much insight into the actual root cause.
Also, aren't we supposed to show the Duplicate error message only if both the merchant and the amount are the same?

@sobitneupane I updated my proposal with the detail RCA

Also, aren't we supposed to show the Duplicate error message only if both the merchant and the amount are the same?

Yes, the duplicate error will appear whenever you create another expense with the same amount.

Thanks for the proposal, @nkdengineer

The duplicate detection only applies to the amount, not to the merchant (we can try when submitting two expenses with the same amount and different merchant and two expenses with the different amount and the same merchant to verify that).

First, I would like confirmation from the internal engineering team:
Do we currently detect two transactions as probable duplicates based solely on having the same amount, regardless of the merchant?

If this is not expected behavior, I suggest making the necessary changes in the backend.
If this is expected behavior, let's proceed with @nkdengineer's proposal to display the duplicate message below the amount field instead of the merchant field.

🎀 👀 🎀 C+ reviewed

@aldo-expensify Please help to check this comment when you have a chance.

Looking at OldDot, it looks like @nkdengineer is correct. In OldDot, we warn about duplicates if the amount is the same, no matter if the merchant is different:

@garrettmknight do you know if this is correct?

@garrettmknight Can you check this comment here?

I thought this was for the updated dupe detection functionality we're working on. My bad - I'll close for now.


statistical query group and sort sample

Shows how to query statistics from a feature table

@john0005 This is ready for review. It's got quite a few edge cases (I think I've covered them) so it may take a while to review.


How to solve it？KeyError: 'frame_dir'....Thanks!

when run:
python demo/demo.py configs/recognition/i3d/i3d_r50_fast_32x2x1_100e_kinetics400_rgb.py checkpoint/i3d/i3d_r50_fast_32x2x1_100e_kinetics400_rgb_20200612-000e4d2a.pth demo/demo.mp4 demo/label_map.txt
An error occurred when running the demo according to the instructions！
Traceback (most recent call last):
File "demo/demo.py", line 35, in
main()
File "demo/demo.py", line 27, in main
results = inference_recognizer(model, args.video, args.label)
File "/root/mmaction/mmaction/apis/inference.py", line 63, in inference_recognizer
data = test_pipeline(data)
File "/root/mmaction/mmaction/datasets/pipelines/compose.py", line 41, in call
data = t(data)
File "/root/mmaction/mmaction/datasets/pipelines/loading.py", line 576, in call
directory = results['frame_dir']
KeyError: 'frame_dir'

Hi @BinglinShu. Thanks for this issue.
This is because the config file you use is for RawframeDataset but the demo uses video. Different datasets type has different data pipelines and causes your error. To fix this problem, you may want to use a config file for VideoDataset or you can manually change the dataset_type and test_pipeline part in the config file. You can refer to this video inference config file for TSN.
For your convenience, we will also add more config files for demo soon.

Update:
We have added some config files for the demo in MMAction2. You can refer to this for the inference config for i3d model.


GT2 Cars are not working

Hey Lenny,
I have seen your message on Overtage that you don't have the GT2 DLC so you cannot add the cars and update the track data for Redbull Ring. I know nothing about coding, but I have the DLC and everything... Is there a way how I can give you the data so you can add it to the tool?

Hello and thanks for the offer.
Currently there is still a bug with the game that prevents the correct gathering of track data. Once that is fixed i might come back to you.
The necessary car data is now available in the server handbook and i have added it.


Speed Up Provider

Put API requests to portal / wikidata in individual sessions

Putting the session in the provider makes it a bit slower, maybe have the session started on an upper lever? How, where?


How to map varargs for java inter-op

I know Ballerina can use varargs to call java class like the example in Ballerina by Example using asList funtction of "java.util.Arrays".
Now I need to call Jedis hdel method like this
  /**
   * Remove the specified field from an hash stored at key.
   *

   * Time complexity: O(1)
   * @param key
   * @param fields
   * @return If the field was present in the hash it is deleted and 1 is returned, otherwise 0 is
   *         returned and no operation is performed.
   */
  @Override
  public Long hdel(final String key, final String... fields) {
    checkIsInMultiOrPipeline();
    client.hdel(key, fields);
    return client.getIntegerReply();
  }

So i have defined a external function to map jedis hdel like below:
function hdel(handle receiver, handle key, handle... fields) returns int = @java:Method {
    class: "redis/clients/jedis/Jedis",
    paramTypes: ["java.lang.String", "java.util.Arrays"]
} external;

I got this error when i build my project:
{ballerinax/java}METHOD_NOT_FOUND message=No such public method 'hdel' that matches with parameter types '(java.lang.String,java.util.Arrays)' found in class 'class redis.clients.jedis.Jedis'
I don't know which java class can help me map varargs.  Any help there?

@reidlai Whats the ballerina version you are using?
Seems your ballerina function has 3 parameters and the java function has only 2 parameters. You might have to correct that first.
With respect to the varargs type, if  the java hdel method has no overloaded methods, then you can simply use:
function hdel(handle key, handle... fields) returns int = @java:Method {
    class: "redis/clients/jedis/Jedis"
} external;

Else, you can specifically mention the parameter type as follow:
function hdel(handle key, handle... fields) returns int = @java:Method {
    class: "redis/clients/jedis/Jedis",
    paramTypes: ["java.lang.String", {class:"java.lang.String", dimensions:1}]
} external;

@reidlai Whats the ballerina version you are using?
Seems your ballerina function has 3 parameters and the java function has only 2 parameters. You might have to correct that first.
With respect to the varargs type, if the java hdel method has no overloaded methods, then you can simply use:
function hdel(handle key, handle... fields) returns int = @java:Method {
    class: "redis/clients/jedis/Jedis"
} external;

Else, you can specifically mention the parameter type as follow:
function hdel(handle key, handle... fields) returns int = @java:Method {
    class: "redis/clients/jedis/Jedis",
    paramTypes: ["java.lang.String", {class:"java.lang.String", dimensions:1}]
} external;

It is great coz Ballerina 1.0 keeps on to complain me about paramTypes mapping...really thx

@reidlai , since the question is answered, we are closing this issue. Please do reopen, if you have further queries.


Port gmod_tool_auto

I do also want to port over gmod_tool_auto (which I used to always have bound to mouse3?) that toggles between:
<tool used to make the ent you're looking at>
physgun
constraint tool
I think for plain props it did physgun, gravgun, constraint.

@Nebual, in !49

<tool used to make the ent you're looking at> would be interesting. I wonder if entities need to store the name of the tool selection convar that creates them?

I originally made this as an addon  (though since addons are dead currently, lets just bake it into the gamemode directly)
It mostly worked by assuming that ent.ClassName = 'ent_wirebutton' would work with a 'tool_wirebutton', though it allowed Entitys to define an optional tool (or list of) to override that assumption.
So far in this Component-based system, my Lamp has a LampComponent, and the balloon and wheel are just props with "balloon" or "wheel" added as Tags, so I'm not quite sure what we can use there. I am unrelatedly about to add
	protected override bool IsMatchingEntity( GameObject go )
	{
		return go.Tags.Has( "balloon" );
	}

to most tools (to know if we should Update its settings or Spawn a new one), we could plausibly iterate over instances of all tools matching them against <gameobject you're looking at> and see if any match.

Added in b948f33b8904ae5e5fb96e7f0132985c6dd8e329 - it just iterates through all the components in the trace.GameObject looking for ones with matching tools, works great for all the tools currently in.


Improve reliability of arbitrary generation of refined values

Fix bug in Choose instance of SafeIntForVector
Add custom generators for discrete refined numerical values
fix error in specification of "scan with offset k and limit j takes j data, starting from k" in ReadFilesSpec
use custom generators in specs

I'm not really up-to-speed on this Refined stuff, so can't really review the "discrete" business. Otherwise just a couple of comments.

Looks like travis has come back to life! :fireworks:
@mossprescott Your comment made me realize that it was probably worth writing up a quick summary of why NumericArbitrary is useful.

Current coverage is 78.88%

Merging #1102 into master will increase coverage by +0.02% as of ddf145f

@@            master   #1102   diff @@
======================================
  Files          176     176
  Stmts         9736    9736
  Branches       318     318
  Methods          0       0
======================================
+ Hit           7678    7680     +2
  Partial          0       0
+ Missed        2058    2056     -2

Review entire Coverage Diff as of ddf145f

Powered by Codecov. Updated on successful CI builds.

Just the comment on scalacheck style. Otherwise LGTM and hopefully will help with some of the Travis failures.

Please, please, please get this merged! 🙏🏽

LGTM.
NB: I just restarted the Travis build that failed, which was the "server restart" test. :disappointed:


[CLI] Adding library to libman.json should be consistent for CLI install and UI install

Minimal repro steps

run libman install<EMAIL_ADDRESS>on CLI
open UI adding client-side libraries, and install a library like<EMAIL_ADDRESS>open the libman.json file

Expected result
The libman.json should be look like something:
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library"<EMAIL_ADDRESS>"destination": "wwwroot/lib/jquery"
},
{
"provider": "cdnjs",
"library"<EMAIL_ADDRESS>"destination": "wwwroot/jo/"
}
]
}
Actual result
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library"<EMAIL_ADDRESS>"destination": "wwwroot\lib\jquery"
},
{
"provider": "cdnjs",
"library"<EMAIL_ADDRESS>"destination": "wwwroot/jo/"
}
]
}

We should be consistent about what type of slashes we use.


Vue wrapper bug (again)

I can't help but recreate this issue, because it is still not resolved for me and I have the feeling that something is going wrong. The problem is the same as in #14 basically, but now I have removed the intermediate component and I am using a list that I am reading from and writing to local storage and using v-for to render the list.
Here, once again, using the <input> component, it works fine, even when just using v-model instead of the more verbose version with v-bind:value="..." and v-on:input="$emit('input', $event.target.value)" and it works without any Vue errors or warnings in the console since I am not messing around with components directly this time.
This doesn't work for the <mathfield-mathlive> component though. Even if I exchange it with the verbose version and use v-on:input="$emit('input', $event)", as you pointed out in your last response. When the site loads, the values don't show up. It seems like the values are getting overwritten once I change them though. The initial values that are loaded from local storage just don't show up for some reason.
Also, I don't understand why this happens only with lists, since it works fine for an example with just one  tag and just one formula value.
This time I created JSFiddles so you can quickly see what I am talking about:

JSFiddle using v-model
JSFiddle using verbose version

I really don't know at this point whether I am just making some stupid mistakes all the time or whether there is actually something wrong here, but I can't figure it out.

I don't see the values load, but I get this in the console:

Vue warn: Error in mounted hook: "SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document."

Thanks for the JSFiddle, they're very useful, but could you include some step-by-step that I could follow to try to reproduce the problem?

@arnog Hm, that doesn't happen for me. Just did a quick google search of the error and maybe you have disabled third-party cookies in your browser?

Ah, indeed, that was the problem.
You need to set the value of the mathfield for it to be restored when you create it, that is, change:

<mathlive-mathfield v-model="formulaObj.value"></mathlive-mathfield>

to

<mathlive-mathfield v-model="formulaObj.value">{{ formulaObj.value }}</mathlive-mathfield>

@arnog, hmm but isn't this a non-Vue way to do it? Shouldn't v-model mean that the component automatically updates, even without the placeholder inside? Is it even possible to change this? 🤔

Dunno. Seems to be the way Vue works. Apparently you're not the first one tripped up by this: https://github.com/vuejs/vue/issues/8893

Closing, as this seems to be a Vue issue, and it does seem to be a design choice from Vue.


can you add two options ?

hi,
it will be great if user can define the border and height of Textarea

what about CSS? By design custom scrollbar uses CSS for customization

some times the border and height should be dynamic and the css options not good.
i already do the change in your plugin


[v2.12.0] Ensure CI/documentation reflect changes to default admin credentials

Background
Previously, when installing the security plugin demo configuration, the cluster was spun up with the default admin credentials admin:admin. A change was made in main and back-ported to 2.x for the 2.12.0 release, which now requires an initial admin password to be passed in via the environment variable OPENSEARCH_INITIAL_ADMIN_PASSWORD.  This will break some CI/testing which is relying on the cluster to come up without setting this environment variable. This tracking issue is to ensure compliance with the new changes
Coming from: https://github.com/opensearch-project/security/issues/3624
Acceptance Criteria

[ ] All documentation references to the old default credentials admin:admin are removed
[ ] Ensure that CI/testing is working with main and 2.x branches

[Triage] Hi @derek-ho thanks for filing this issue. Sounds like a good change for supporting the admin:admin changes.


Release 0.7.3

The new release with bug fixed and new version of GOLEM
Included changes:

[x] Bug fixes for TS - https://github.com/aimclub/FEDOT/pull/1153
[x] Reproducibility fix - https://github.com/aimclub/FEDOT/pull/1143
[x] Tests fixes https://github.com/aimclub/FEDOT/pull/1145
[x] GOLEM update to 0.3.3

Release was introduced in #1163 PR

На главной странице фреймворка до сих пор 0.7.2. Требуются ещё какие-то действия?

Требуется починка интеграционных тестов

set_random_seed must be removed in 0.7.3 release, since this feature has been moved to GOLEM


Handle errors

This pr handle all errors on termchat.
It makes the distinction between recoverable and non recoverable errors.
Recoverable errors are printed as messages.
Unrecoverable errors terminate the program gracefully while making sure to clean up.
For recoverable errors these two:
https://github.com/sigmaSd/termchat/blob/error_handling/src/application.rs#L94
https://github.com/sigmaSd/termchat/blob/error_handling/src/application.rs#L147
Also when we add sending files it should be added to this category.
The rest is unrecoverable.
/////
/////
Note:
This pr use a format_err function to stringify the errors produced here https://github.com/lemunozm/message-io/blob/master/src/network.rs#L194 I think it might be better if this function returned a new type instead.
example: Struct SendAllErrors(Vec<(Endpoint, io::Error)).
The benefit is we can then impl std::error::Error on it, so it can be simply handled with ? instead of a custom function.

I addressed all the points above, I think this is ready for a second round of review ^^

Turns out drop is called on panics https://doc.rust-lang.org/std/ops/trait.Drop.html#panics
I changed the pr accordingly.
This works well actually.
One thing to note if termchat  panics the terminal will be cleared and the user wont see the panic back trace, this can be workaround-ed by redirecting std-error to a file. (termchart 2>log).

Regarding the last point , the last commit now creates a log with the panic error and points the user with a message to it.

I think that the unwrap_unwind allows to get the panic message to panic it later. I will investigate it.
Anyway, I like so much your approach given the terminal constraints.
The std::mem::forget for the Guard is really cool :)
I approve it!
Thanks a lot.

Just making sure saw the last commit https://github.com/lemunozm/termchat/pull/7/commits/c4c72e875b0de84fda87fd63cfcd68021e87f22e

Notes:

The hook needs to be taken after being set, so we can restore the default panic hook. So panic backtrace can be read as usual using the stderr redirection. (The log contains only the panic message not the backtrace). I can add a pr later.

You can switch in the future to anyhow crate, it should be a drop in replacement for the current Error and Result type.
There are some benefits like the ability to add context to any error.

The hook trick actually might not work hmm, I guess it just better to remove the custom hook and just print that "termchat has panicked you can  termchat 2>log for more info"


Interpolating built-in source snf-2011fe results in partially negative spectrum

I stumbled upon this while playing around with the built-in TimeSeriesSource for SN2011fe.
Interpolating the spectrum to around 40 days after peak seems to cause the blue part of the spectrum to go negative. As a result of this, when requesting an interpolated light curve in e.g. ztfg there is a region where light curve disappears.
For instance, by running the following code:
import sncosmo
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(-15, 95, 111)
test = sncosmo.get_source('snf-2011fe')
plt.plot(test._phase, test.bandmag('ztfg', 'ab', test._phase), label='built-in')
plt.plot(x, test.bandmag('ztfg', 'ab', x), label='built-in interpolated')
plt.xlim(-20, 110)
plt.ylim(16, 9.5)
plt.legend(loc='upper right')
plt.show()

plt.plot(test._wave, test.flux(40, test._wave))
plt.show()

I plot the light curve, while only using the phases of the spectra in the TimeSeriesSource (No interpolation, blue curve).
I also plot the light curve by interpolating to get the magnitude each day (orange curve).
The second plot shows the interpolated spectrum at phase=40. The blue part of the spectrum, up to 5500 Angstrom is too low.
This is the result from the code above:

The issue seems to come from the spline interpolation combined with the large gap between spectra in the TimeSeriesSource (last one is at phase=23.7 & next one is at phase=74.1) allowing inaccuracies in the interpolation to grow.
It might be possible to remedy this by changing the order of the spline, but I have yet to find a way to change it. kx & ky are currently both fixed at 3 inside the TimeSeriesSource.
So in short, I found an interpolation problem within the built-in SN2011fe source. The problem itself might however be more general if it is rooted in the spline interpolation in a TimeSeriesSource.

Yes, this is a problem that shows up for several of the sparsely sampled TimeSeriesSources. There was discussion about this in #203 from a few years ago.
We should probably be using linear interpolation for time series like this one with large gaps instead of spline interpolation.

By the way, if your goal is just to get a model of a normal Type Ia supernova, I'd recommend either using the Hsiao template ('hsiao' in SNCosmo) or the SALT2 mean model ('salt2' in SNCosmo). The SN2011fe "model" is really just a bunch of spectra and will never be a very accurate model at times where there are no nearby spectra.

I was building my own SN2011fe model using different spectra, and wanted to compare it to the built-in one. My model has the same issue, but at different phases. Changing the spline order seems to work quite well.


Audio distance in scene config does not seem to take effect

Distance seems to be set at the 30m default.  Need to check.

arena main


Force setting a user name ?

if accessing with http://ec2-16-171-209-243.eu-north-1.compute.amazonaws.com/chat it allow you to skip setting a username and gives a random one

This is being implemented as part of #13


Support sharding the CSI volumes OMAP, to overcome large (>200k) volume counts per pool/cephfs instance

When ceph CSI started maintaining its journal in RADOS one if the concerns raised [1] was around the scale limits of a single RADOS object (which as of this writing is ~200k keys per object).
The CSI volumes directory RADOS object, per pool, maintains a single object that contains a key per currently in-use volumes (the csi.volumes.<InstanceID> object). At the scale limits of keys per object, meaning ~200k images per pool (or per cephfs instance, as we use the cephfs metadata pool to store the same), we would need to shard this object to overcome the RADOS per object key limits.
This is a concern in the future, and not an medium term problem, but noting this down in order that it is not missed as a reference when work is taken up towards the same.
Also noting this down due to discussion around key counts in this PR with @dillaman
[1] Older discussion references on sharding the CSI directory object:

comment 1
comment 2

For snapshot OMap directory, as there can be more snapshots per volume, we may reach the RADOS per object key limits sooner.
There was a fleeting desire to create a per parent-image-UUID named snapshot OMap directory, but that will not catch snapshot name collisions across different parent UUIDs, which is required by the CSi plugins.
For the snapshot OMap as well, we would need some form of sharding, @dillaman had some further thoughts on the same that I am capturing verbatim below:
RGW "solved" this issue in the past by first using sharding across a
fixed number of objects (i.e. hash the name and pick the destination
omap index object by modulo the number of objects). The downside to
that approach was that it required the user to pick the expected
maximum number of objects prior to establishing the cluster (or do an
offline reshard). Since RGW needs to always be up and it can expect to
continuously grow, they then switched to dynamic sharding [1] to
permit growth into the hundreds of millions of indexed objects.

I realistically would never expect the CSI to need the extra
complexity of something like dynamic sharding. However, you could
implement a backwards compatible fixed sharding scheme in the future
where the CSI driver sets the shard object upper limit (power of two)
and it recursively searches for a hit in decreasing shard objects
upper limits until it finds a hit. If and when it finds a hit, it
should move it to the correct shard so that future accesses don't need
to perform the search and it helps to reduce pressure on the "older"
objects.

[1] https://docs.ceph.com/docs/mimic/radosgw/dynamicresharding/


Added support for scopes

These changes allow for scoping routes by introducing the Scope middleware, which may be used as follows:
router.get('/myRoute', app.oauth.authorise(), app.oauth.scope('scope_key'), function (req, res) {
   res.status(200).json({ message: 'Scope-protected route!' });
});

router.delete('/account', app.oauth.authorise(), app.oauth.scope({ 'account': [ 'write' ] }), function
(req, res) {
  // ...
});

It requires two new methods in the model: checkScope and saveScope. In order to properly support scopes in the authorization code grant flow, the saveAuthCode method must now also accept a scope parameter, which should be stored and later retrieved during the call to getAuthCode.
In implementations, saveScope should sanitize and validate the requested scope keys before proceeding with storage. How scopes are represented is left up to the developer.
When the authorisation flow is executed for a scope-protected route, the middleware passes the token object and the scope requirements to checkScope, which might return an 'invalid_scope' error if the criteria are not matched.
The Readme file has been updated to reflect these changes, and some updates were made to the postgresql example. I'd be happy to provide a more complete example if you feel this is heading in the right direction. I'm working on the tests at the moment, but I'd appreciate any and all feedback/advice on how best to write them, as I don't have much experience in the matter.
Don't hesitate to ask if anything's unclear.
Thanks for reviewing!

Hi
Thanks for working on this I think this will be a very valuable addition to this project.
Just a question - why a different middleware function ?
As you wrote - the authorization flow acts a little differently under a specific flow. Also I can't see a case where the scope function is used without the authorize one.
May I suggest that instead of -
app.oauth.authorise(), app.oauth.scope('scope_key')
We can have -
app.oauth.authorise({scope:'scope-key'})
Or maybe
app.oauth.authorise().scope('scope-key')
?
Thanks
Sent from my iPhone
On 28 בינו 2015, at 03:53, Lars F. Karlström<EMAIL_ADDRESS>wrote:

These changes allow for scoping routes by introducing the Scope middleware, which may be used as follows:
router.get('/myRoute', app.oauth.authorise(), app.oauth.scope('scope_key'), function (req, res) {
res.status(200).json({ message: 'Scope-protected route!' });
});
It requires two new methods in the model: checkScope and saveScope. In order to properly support scopes in the authorization code grant flow, the saveAuthCode method must now also accept a scope parameter, which should be stored and later retrieved during the call to getAuthCode.
In implementations, saveScope should sanitize and validate the requested scope keys before proceeding with storage. How scopes are represented is left up to the developer.
When the authorisation flow is executed for a scope-protected route, the middleware passes the token object and the scope requirements to checkScope, which might return an 'invalid_scope' error if the criteria are not matched.
The Readme file has been updated to reflect these changes, and some updates were made to the postgresql example. I'd be happy to provide a more complete example if you feel this is heading in the right direction. I'd appreciate some advice on how to write the tests for these changes.
It might also be a good idea to make scoping a configuration option.
Don't hesitate to ask if anything's unclear.
Thanks for reviewing!
You can view, comment on, or merge this pull request online at:
https://github.com/thomseddon/node-oauth2-server/pull/149
Commit Summary
Implements scope support
Scoping is now implemented using middleware
The checkScope method now receives the entire bearerToken object
Updated Readme and postgresql example
File Changes
M Readme.md (25)
M examples/postgresql/index.js (6)
M examples/postgresql/model.js     (47)
M examples/postgresql/schema.sql     (1)
M lib/authCodeGrant.js (6)
M lib/error.js (1)
M lib/grant.js (23)
M lib/oauth2server.js (21)
A lib/scope.js (65)
Patch Links:
https://github.com/thomseddon/node-oauth2-server/pull/149.patch
https://github.com/thomseddon/node-oauth2-server/pull/149.diff
—
Reply to this email directly or view it on GitHub.

Hello there,
Thank you for the feedback! There are two reasons that I went with a separate middleware here, please tell me if the following seems odd.
First, since express manages the concept of routers, I thought it might be valid to protect an entire collection of routes with a single "instance" of the auth middleware, and then define finer-grained scope permissions on a per-route level (though you may, of course, also protect the entire router at once as well).
Example:
var account = express.Router();
account.all('/*', app.oauth.authorise());

account.get('/', app.oauth.scope({ account: ['basic'] }), function(req, res) {
  // ...
});

account.put('/', app.oauth.scope({ account: 'write'] }), function(req, res) {
  // ...
});

// ...
app.use('/account', account);

The second reason has a bit to do with the first. I might have some misconceptions here, but I believe that, since every inclusion of middleware basically creates a new function (thus my use of "instance" above), it would be preferable to keep said method as lightweight as possible. I'm afraid I can't back this up with a more solid claim though, since I haven't really investigated how this works.

Ok - that's a great example of why you would want those separate. Looks
great.
Thanks for the explanation and the work.
On 28 January 2015 at 21:13, Lars F. Karlström<EMAIL_ADDRESS>wrote:

Hello there,
Thank you for the feedback! There are two reasons that I went with a
separate middleware here, please tell me if the following seems odd.
First, since express manages the concept of routers, I thought it might be
valid to protect an entire collection of routes with a single "instance" of
the auth middleware, and then define finer-grained scope permissions on a
per-route level (though you may, of course, also protect the entire router
at once as well).
Example:
var account = express.Router();
account.all('/*', app.oauth.authorise());
account.get('/', app.oauth.scope({ account: ['basic'] }), function(req, res) {
// ...
});
account.put('/', app.oauth.scope({ account: 'write'] }), function(req, res) {
// ...
});
// ...
app.use('/account', account);
The second reason has a bit to do with the first. I might have some
misconceptions here, but I believe that, since every inclusion of
middleware basically creates a new function (thus my use of "instance"
above), it would be preferable to keep said method as lightweight as
possible. I'm afraid I can't back this up with a more solid claim though,
since I haven't really investigated how this works.
--
Reply to this email directly or view it on GitHub
https://github.com/thomseddon/node-oauth2-server/pull/149#issuecomment-71895997
.

@lfk: I was in need of scopes and was planning on doing my own PR. Thank you for working on this!

@avnersorek: Thanks for validating the concept. :)
@nunofgs: You're welcome! I do agree with the issues you pointed out in the documentation and examples, and I'll fix them asap -- just got to extend the tests to make the build pass as well.

Hi @lfk - firstly thank you for your work on this PR already, it's probably one of the best this project had ever had with regards to implementation quality and code style likeness.
I've thought about this in the past and one of the reasons I've always been reluctant was that I knew it would probably
I agree with @avnersorek 's query about using a separate middleware and your justification ma

Hi @lfk - firstly thank you for your work on this PR already, it's probably one of the best this project had ever had with regards to implementation quality and code style likeness.
Here's my thoughts:
Authorisation

As per @avnersorek 's query, I'd never imagined it as another middleware but your use case seems perfectly valid, however to make to majority use case simpler I'm tempted to allow scope to also be an optional argument for auth authorise function
I think it should be required that scope is returned alongside the access token in getAccessToken. checkScope would simply be passed the scope associated with the access token and the required scope. We could even offer a default implementation that just does something like if (scope.indexOf(requiredScope)) { /* ok */ } else { /* not ok */ }, users could override if they want to get more fancy

Granting

I think it's preferable for scope to be saved as part of the saveAccessToken method as oppose to updating it once it's in place (as you have done with saveAuthCode)
This PR seems to focus on the auth_code grant, I would like to cover all grant types and I think by injecting it into the existing saveAccessToken this should be relatively easily achieved.

General

I think internally we should always treat scope's as an array's, so everything we pass out to model methods should be an array, some backends (e.g. document based like mongo) would then be able to store them natively

Thoughts appreciated

@thomseddon: Thank you for the encouraging words! Addressing your feedback in order:

I tried out an optional scope param for authorise. It was trivial to implement and stacks well with the custom scope middleware; it's even possible to define a "top-level" scope on a router using authorise, and add finer-grained checks with scope on specific routes. The only "con" I see here is that it opens up for multiple ways to get the job done, which might add some confusion. I'll tinker with it a bit more and add it to the PR.
Agreed. That's how I've got it implemented on my project at the moment, and it feels like the right way to go. I do like the idea of a default checkScope implementation.
There's no reason not to merge the two methods, so no objections there. I went with the isolated saveScope method for this PR in order to keep the proposed changes as isolated as possible from the master code.

One note here though is that, before saving, there should be some validation performed. Up to the developer, of course, but still. Again making reference to my application, I've got a setup in which clients are assigned a set of scopes they may solicit from the user; any other key is filtered out before saving, thus avoiding injection of undesired privileges by injecting code on authorisation dialog pages, etc.
Though the auth_code flow is what is currently (somewhat) documented in the examples, the present implementation does work for all available grant types. saveScope is always run after saveAccessToken, regardless of which grant flow is being utilized.

As for internal representation, is there any reason not to go with Objects? After parsing the requested string, that's how I'm working with it in my application at the moment; being able to define required scopes as { "account": ["read", "write"] } feels straightforward, and it supports arbitrarily complex, multi-level setups with the same advantages of possible native storage. A drawback here is that it adds quite a bit of complexity to the default checkScope implementation though.

@nunofgs: You're absolutely correct -- whith the understanding that this is not the single, mandated manner of implementing scope storage. I opted for the most straightforward, string-based example here, leveraging the available example code, but there's nothing limiting the developer from creating, say, a connection table between access tokens and a table of available scopes. Since all interaction between the library and the application is defined via oauth.model, there shouldn't be anything hindering the developer from using a single token table at the moment, adding "WHERE" clauses to the getAcessToken and getRefreshToken methods, respectively. It might be of interest to make this the reference implementation though.

@lfk: Are you working on this PR? I'd like to give you a hand but I don't want to spend time implementing anything you've already done :)

@nunofgs: Absolutely, I'm still working on it. :) I'm awaiting some response on the above discussion before proceeding with any major changes (such as creating a default scope validation method), but there's still plenty to be done, and your help would be much appreciated. I suppose the easiest way to proceed here would be for you to fork ubilogix/node-oauth2-server and submit a PR to the feature-scope branch.

I'm thinking we roll this, full state support and a few other changes into a 3.0.0 release so I'd rather make the implementation correct rather than compromising for backwards compatability - so please go ahead with changing the signature for the getAccessToken etc. to include scope.
On internal representation, the spec specifies that scopes should be sent as a space separated string so we can't really make any more assumptions that that - I see you've implemented nested scopes (JSON body?) but I think trying to support that is outside the scope of the module, of course it would be relatively trivial to parse the scopes yourself...
If this was a common use case we could even offer a parseScope model method, the default implementation would just be function (scope) { return scope.split(' ') } but if you want to get fancy you could - does anyone else think this is needed?
Have I missed any other outstanding questions?

@thomseddon I agree that the getAccessToken method should be called with a space-delimited string. If the developer wants to store that as an array, they can go ahead and parse it themselves, i.e., the parseScope idea could be the way to go but IMHO is a bit too much to introduce now.
In fact, the more I think about it, the more I believe that scope should be a string. This library only intends to implement the spec, not make the choice of data type for every field. The spec says it is a string and that's where the responsibility of this library should end :)

I agree with @nunofgs above, scope should be a string. In order for this library to maintain its portablity you shouldn't make any assumptions as you have no idea of how everyone will implement their scope setup.
Plus it takes no effort to parse a string of scopes if they are comma or space separated.

@lfk I've been working on a PR for you so I have a few questions. Hope you don't mind.
Regarding the choice between a separate scope middleware or keeping it in authorise({ scope: 'foo bar' }), I'm also in favor of removing the scope middleware.
My reasoning is that, while your use case is interesting, it still requires that the "authorise" middleware is executed before the scope middleware. Otherwise, we'll need to verify that we have a token, i.e.:
// in Scope.js:59

function checkScope (done) {
  // We'll need to make sure that we have a this.req.oauth.bearerToken here!
  if (!this.req.oauth) {
    throw new Error('Cannot use the scope middleware without the authorise middleware first');
  }

  this.model.checkScope(this.requiredScope,
      this.req.oauth.bearerToken, function (err) {
    if (err) { return done(new error('invalid_scope', err)); }
    done();
  });
}

However, this seems strange to me. If this error is thrown, it is a configuration/programmer error. It feels like we shouldn't give developers the ability to fall into this code-path.
Going back to your original example:
var account = express.Router();
account.all('/*', app.oauth.authorise());
account.get('/', app.oauth.scope({ account: ['basic'] }), function(req, res) {
  // ...
});
account.put('/', app.oauth.scope({ account: ['write'] }), function(req, res) {
  // ...
});

I would still prefer changing the above to app.oauth.authorise({ scope: ... }). If we want to improve performance we can always improve the authorise middleware by introducing caching per-request (but I'd leave that for another PR).

@nunofgs: Nice catch on the bearer token check! For me it feels quite reasonable to do it that way, though, so I'd still argue for maintaining the separate scope middleware. If a developer attempts to use the library "the wrong way," an error like the one you gave as example feels entirely justified. As it stands, authorise goes through a non-trivial process to extract the bearer token from the request; it definitely wouldn't make sense to repeat this process multiple times. With the scope middleware, everything up to and including nested routers and route-level scope checks are supported, and depending on how the programmer choses to implement checkScope, every call may boil down to something simple like scopes.indexOf(required_scope) !== -1. Reworking authorise to accomodate for this feels out of scope for this PR (pun only somewhat intended).
Now, regarding the merging of saveAcecssToken and saveScope. I somehow overlooked this eariler in the discussion, but in order to support the refresh token grant flow, we need some way of maintaining the scope even as the old access token is invalidated/removed from the database (@nunofgs pointed this out here). At the end of the day, this is model-specific and thus left up to the developer. Viable options I can think of include:

Storing the scope string on both the access and refresh tokens (con: data duplication)
Storing the scope string on the access token and retrieving it during calls to getRefreshToken (cons: requires that the access token remains available, even if expired; makes getRefreshToken more complex)
Storing the scope in its own connection table between a user and a client (cons: another table; logically, scope "should" belong to a token, not to a client-account pair)
Handling a single oauth_tokens table, in which a single row contains  AT, RT, as well as scope (cons: also hinders interesting options such as storing ATs in a redis cache with expiration)

I feel it's important to "get this right" though, in order to reduce friction and confusion when a developer looks to use the library. Any thoughts?
@thomseddon: Do you have any rough target date for the 3.0.0 release?

On storing scope: @lfk as you say, from the module's perspective all it asks is getAccessToken, getRefreshToken - how you return scope as part of this is completely up to the developer, within these functions you have the ability to do any number of queries, joins etc. The only question is what we should show in the examples and I think if I was going to implement this, I would just duplicate the data and store scope alongside refresh tokens and access tokens, but this is subjective/dependent on use case
On 3.0.0 timeline - I just want to get the open tickets merged, no specific time frame

Thanks @thomseddon. Would you mind weighing in on the scope debate as well, please?

Are there any more updates/status' on this PR?

@OllieJennings I'd like to finish up this PR by submitting some changes to @lfk's PR, but first I need to know the following:
@thomseddon: Should we support the separate scope middleware?
Keep in mind that by supporting it we'll need to add some robust error handling to that middleware since it requires that the authorise scope has been setup correctly, earlier in the middleware-chain.
Also, the scope middleware will be duplicating the work that the authorise scope currently does but I can try chaining the authorise and scope middleware.

@thomseddon Additionally, what do you think of refactoring all of the errors out into their own classes and letting models access and throw these errors?
This would help in cases like this one, where it would be useful to pass along a different message.
Improving the error architecture feels like feature-creep so I'd like to propose that we leave that for another PR (which I'm happy to submit).

Sorry for the delay guys, always busy as I'm sure you all are too :)
On having the scope middleware, honestly I'm OK with the concept as long as it's not too big - I don't think it requires more "robust error handling" than the existing check for this.req.oauth - unless I'm missing something?
I don't think there would be too much duplication, the proposed implementation is pretty small already?
On re factoring errors, I like the idea of allowing developers to throw their own, however I'm not sure where this would be needed - my feeling is that the module has probably failed if this is necessary. But agree this is to be discussed separately - would love to see at least the outline of a PR to be proved wrong :)

Looking good!!
Two remaining things:

Remove remaining references to saveScope
Resolve the issues highlighted by @nunofgs regarding how scope is returned with refresh tokens in the postgres reference implementation: https://github.com/thomseddon/node-oauth2-server/pull/149/files#r24001262

For 2 I prefer the first solution proposed by @nunofgs of adding a "scope" column to the refresh_tokens table?

Since saveRefreshToken does not pass the scope string to the model, it'll be necessary to query for the access token's scope string regardless; not too pretty.
Other than keeping the model methods lean, is there any reason we don't run generateAccessToken, then generateRefreshToken, and then a combined saveTokens method rather than AT, RT? Perhaps the convenience of having the scope string immediately available for both tokens here would take precedence? Thoughts?

I think my preference would be to just add the scope to the saveRefreshToken model method?

Question - when issuing access tokens, how does one filter scopes that are granted to the user who's logging in? If the scopes 'readonly', 'edit', 'admin' are valid for my app, how do I use this PR to allow me to selectively issue only the "readonly" scope?
I would have expected the authorization server to check which scopes the user is authorized for in the client's context. The updated samples have the client passing in scope to the /token endpoint, which seems to indicate they already know which scopes a user should have, and the auth server simply validates that the requested scopes are whitelisted. It seems to me that both clientId and user should be passed to validateScope to facilitate this capability.
...unless of course I'm missing something completely, which wouldn't be unprecedented. Much appreciated.

Scopes are pretty handy, yes. I found a way to implement them without having to change this library:
OAuthAccessTokensSchema.static('saveAccessToken', function(token, clientId, expires, userId, next) {
	APP.models.OAuthClientsModel.findOne({ clientId: clientId }, function(err, oauthClient) {
		if (err) return next(err);
		if (!oauthClient) return next(new APP.errors.NotFound('Oauth cient not found'));

		var fields = {
			clientId: clientId,
			userId: userId,
			expires: expires,
			scopes: oauthClient.scopes
		};

		OAuthAccessTokensModel.update({ accessToken: token }, fields, { upsert: true }, function(err) {
			if (err) {
				console.error(err);
			}

			next(err);
		});
	});
});

And a piece of middleware to check:
module.exports = function(scope) {
	return function(req, res, next) {
		var errors	= APP.errors;
		if(req.oauth.bearerToken) {
			if(typeof scope === 'string') {
				if(req.oauth.bearerToken.scopes.indexOf(scope) >= 0) {
					next();
				}
				else {
					next(new errors.Unauthorized('Scope ' + scope + ' needed to access this resource'));
				}
			}
			else if(Array.isArray(scope)) {
				for(value in scope) {
					if(req.oauth.bearerToken.scopes.indexOf(scope[value]) === -1) {
						next(new errors.Unauthorized('Scopes ' + scope.toString() + ' needed to access this resource'));
					}
				}
				next();
			}
			else {
				next(new errors.Internal('Wrong scope format'));
			}
		}
		else {
			next(new errors.Unauthorized('No access token found'));
		}
	}
};

Feel free to reach out for some more details.

What is the status on this? Looks about complete, would be great to get this merged in!

:+1: Could really use this!

+1 for a merge!

This was added in #203.

@lfk is this branch stable? I could definitely use scopes while I wait for the refactor/3.0.0 merge to go through.

@jacoscaz - I've been using it with postgresql in production since May and haven't noted any issues. #203 might be a better baseline though since it has more traction and obsoletes this PR.

Thank you @ccamarat for your insight. I'll wait a couple of days more and then decide what to do.

@mjsalinger: This is now deprecated.

This is now covered by the 3.0.0 rewrite. @lfk, please open a new issue if anything is missing from this feature.


Fix backup styles lookup for data providers that doen't provide styles

Fixes #168
Signed-off-by: Bernd Hufmann<EMAIL_ADDRESS>

Same trace as in issue #168 shown in the flame chart:


Tesseract

Hi,
I've done some testing with Tesseract on Text Grab 4.0.0 preview 1.

I installed Tesseract 5.3.1 (https://github.com/UB-Mannheim/tesseract/wiki), and through the installer, I also installed the English and the Spanish trained data files.

I turned on the Tesseract on Text Grab.

I tried to take a fullscreen grab but nothing happened.

https://user-images.githubusercontent.com/9334287/235002368-18f005b0-5483-458f-94f8-5ebf98a2c71f.mp4

I thought Text Grab was unable to detect Tesseract and I wondered if I had made a mistake selecting Install just for me, so I uninstalled the Tesseract and I installed it again, this time selecting Install for anyone using this computer.

The result was the same, as seen on the previous video.

Then I wondered if maybe the problem had to do with the Spanish model and, on Text Grab, I selected English: this time it did perform the OCR.

Some comments (see attached file):
tesseract_test.zip

The OCR doesn't produce a good result and there's some noise (the Microsoft OCR engine does better).

The OCR for English GB and the OCR for English US don't produce the same result.

The trained data files are quite small (3,93 MB for English and 2,18 MB for Spanish). It makes me think if the trained data files correspond to a low quality type (at least in past versions of Tesseract, there was a fast model). Through Subtitle Edit, I managed to download the Spanish trained data for Tesseract 5.3.0 and it was a 17.4 MB file.

There are many things which need to be done surrounding Tesseract to make it more understandable and not just fail quietly. For now I am going to add the word EXPERIMENTAL to the Tesseract toggle to highlight there will be rough edges. There are several items in this issues we'll need to break down into smaller items and plan for how to address them. That will likely be on 4.1 or later.
I appreciate you working though the details and letting me know how it is working for you. Let's use this issue as a catch all discussion for what needs to be fixed to make the Tesseract experience awesome.

I'll be glad to help, Joe.

From your original comment here is what might need to get done:

Better error reporting (no silent fail)
Validate path of Tesseract Exe
Pick and set path of Tesseract Exe
Only try installed Tesseract languages
More links for downloading languages
Look into managing Tesseract languages via CLI
Pick a similar language if the selected language does not match any installed language

It looks like a reasonable list.
In the best possible scenario, Tesseract would be included in Text Grab with an interface to download languages: I like the way Subtitle Edit does it, for example.

Hi,
I've been doing some research about Tesseract and I have realized that the Mannheim installer installs the fast trained data model: that's why the files were smaller. Those files can be manually replaced by the "standard" trained model, which should be more accurate and not too slow for more computers.
I have tried it and it works, but again, not with Spanish. As for English, I still prefer the Microsoft OCR tool, as Tesseract introduces more noise: yesterday, it tried to OCR the file logo on a screenshot of File Explorer, and now I can see that it sometimes fails to OCR the quotation marks.

Hi,
I was having a look at the new version of NormCap and it looks like what I called "noise" is produced inevitably by Tesseract, as it was conceived for printed text. This page is quite interesting and might be useful for your implemention:
https://dynobo.github.io/normcap/#faqs-improve-detection

@vivadavid Hello, can you explain more how did you get such standard trained models?
Also, this might be out of this question context, but my interface is only showing En-us and Ar ( my keybaord), is there a way to add more languages to the list? i already downloaded theme in tessaract installer
Thanks!

@vivadavid Hello, can you explain more how did you get such standard trained models? Also, this might be out of this question context, but my interface is only showing En-us and Ar ( my keybaord), is there a way to add more languages to the list? i already downloaded theme in tessaract installer Thanks!

Hi, the standard trained data models are here:
https://github.com/tesseract-ocr/tessdata
You download a particular language and replace your previous .traineddata file.
As for the Microsoft OCR and interface languages, you go to Windows Settings,  and then (I'm translating, as my Windows is in Spanish) to Time & Language > Language & Region > Add a language.
I hope this helps.

@vivadavid Hello, can you explain more how did you get such standard trained models? Also, this might be out of this question context, but my interface is only showing En-us and Ar ( my keybaord), is there a way to add more languages to the list? i already downloaded theme in tessaract installer Thanks!

Hi, the standard trained data models are here:
https://github.com/tesseract-ocr/tessdata
You download a particular language and replace your previous .traineddata file.
As for the Microsoft OCR and interface languages, you go to Windows Settings, and then (I'm translating, as my Windows is in Spanish) to Time & Language > Language & Region > Add a language.
I hope this helps.

Hi, unfortunately, I also tried installing Vietnamese but it doesn't seem to show up in the language selection section, I tried Japanese and it is normal. Thanks for reading this!

Hello @neilfranci right now the language of Tesseract follows the selected Windows language. You have to install the matching language on Windows in order to select it on Tesseract.
I plan on improving the support of Tesseract, but for now it is an experimental feature. If you have any other feedback please let me know.

I can't remember in Windows 10, but in Windows 11 is pretty easy to install a new language. I've just checked, out of curiosity, and Vietnamise is also avalaible for me on my Spanish Windows.

Hello @neilfranci right now the language of Tesseract follows the selected Windows language. You have to install the matching language on Windows in order to select it on Tesseract.
I plan on improving the support of Tesseract, but for now it is an experimental feature. If you have any other feedback please let me know.

Oh, my bad for the confusion.
I'm talking about the Microsoft OCR, not Tesseract, cause changing the window interface language is not optimal.
I have a video to show the problems.
https://github.com/TheJoeFin/Text-Grab/assets/66520542/71a4b626-fb30-405e-a9f1-8100224d962a
You can see the Vietnamese option doesn't seem to show up.
I think I should make the new issue instead of comment this one, sorry for my mistake.

Hi, @neilfranci ,
It looks like the Vietnamese language package doesn't include OCR capabilities.
My screenshots are in Spanish, but you can see, at the bottom, that French includes recocimiento óptico de caracteres (OCR):

Whereas the Vietnamese language package doesn't include it:

Maybe you could add a suggestion on the Feedback app for Windows. Or wait until Tesseract can be used with Text Grab.
Good luck!

@vivadavid Ahh, I don't see that at first. Maybe, I'll wait until Tesseract can be used with Text Grab. Thanks~!

@neilfranci and @vivadavid v4.1 now has Tesseract lang detection and selection. Give it a try and let me know how it works for you. I'll close this issue and break it into smaller issues for tracking


Help Setting Up Lograge

We have logging set up like so:
  config.log_level = :info
  config.log_tags = [:uuid]
  require 'syslogger'
  logger = Syslogger.new("Rails", Syslog::LOG_PID, Syslog::LOG_LOCAL7)
  config.lograge.enabled = true
  config.lograge.formatter = Lograge::Formatters::Json.new
  config.logger = ActiveSupport::TaggedLogging.new(logger)
  config.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase)

We however continue to get the "rendered" log messages as shown in the README.  I'm very unfamiliar with Rails logging and how this should work properly.  I'd like to not have the "rendered" log messages any more, no one here uses them.  I also need it to go to logging facility 7 so that logs get shipped out to Loggly.  This currently works, but like I said, has all the "rendered" messages.
Any help you can provide or documentation hints would be greatly appreciated.

@nwalke what environment are you testing in? What environment did you set up the config for?

We were testing under "staging".
On Jan 13, 2016 1:48 AM, "Andreas Tiefenthaler"<EMAIL_ADDRESS>wrote:

@nwalke https://github.com/nwalke what environment are you testing in?
What environment did you set up the config for?
—
Reply to this email directly or view it on GitHub
https://github.com/roidrage/lograge/issues/159#issuecomment-171208176.

@nwalke so all the above code is stored within your staging.rb environment file?
It seems weird that you are seeing the rendered messages. What version of rails are you using?

@nwalke did you resolve the issue? What was the cause?

Also interested in the cause as have seen this too.

Unfortunately I don't remember how or if this was ever resolved.  I've moved on from the company that was using this.

No worries @nwalke, cheers for getting back to me! I'll do some digging then maybe raise a new issue.

I think I have found the issue for me. New app I've taken on and there was already some historical commented out usage in production.rb.

I have faced the same issue. And I found the root cause. Some gems overrides the ActionView::LogSubscriber (eg. Kaminari gem). It would cause the lograge's unsubscribe method fail. Calling public_method(false) on the ActionView subscriber return s unexpected methods list (doesn't include the ActionView::LogSubscriber event handlers)
https://github.com/roidrage/lograge/blob/master/lib/lograge.rb
  def unsubscribe(component, subscriber)     events = subscriber.public_methods(false).reject { |method| method.to_s == 'call' } # this line cause the bug     events.each do |event|       ActiveSupport::Notifications.notifier.listeners_for("#{event}.#{component}").each do |listener|         if listener.instance_variable_get('@delegate') == subscriber           ActiveSupport::Notifications.unsubscribe listener         end       end     end   end
Hope this would help someone still struggle


Security-research-implement

This is a A05-rearch in the pdf
A05: Security Misconfiguration

@kaimanasse15 Can you please post your research on notion? I will close this pull request.


[fuel-core] Merge fuel-coroutines into core to improve suspending request support

Refactoring
Description
core already has a dependency on coroutines and still we have a seperate fuel-coroutines module
so we save nothing on size or dependencies from having fuel-coroutines in a separate module
Files to process

[ ] fuel-coroutines
[ ] update fuel-kotlinx-serialization
[ ] update fuel-gson
[ ] update fuel-jackson
[ ] update fuel-moshi

Why this is necessary**
fuel-gson, fuel-coroutines, other serialization formats etc
are limited in adding support for suspending requests

i was informaed that just because core uses suspend it has no dependency on coroutines-core
the question now is.. is there a better way to support this or is coroutines core light enough to include ?


Update scheduler-xml-reference.adoc

corrected default value of "disallowConcurrentExecution" attribute, set to "false"
corrected spelling of "disallowConcurrentExecution" attribute

rationale:
After seeing some unexpected behavior in our applications and running some tests, if the "disallowConcurrentExecution" attribute is not added then concurrent executions of the flow occurs with a scheduler endpoint.  So the default is "false" and not "true".
Tested by adding a transform with a "wait(10000)" to a flow with a scheduler endpoint set to run on fixed frequency of 1000ms.  So scheduler executes every 1 second, and the transform within it waits 10 seconds.
Without setting  "disallowConcurrentExecution", the runtime executes the flow every 1 second, resulting in 10 concurrent executions.
Setting  "disallowConcurrentExecution" to "true", the runtime executes the flow every 10 seconds, resulting in 0 concurrent executions.

it looks like the same fix was already applied here:
https://github.com/mulesoft/docs-mule-runtime/pull/1313
this PR also includes a spelling correction.

created https://github.com/mulesoft/docs-mule-runtime/issues/1442 to link multiple PR's

Thank you for your contribution. Your suggested change is correct. We will make the change via a different PR.
To enable us to accept pull requests from you, please read the contributor's agreement: https://github.com/mulesoft/docs-mule-runtime/blob/latest/README.adoc. Then log into Anypoint Platform (https://anypoint.mulesoft.com/), open the page at https://api-notebook.anypoint.mulesoft.com/notebooks/#d28e8f95e739ee1e1e30d5ec577f4a27, and follow the contributor registration process.

Handling this PR via https://github.com/mulesoft/docs-mule-runtime/pull/1543/files


⚠ PrivateHD has degraded performance

In 52a4122, PrivateHD ($PHD) experienced degraded performance:

HTTP code: 200
Response time: 5833 ms

Resolved: PrivateHD performance has improved in d5afffc.


this object in listeners on client should be the EventEmitter object

As node.js documentation says: "Inside a listener function, this refers to the EventEmitter that the listener was attached to".

Hi, thanks for reporting,
Makes sense, so we should replace window with self at https://github.com/raix/Meteor-EventEmitter/blob/master/eventemitter.client.js#L88

You would also need to move _runCallbacks inside .emit so it knows about self.
Alternatively, you could rewrite .emit and get rid of _runCallbacks completely. Something like the this should do it (I haven't tested it):
// emitter.emit(event, [arg1], [arg2], [...])#
// Execute each of the listeners in order with the supplied arguments.
EventEmitter.prototype.emit = function(eventName /* arguments */) {
  var self = this;

  // Make argument list to pass on to listeners
  var args = _.rest(arguments);

  // Construct the list of listeners to trigger
  var onceList = self._eventEmitter.onceListeners[eventName] || [];
  var onList = self._eventEmitter.onListeners[eventName] || [];
  var list = [].concat(onceList,onList);

  // Empty the once list
  self._eventEmitter.onceListeners[eventName] = [];

  // Trigger all listeners - call .apply(self,args) on each function in the list
  _.invoke(list,'apply',self,args);

  // Returns true if event had listeners, false otherwise.
  return (list.length > 0);
};


Wait by default in deploy commands

This also makes --wait non-global and it is now only declared for commands
where it is useful (activate, curl, deploy, document, feed, query, status, test,
visit).
@bratseth

Needs some more work.

PTAL. A side-effect of this change is that "wait" cannot be stored in config since it's no longer a global option.


⚠ Samsung has degraded performance

In 1cc338a, Samsung (https://samsung.com) experienced degraded performance:

HTTP code: 200
Response time: 3170 ms

Resolved: Samsung performance has improved in 57b4459.


Environments update

New dialog for adding environments, which replaces the functionality found in previously separate UI (add existing env, add virtual env, add conda env, add custom env)
Info bars for creating environments and installing packages (the latter replaces the new project wizard task dialog)
Options for customizing conda location. There's only 2 MEF exports for conda locator, but a 3rd one will be added if/when we bundle miniconda (will be a separate PR).
Change the Add Conda Env and Add Custom Env items in the environments window into a single Add Environment toolbar button. Also remove the Help item from that list. This fixes accessibility bugs with the environments window.

Edit: If you want to save time reviewing, you can go over ModernStyles.xaml quickly. Most of it is existing code copied from either the windows template or our controls.xaml (didn't want to reuse that one so I could make any necessary modern style specific changes without affecting the old UI).

I'm done with the xaml related stuff, I pushed the changes. I will look at the rest now. Thanks @AlexanderSher  and @zooba !

I'll take a look at the changes tomorrow.

I pushed another set of changes to address the remaining feedback.


Access the window Object

Hello,
I want to use the Tone.js library for one of my projects. But Tone.js do use the Web Audio API. I had the idea of using an invisible WebView as a bridge to manipulate Tone.js. But in order to succeed, I should be able to access the window object of my WebView from my React Native parent component.
Is there any chance to succeed ? Does it exist kind of method like WebView.window to get the window object of the page loaded into my WebView ?
Thank you

So is there a method to access the window object?


feat: add PKCE support

Fix: https://github.com/casdoor/casdoor/issues/431
See RF7636 for more details, and code_challenge_method just only allows "S256".

Signed-off-by: Steve0x2a<EMAIL_ADDRESS>

@sep2 plz review

Wow, that's a super fast PR, Thanks! I'm okay with "S256".


GPVAR estimator: GP-Copula distr_output

Hi,
I was wondering what the correct distr_output argument is to choose for GP-Copula model described in this paper High-Dimensional Multivariate Forecasting with Low-Rank Gaussian Copula Processes. I am not planning to replicate the paper results, but want to better understand the subtleties of the distr_output argument.
On the official gluont-ts repo, the function GPVAREstimator says that it uses a LowrankGPOutput as the default for the distr_output argument. It also says that

Note that this implementation will change over time and we further work on
this method. To replicate the results of the paper, please refer to our
(frozen) implementation here:
https://github.com/mbohlkeschneider/gluon-ts/tree/mv_release

I checked the implemtnation of @mbohlkeschneider and he is using GPLowrankMultivariateGaussianOutputTransformed for the distr_output argument (line 213). Line 78 shows that the latter is a function of the former GPLowrankMultivariateGaussianOutputTransformed(LowrankGPOutput).
Any advice what the difference between GPLowrankMultivariateGaussianOutputTransformed(LowrankGPOutput) and LowrankGPOutput is and which one to use?
Highly appreciate any advice!

Hi @StatMixedML,
Using LowRankGPOutput is fine. The GPLowrankMultivariateGaussianOutputTransformed is just an artifact of an earlier implementation and is actually the same as LowRankGPOutput in our GluonTS implementation. It actually does not do anything in the GluonTS implementation because the used transformation is identity .
That being said, you can still use GPLowrankMultivariateGaussianOutputTransformed if you like to play around with custom transformations of the distribution. The TransformedDistribution allows to transform distribution using the change of variable formula.
Hope that helps. Let me know if you have more questions.
Best,
Michael

Thanks @mbohlkeschneider! Really appreciate your input.
I close the issue.

Hi @mbohlkeschneider!
sorry for re-opening the issue. I do have a question concerning the running time of the GPVAREstimator: it seems excessively long to train a model, see the screenshot below

The Data set has 133 monthly time series, with each 12 years of history, across several hierarchies, resulting in ~ 55,000 observations. I am training the model on a 32GB RAM, 6 CPU i7 Desktop machine. Do you have any experience with running time for the GPVAREstimator? Comparing it to DeepAR, DeepAR is blazingly fast, finishing 200 iterations on the same data set in around 5 minutes.
Appreciate your comments!

Hi @mbohlkeschneider!
sorry for re-opening the issue. I do have a question concerning the running time of the GPVAREstimator: it seems excessively long to train a model, see the screenshot below

The Data set has 133 monthly time series, with each 12 years of history, across several hierarchies, resulting in ~ 55,000 observations. I am training the model on a 32GB RAM, 6 CPU i7 Desktop machine. Do you have any experience with running time for the GPVAREstimator? Comparing it to DeepAR, DeepAR is blazingly fast, finishing 200 iterations on the same data set in around 5 minutes.
Appreciate your comments!

Hi @StatMixedML,
the model is quite a bit slower than DeepAR, for sure (it is also quite a bi more complex)! Using the parameters from our paper (especially rank=10), DeepAR should be around 10x faster than GPVAR. Note that the master implementation of GPVAR is a bit slower than our release fork because of dependency constraints we have with GluonTS at the moment.

Hi @mbohlkeschneider,
I am asking since the 1st iteration of GPVAREstimator took around 5,000 seconds (rank = 32) while it only takes around 5 seconds for DeepAR.
I am also not sure if I correctly pass the data to the estimator. What I do is as follows

train_ds = ListDataset([{FieldName.TARGET: target,
FieldName.START: start,
FieldName.ITEM_ID: item_id,
FieldName.FEAT_DYNAMIC_REAL: feat_dynamic_real,
FieldName.FEAT_STATIC_CAT: feat_static_cat}
for (target, start, item_id, feat_dynamic_real, feat_static_cat) in zip(target_train,
start_train,
item_id_train,
feat_dynamic_real_train,
state_industry_train)],
freq = "1M")

grouper_train = MultivariateGrouper(max_target_dim=target_dim)
train_ds = grouper_train(train_ds)
train_ds.list_data[0]["feat_dynamic_real"] = feat_dynamic_real_train
train_ds.list_data[0]["feat_static_cat"] = state_industry_train

Step 1.) is the same as for DeepAR. Step 2.) is transforming the univariate time series to multivariate using the grouper function. I then also append feat_dynamic_real_train and feat_static_cat as it does not appear in the initial train_ds = grouper_train(train_ds).
Is that the right way of doing it?

Something seems iffy to me. Can you share the exact values of the hyperparamters?

I am asking since the 1st iteration of GPVAREstimator took around 5,000 seconds (rank = 32) while it only takes around 5 seconds for DeepAR.

This is expected actually: MXNet takes a long time to create the large computational graph.
To confirm that this is the culprit, you can run with hybridize=False, then the training should start instantly (but it will be slow). If this is the issue, I have unfortunatly no suggestion but to report to open an issue in MXNet to report the slowness when creating large graph.

Hi @mbohlkeschneider & @geoalgo,
given the above data structure, I use the following setup
`np.random.seed(123)
mx.random.seed(123)
pred_h = 24
rank = 5
trainer = Trainer(epochs = 50,
ctx = mx.context.gpu())
estimator = gpvar.GPVAREstimator(freq = "1M",
prediction_length = 24,
target_dim = 133,
trainer = trainer,
context_length = pred_h*2,
lags_seq = [1, 12],
rank = 5,
distr_output = LowrankGPOutput(dim = 133, rank = 5))
predictor = estimator.train(training_data = train_ds)
`
@geoalgo: if I add hybridize = False to the Trainer(), model estimation indeed starts right away. How do we proceed? Would you open the issue on mxnet as the author of the package?

AFAIK, this issue is known to the mxnet team (I cannot find an exact issue # right now, though).
Feel free to open another one!

Ok thanks, will do. I leave the issue open for now to refer to it when opening it on mxnet.

@StatMixedML can you share you complete implementation, i think i have similar problem to solve and might be helpful to me.
Thank you


Frontend: http proxy error at /auth_setup, local changes are not reflected on hot reload.

Please provide us with the following information:

This issue is for a: (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Follow local development instructions in documentation.

Any log messages given by the failure
Backend

Starting backend

Serving Quart app 'app'
Debug mode: False
Please use an ASGI server (e.g. Hypercorn) directly in production
Running on http://localhost:50505 (CTRL + C to quit)
INFO:azure.identity.aio._credentials.environment:Incomplete environment configuration for EnvironmentCredential. These variables are set: AZURE_TENANT_ID
INFO:azure.identity.aio._credentials.managed_identity:ManagedIdentityCredential will use IMDS

Frontend

<EMAIL_ADDRESS>dev
vite
VITE v4.5.2  ready in 296 ms
➜  Local:   http://localhost:5173/
➜  Network: use --host to expose
➜  press h to show help
14:49:24 [vite] http proxy error at /auth_setup:
Error: connect ECONNREFUSED ::1:50505 at TCPConnectWrap.afterConnect [as oncomplete]

localhost:50505/auth_setup
{
"loginRequest": {
"scopes": [
".default"
]
},
"msalConfig": {
"auth": {
"authority": "https://login.microsoftonline.com/<redacted>",
"clientId": "<redacted>",
"navigateToLoginRequestUrl": false,
"postLogoutRedirectUri": "[/](http://localhost:50505/)",
"redirectUri": "[/redirect](http://localhost:50505/redirect)"
},
"cache": {
"cacheLocation": "localStorage",
"storeAuthStateInCookie": false
}
},
"requireAccessControl": true,
"tokenRequest": {
"scopes": [
"api://<redacted>/access_as_user"
]
},
"useLogin": true
}

Vite config:
server: {
        proxy: {
            "/content/": "http://localhost:50505",
            "/auth_setup": "http://localhost:50505",
            "/.auth/me": "http://localhost:50505",
            "/ask": "http://localhost:50505",
            "/chat": "http://localhost:50505",
            "/config": "http://localhost:50505"
        }
    }

Expected/desired behavior

I want the local changes to be reflected on hot reload, and I am also wondering what the proxy error is about

OS and Version?

Windows 10. Using Powershell 7+

azd version?

azd version 1.6.1 (commit eba2c978b5443fdb002c95add4011d9e63c2e76f)

Versions

Mention any other details that might be useful

Git repo up to date on commit Improvements to load balancer setup script

Thanks! We'll be in touch soon.

Thank you for the quick reply. I waited for the following message:

[2024-03-06 18:44:02 +0100] [24940] [INFO] Running on http://<IP_ADDRESS>:50505 (CTRL + C to quit)
INFO:hypercorn.error:Running on http://<IP_ADDRESS>:50505 (CTRL + C to quit)

Then started the frontend, but sadly the same error occurs.
Inspecting the Chrome Dev Console:

GET http://localhost:5173/auth_setup net::ERR_ABORTED 500 (Internal Server Error)
authConfig.ts:56 Uncaught Error: auth setup response was not ok: 500
at fetchAuthSetup (authConfig.ts:56:15)
at async authConfig.ts:61:19

Do you perhaps have any other suggestions or information I could provide?
Also, could it be cookies/sessions conflicting in some way?
Thanks in advance!

Okay, and you dont see any error logs when you switch back over to the Python logs? And you dont accidentally have two servers running on 50505? (Which shouldnt be possible.. but just trying to figure out whats happening.)

Hi, I just tried again. I am sure only one server instance is running. (nothing to route to when server is off)
There are no Python logs when navigating to localhost:5173 and receiving the 500 in Chrome Dev tools.
See below:
Initial startup logs:

Starting backend

Serving Quart app 'app'
Debug mode: False
Please use an ASGI server (e.g. Hypercorn) directly in production
Running on http://localhost:50505 (CTRL + C to quit)
INFO:azure.identity.aio._credentials.environment:Incomplete environment configuration for EnvironmentCredential. These variables are set: AZURE_TENANT_ID
INFO:azure.identity.aio._credentials.managed_identity:ManagedIdentityCredential will use IMDS
INFO:azure.core.pipeline.policies.http_logging_policy:Request URL: 'http://<IP_ADDRESS>/metadata/identity/oauth2/token?api-version=REDACTED&resource=REDACTED'
Request method: 'GET'
Request headers:
'User-Agent': 'azsdk-python-identity/1.15.0 Python/3.12.2 (Windows-11-10.0.22631-SP0)'
No body was attached to the request
INFO:azure.identity.aio._credentials.chained:DefaultAzureCredential acquired a token from AzureCliCredential
INFO:azure.core.pipeline.policies.http_logging_policy:Request URL: 'https://gptkb-qt36li4qprbtw.search.windows.net/indexes('gptkbindex')?api-version=REDACTED'
Request method: 'GET'
Request headers:
'Accept': 'application/json'
'x-ms-client-request-id': '0c6d87bf-dbef-11ee-abc7-7404f1de83e4'
'User-Agent': 'azsdk-python-search-documents/11.6.0b1 Python/3.12.2 (Windows-11-10.0.22631-SP0)'
'Authorization': 'REDACTED'
No body was attached to the request
INFO:azure.core.pipeline.policies.http_logging_policy:Response status: 200
Response headers:
'Transfer-Encoding': 'chunked'
'Content-Type': 'application/json; odata.metadata=minimal; odata.streaming=true; charset=utf-8'
'Content-Encoding': 'REDACTED'
'Etag': '"0x8DC3DC0DBC736FB"'
'Vary': 'REDACTED'
'Server': 'Microsoft-IIS/10.0'
'Strict-Transport-Security': 'REDACTED'
'Preference-Applied': 'REDACTED'
'OData-Version': 'REDACTED'
'request-id': '0c6d87bf-dbef-11ee-abc7-7404f1de83e4'
'elapsed-time': 'REDACTED'
'Strict-Transport-Security': 'REDACTED'
'Date': 'Wed, 06 Mar 2024 19:23:46 GMT'
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000018D816FBAD0>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x0000018D816FE930>, 463979.859)]']
connector: <aiohttp.connector.TCPConnector object at 0x0000018D816FB200>
[2024-03-06 20:23:47 +0100] [5756] [INFO] Running on http://<IP_ADDRESS>:50505 (CTRL + C to quit)
INFO:hypercorn.error:Running on http://<IP_ADDRESS>:50505 (CTRL + C to quit)

Then after doing a chat request once:
Startup

[2024-03-06 20:23:47 +0100] [5756] [INFO] Running on http://<IP_ADDRESS>:50505 (CTRL + C to quit)
INFO:hypercorn.error:Running on http://<IP_ADDRESS>:50505 (CTRL + C to quit)

First request to localhost:50505

[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /auth_setup 1.1 200 492 0
[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /auth_setup 1.1 - - 0
[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /.auth/refresh 1.1 404 207 0
[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /.auth/refresh 1.1 - - 0
[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /config 1.1 200 84 0
[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /config 1.1 - - 8172

Send chat request

INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
INFO:azure.identity.aio._internal.decorators:AzureCliCredential.get_token succeeded
INFO:azure.core.pipeline.policies.http_logging_policy:Request URL: 'https://gptkb-qt36li4qprbtw.search.windows.net/indexes('gptkbindex')/docs/search.post.search?api-version=REDACTED'
Request method: 'POST'
Request headers:
'Content-Type': 'application/json'
'Content-Length': '34778'
'Accept': 'application/json'
'x-ms-client-request-id': '81712552-dbef-11ee-a3d8-7404f1de83e4'
'User-Agent': 'azsdk-python-search-documents/11.6.0b1 Python/3.12.2 (Windows-11-10.0.22631-SP0)'
'Authorization': 'REDACTED'
A body is sent with the request
INFO:azure.core.pipeline.policies.http_logging_policy:Response status: 200
Response headers:
'Transfer-Encoding': 'chunked'
'Content-Type': 'application/json; odata.metadata=minimal; odata.streaming=true; charset=utf-8'
'Content-Encoding': 'REDACTED'
'Vary': 'REDACTED'
'Server': 'Microsoft-IIS/10.0'
'Strict-Transport-Security': 'REDACTED'
'Preference-Applied': 'REDACTED'
'OData-Version': 'REDACTED'
'request-id': '81712552-dbef-11ee-a3d8-7404f1de83e4'
'elapsed-time': 'REDACTED'
'Strict-Transport-Security': 'REDACTED'
'Date': 'Wed, 06 Mar 2024 19:27:03 GMT'
INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
[2024-03-06 20:27:06 +0100] [5756] [INFO] <IP_ADDRESS>:59708 POST /chat 1.1<PHONE_NUMBER>
[2024-03-06 20:27:06 +0100] [5756] [INFO] <IP_ADDRESS>:59708 POST /chat 1.1 - - 8711932

In the startup logs for the backend I do see the following:
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000018D816FBAD0>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x0000018D816FE930>, 463979.859)]']
connector: <aiohttp.connector.TCPConnector object at 0x0000018D816FB200>

Is that an error that is expected?

No, I saw that as well and wondered if that might be contributing to the issue. Is your code changed at all from what's in main?
Here's what I see:
 * Serving Quart app 'app'
 * Debug mode: False
 * Please use an ASGI server (e.g. Hypercorn) directly in production
 * Running on http://<IP_ADDRESS>:50505 (CTRL + C to quit)
INFO:azure.identity.aio._credentials.environment:Incomplete environment configuration for EnvironmentCredential. These variables are set: AZURE_TENANT_ID
INFO:azure.identity.aio._credentials.managed_identity:ManagedIdentityCredential will use IMDS
[2024-03-06 19:52:18 +0000] [51511] [INFO] Running on http://<IP_ADDRESS>:50505 (CTRL + C to quit)
INFO:hypercorn.error:Running on http://<IP_ADDRESS>:50505 (CTRL + C to quit)

I would have to check what the diffs are between upstream and my fork. I think most edits are related to text translations, data and prepdocs.
However, I just tested that changing the vite.config.ts to <IP_ADDRESS> instead of localhost does in fact render the page.
It also returns some error in the console:

And now I have no problem with vite refusing the /auth_config route

I encountered this issue on SO, talking about node17 and vite favouring ipv4 and ipv6 over localhost.

[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /auth_setup 1.1 200 492 0
[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /auth_setup 1.1 - - 0
[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /.auth/refresh 1.1 404 207 0
[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /.auth/refresh 1.1 - - 0
[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /config 1.1 200 84 0
[2024-03-06 20:26:21 +0100] [5756] [INFO] <IP_ADDRESS>:59674 GET /config 1.1 - - 8172
in i got 404 for .auth/refresh

A 404 for .auth/refresh is fine and expected in local development with auth disabled.

@Arvoid00 So you're using Node 17? I'm still in 16 so that might explain discrepancies.

@pamelafox I am using Node version 18.19.1 (latest stable v18 I think?), so that would indeed differ.
I just tested v16 and both 127.0.01 and localhost in vite config work correctly with the node version 16.20.2.
Also double checked by reverting back to v18 and localhost. This returns the error again. The error is resolved once the config is set to <IP_ADDRESS>. It seems like error is introduced in v17 or v18 by node "reordering the result of DNS-resolved addresses by default" as stated in the vite docs.
In any case, <IP_ADDRESS> works fine on both versions.


Added ability to change button font color

Overview
I added a way to change the font color of the buttons, up to now you were only able to change the other colors in the calendar itself.
Test Plan
I implemented the component in my own code and tried it out.

Hi @mmazzarolo, any idea when this could be merged in? Thanks in advance.

Thank you @LodeKennes ! <3


[VULNERABLE PACKAGE]: wicg-inert package still not completely removed from<EMAIL_ADDRESS>

Description
Follow up to #11919
Even after this fix, the vulnerable wicg-inert package is still being installed with<EMAIL_ADDRESS>as a dependency.
<EMAIL_ADDRESS>has a dependency on "carbon-components-react": "7.59.17" which in turn has a dependency on wicg-inert
This triggers a policy check failure during deployment on IBM CIO Hybrid Cloud Cirrus.
Getting policy evaluations
Found results for mend-scan
Successfully retrieved all evaluations

ITSS Chapter 5 2.3c:
Remediate or otherwise appropriately address before release of the IBM Product or Application all Critical and High severity vulnerabilities identified via security testing and which may affect the IBM Product or Application, including open source vulnerabilities.

We found 1 policy violations from mend-scan for this build.
Please resolve the following policy violations prior to release:

ID: MSC-2024-9045
Score: 9.8
Source: null
Severity: critical
Library: wicg-inert	3.1.2
Description: This package has been identified by Mend as containing potential malicious functionality. The severity of the functionality can change depending on where the library is running (user's machine or backend server). The following risks were identified: Malware dropper – this package contains a Trojan horse, allowing the unauthorized installation of other potentially malicious software.

Component(s) impacted
all
Browser
No response
Carbon for IBM.com version
1.61.0
Severity
Severity 2 = Aspects of design is broken, and impedes users in a significant way, but there is a way to complete their tasks. Affects major functionality, has a workaround.
Application/website
IBM Redbooks
Package
@carbon/ibmdotcom-web-components, @carbon/web-components, @carbon/ibmdotcom-styles, @carbon/ibmdotcom-services, @carbon/ibmdotcom-utilities
CodeSandbox example
none
Steps to reproduce the issue (if applicable)
No response
Release date (if applicable)
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct
[X] I checked the current issues for duplicate issues

We're getting the same Critical severity warning in our code base

@annawen1 - thanks for these updates.
I'm a little confused - which version of @carbon/ibmdotcom-web-components can we use, so we don't have the wicg-inert subdependency?

@annawen1 - disregard, I think I'm confusing the packages and sub-deps


min_only=true djisktra infinite loop with duplicate indices

My issue is about scipy.sparse.csgraph.djisktra with the min_only=True option.
Seems that if you pass duplicate indices into this function you can induce an infinite loop.
Solution would maybe be to raise an exception in this case?
Or is there a way to a handle it? Take the first unique index as the true target and throw out the others so that no paths lead to them?
Reproducing code example:

Sample code to reproduce the problem

Error message:
code never returns..
Scipy/Numpy/Python version information:
1.1.0 1.14.3 sys.version_info(major=3, minor=6, micro=6, releaselevel='final', serial=0)

@fcollman thanks for the report. Can you add a self-contained code example to reproduce the issue you're seeing?

sure working on it now... I think this is likely a bug with code i submitted so was going to follow it up with a PR that at least has a test with a failure, but hopefully a fix too.

@fcollman that would be great, thanks for looking into it