Add overload to Saml2SecurityTokenHandler to consume a token from an XmlReader

When working with the SAML2P protocol, the token (assertion in Saml2 terms) is embedded inside a larger piece of XML, the SamlResponse - or inside an artifact resolution response message. Code supporting Saml2P will typically already have an open XmlReader to the data. Add overloads to be able to hand in an XmlReader instead of a string to the token validation API.
This was discussed in #759, but is really an own separate task that is for SAML2P support rather than metadata support. So it should have it's own issue.

Have started looking at this and found out that the SaveSigninToken flag is a challenge, as it expects the entire token to be present in string format.
I first considered just not supporting SaveSigninToken when using an Xml Reader, but I do see some use cases ahead where I will need that, so this must be solved.
My first idea was to just fall back to extract the OuterXml of the Assertion node in a Saml Response message and store it. However, that might not work if the namespace declarations are placed on the enclosing Response node. This is a well-known problem with signatures over part of XML Documents and that is why a canonicalization transform is always used.
I'm considering trying to get the output of the canonicalization transform (based on the recorded TokenStream) and write that out to a string representation that can be saved. It should keep the semantics of the assertion and make it possible to validate the standalone string representation.
Any thoughts @brentschmaltz @GeoK?

@AndersAbel I have had issues with OuterXml and xml that contains '/r/n'. I have found that normalization will replace to '/n' and then signatures start failing. See https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/1029
I believe you will need the canonicalized string representation of the SAML token.

Will also add to SamlSecurityTokenHandler

@AndersAbel I think we can get the canonical stream as we have collected all the nodes.

Added with:
https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/pull/1181


chore: add flow alias to jsx flavor

fixes: https://github.com/getgrit/gritql/issues/215

Summary by CodeRabbit

New Features

Added support for the "flow" flavor in pattern language settings.

how will this work?
If you now specify jsx in the Studio, then parsing still does not occur
https://app.grit.io/studio?key=MTd7mR3taj5k6i2sDL1mZ

JSX works fine in the studio: https://app.grit.io/studio?key=MTd7mR3taj5k6i2sDL1mZ

@morgante
another case
https://app.grit.io/studio?key=MTd7mR3taj5k6i2sDL1mZ


FOO TOUCH

Signed-off-by: Fabian Deutsch<EMAIL_ADDRESS>

Was supposed to be a PR in my private repo.


Pins greater than 32 use PIO functions

Hello, I am testing the hello_pio program. And I am using the RP2350B development board. I want to use pin 45 to output high and low levels alternately.
I tried adding
pio_set_gpio_base(pio,16);

and changing the pin to 45
#define HELLO_PIO_LED_PIN 45

and found that the pin did not respond.
Then I tried to change the pin to a relative value
#define HELLO_PIO_LED_PIN (45-16)

Still no response, why is this?

Duplicate https://github.com/raspberrypi/pico-sdk/issues/2030

Hi, I have previously looked at #2030 and modified the source code, but I still can't get GPIO45 to work properly.

Duplicate #2030

Hi, I have previously looked at https://github.com/raspberrypi/pico-sdk/issues/2030 and modified the source code, but I still can't get GPIO45 to work properly.

Sorry, misread your post. I'll check if we're missing something else.

@Octopus1633  I've tested this and it works fine. You do NOT need to take 16 off the pin when running the hello_pio program. You don't even have to call pio_set_gpio_base as the call to pio_claim_free_sm_and_add_program_for_gpio_range does that for you.
The following pio function are called in this program and they all correctly handle pins >= 32
sm_config_set_out_pins
pio_gpio_init
pio_sm_set_consecutive_pindirs
Just make sure you are testing on a board that does NOT set PICO_RP2350A 1

@Octopus1633 I've tested this and it works fine. You do NOT need to take 16 off the pin when running the hello_pio program. You don't even have to call pio_set_gpio_base as the call to pio_claim_free_sm_and_add_program_for_gpio_range does that for you.

Thank you for your reply. You mean to use the hello_pio program, only need to specify HELLO_PIO_LED_PIN pin to work properly? But after I modified it, I still can't make the pin greater than 32 work properly, and this is the case for both RP2350B. I updated the latest SDK and sample program.

Yes, this program seems to work for me if I use pin 45. What board are you using? Can you double check that HELLO_PIO_LED_PIN is set correctly and PICO_PIO_USE_GPIO_BASE is true? I will add the following to the test.
#if HELLO_PIO_LED_PIN >= 32 && !PICO_PIO_USE_GPIO_BASE
#error Attempting to use a pin>32 on a platform that doesn't support it
#endif

The PICO_PIO_USE_GPIO_BASE output was always 0, but when I specified 1, everything worked fine!

If PICO_PIO_USE_GPIO_BASE==0, then PICO_RP2350A is probably set in your board header which is bad if you have a RP2350B... I would fix the latter, since it may affect other things that use GPIO > 32 (we omit extra code for the higher pins when we know they aren't there)

It's not very obvious I guess. I'll add some checks to the examples which will hopefully clarify things.


Typos

I love you internet friend

Thanks, internet friend! Apparently the handwriting-to-text conversion on my tablet isn't amazing :)


Added "epoch" as unit of tqdm, instead of "it".

I believe batch is the correct one, if you'd like to I can edit it myself.


feat: add versions config

Checklist

[ ] Fix linting errors
[ ] Tests have been added / updated (or snapshots)

Change information

Codecov Report

Merging #57 (e7af3fd) into dev (01650e1) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##              dev      #57   +/-   ##
=======================================
  Coverage   94.24%   94.24%
=======================================
  Files         199      199
  Lines        4573     4573
  Branches     1077     1083    +6
=======================================
  Hits         4310     4310
  Misses        253      253
  Partials       10       10

Continue to review full report at Codecov.

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


Allow user to set number of threads to download with

In the following line, the number of threads to download an artifact is hard coded to 64. https://github.com/wandb/wandb/blob/57de662def68fdf7f4e0fd924145def861a11991/wandb/sdk/artifacts/artifact.py#L1795
Can an environment variable be created to allow the user to set that up?

Hello @msis ,
Let us check this internally and will get back to you.

Please close this once the documentation is updated.

Sure @msis , will put this on hold until the next SDK Release.


Create Database with Required Specifications

We need to establish a database system to store crucial data for our application, specifically focusing on user information, Personally Identifiable Information (PII) detection results, and related metadata. Designing the database with proper specifications is essential for efficient data storage and retrieval.
Specifications:
Database Name: pii_detection_db
Table: Users
Columns:
user_id (Primary Key, Integer) - Unique identifier for each user.
username (String) - User's unique username.
email (String) - User's email address.
password (String) - Encrypted user password for security.
registration_date (Timestamp) - Date and time of user registration.
Table: PIIDetections
Columns:
detection_id (Primary Key, Integer) - Unique identifier for each detection.
user_id (Foreign Key referencing Users.user_id) - Identifier linking the detection to the user.
document_name (String) - Name of the uploaded document or image.
detection_results (Text/JSON) - JSON or text representation of PII detection results.
detection_timestamp (Timestamp) - Date and time of the PII detection process.

Hi , I want to work on this issue .Can you please assign it to me?

Hi , I want to work on this issue .Can you please assign it to me?

Sure, assigned!


2.0.0-alpha.9 tauri.conf.json the allowlist property is compiling with an error

Describe the bug
2.0.0-alpha.9 tauri.conf.json the allowlist property is compiling with an error
Reproduction
No response
Expected behavior
No response
Platform and versions
[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 113.0.1774.57
    ✔ MSVC:
        - Visual Studio 15 ���ɹ��� 2017
        - Visual Studio ���ɹ��� 2019
    ✔ rustc: 1.69.0 (84c898d65 2023-04-16)
    ✔ Cargo: 1.69.0 (6e9a83356 2023-04-12)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - node: 16.14.0
    - pnpm: 8.5.1
    - npm: 8.3.1

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.9
    - tauri-build [RUST]: 2.0.0-alpha.5
    - wry [RUST]: 0.28.3
    - tao [RUST]: 0.19.1
    - @tauri-apps/api [NPM]: 2.0.0-alpha.4
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.9

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../ui
    - devPath: http://localhost:4173/
    - bundler: Vite

Stack trace
Error tauri.conf.json error on tauri: Additional properties are not allowed ('allowlist' was unexpected
Additional context
tauri.conf.json
 "tauri": {
    "allowlist": {
      "all": true
    },
    "bundle": {
      "active": true,

The configs changed in the latest alpha release because we're moving everything to plugins. To be honest i'd suggest to not update just yet and wait for us to catch up with the docs. If you can't wait for it, remove the configs the error complains about and install the plugins you'll need from https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins.

How do you set tauri2.0.0-alpha back to 1.0?

@trookie2000
cargo uninstall tauri-cli
cargo install tauri-cli

Around Alpha.20, I ran into a problem tinkering with an upgrade. I did the cargo "reinstall" of tauri-cli, but that led to a conflict with allow list until I ran the following. May need to reinstall the API. :)
@tauri-apps/cli@latest @tauri-apps/api@latest
Looking forward to Beta.

I noticed that if out initialize your tauri app using cargo it generates a different type off config as compared to using any js  package managers.

"permissions": ["core:default", "shell:allow-open", "http:default"]
http:default is not allowed.
{
"permissions": [
{
"identifier": "http:default",
"allow": [{ "url": "https://*.tauri.app" }],
"deny": [{ "url": "https://private.tauri.app" }]
}
]
}
is not allowed?


Fix CheckAccess group expansion bug

Which issue this PR addresses:
Fixes: https://issues.redhat.com/browse/ARO-10904
What this PR does / why we need it:

This PR consumes checkaccess-v2-go-sdk to use the CheckAccess V2 API to authorize data plane request and removes the local code that was used to call CheckAccess v2 API.
This also fixes the group expansion bug described in the JIRA link above by passing the right ClaimName that suffice the following conditions.

1. groups claim presented, _claim_names not presented. Pass groups claim to checkAccess API in payload.
2. groups not presented, _claim_names presented. Pass _claim_names to checkAccess.
3. groups not presented, _claim_names not presented. Identity is not in any group, no need to pass anything.
4. groups and _claim_names both presented. Not a valid scenario.

Test plan for issue:

New Unit tests and existing E2E.

Is there any documentation that needs to be updated for this PR?
No
How do you know this will function as expected in production?

All Unit tests and existing E2E must pass.

/azp run

/azp run

/azp run

/azp run

/azp run

Agree with Ben's comments, but these can be followed on in smaller PRs.


Implement patreon fetch with pagination and unique users

Right now we have a basic Patreon fech method, with no pagination. We need to fix that.

Not needed as patreon api fetches all subscriptions and I don't expect more than 100 anyways.


lookupProfile throwing error with .btc usernames

Describe the bug
Calling lookupProfile is throwing the following error when trying to access .btc usernames.
[ERROR] resolveZoneFileToProfile: error fetching token file https://gaia.blockstack.org/hub/1KvMJEjCMjwLxK4VHJn3wyYCcEuzB8qjZH/profile.json: Error: Token issuer public key does not match the verifying value

What version of Blockstack.js are you using?

@stacks/auth - v2.0.1

Is the bug present in the Blockstack CLI, Gaia hub, Connect or Blockstack Browser?
@stacks/auth
To Reproduce
import { lookupProfile } from '@stacks/auth';

await lookupProfile({ username: 'leopradel.btc' });

Expected behavior
The profile should be returned, it's working fine for *.id.blockstack and *.id.stx usernames.
Additional context
I already faced the same error for *.id.stx usernames before in https://github.com/blockstack/stacks.js/issues/1016 and submitted a pull request to fix it.
For this one, I tried to debug but didn't manage to make it work.

When we call lookupProfile, internally the verifyProfileToken function is called
https://github.com/blockstack/stacks.js/blob/1af7a18b1017981f5b44c1006d940eb4648d0491/packages/profile/src/profileTokens.ts#L105-L114
publicKeyOrAddress is the STX address returned by the API
curl https://stacks-node-api.mainnet.stacks.co/v1/names/leopradel.btc

Response:
{
  "address": "SP3VCX5NFQ8VCHFS9M6N40ZJNVTRT4HZ62WFH5C4Q",
  "blockchain": "stacks",
  "expire_block": 0,
  "last_txid": "0x60e3e5faf0d8f79054b3acf7545939f099fe466a4e78a4d23bea70bc25b1e2a3",
  "status": "name-register",
  "zonefile": "$ORIGIN leopradel.btc.\n$TTL 3600\n_http._tcp\tIN\tURI\t10\t1\t\"https://gaia.blockstack.org/hub/1KvMJEjCMjwLxK4VHJn3wyYCcEuzB8qjZH/profile.json\"\n\n",
  "zonefile_hash": "7dff651a82090bbbc37260917ae9621e5c75bda5"
}

and we compare it with the address that we got from the public key which is:
https://github.com/blockstack/stacks.js/blob/1af7a18b1017981f5b44c1006d940eb4648d0491/packages/profile/src/profileTokens.ts#L106
So the addresses:
publicKeyOrAddress: SP3VCX5NFQ8VCHFS9M6N40ZJNVTRT4HZ62WFH5C4Q
address: SP37RJG6SG88F2R1GMCSA2G1XMPWM9JFEAYJ2V20G
are not equal that's why verifyProfileToken throws Token issuer public key does not match the verifying value at
https://github.com/blockstack/stacks.js/blob/1af7a18b1017981f5b44c1006d940eb4648d0491/packages/profile/src/profileTokens.ts#L113
cc: @zone117x @reedrosenbluth
Because the addresses do not match what are your thoughts in terms of if its a stacks.js issue or server side issue. Any ideas in terms of why the same addresses are not returned by server side.

I'm not seeing any tx related to SP37RJG6SG88F2R1GMCSA2G1XMPWM9JFEAYJ2V20G. Maybe a bug with whatever is registering .btc names? I'm not familiar with that code.

@MarvinJanssen any ideas?

I would think that the issue is more on the extension that creates the token and this issue is somehow related to derivation paths and this https://github.com/blockstack/stacks-wallet-web/issues/1412
The b58 address 1KvMJEjCMjwLxK4VHJn3wyYCcEuzB8qjZH of the profile url is SP37RJG6SG88F2R1GMCSA2G1XMPWM9JFEAYJ2V20G, however the owner of the profile is SP3VCX5NFQ8VCHFS9M6N40ZJNVTRT4HZ62WFH5C4Q

The problem is that the profile token is signed with the dataPrivateKey of the account, while the stxPrivateKey is used to create the stx address that is sent to the client. Therefore, the client won't be able to verify the profile token.

In order to provide an incremental migration path and allow Sigle to use the Hiro wallet extension:

https://github.com/blockstack/stacks.js/pull/1117 this pr needs to be updated, and the fix of @friedger should be applied only if no names are attached to the dataPrivateKey. The result would mean that .btc domains are working and old .id.stx names keep working.
Second step, if a name is attached to the dataPrivateKey, the user should be prompted to migrate the name to the new stxPrivateKey that Hiro wallet is using. As this requires an on-chain transaction, the best would be to have it sponsored so users don't pay the tx fees.

@markmhx @kyranjamie

@pradel Thanks for the action items summary 🙏
To be clear here, for Sigle to migrate to the Hiro Wallet extension, only your step #1 needs to be implemented as part of this PR? And step #2 can be tackled subsequently in a separate PR, as it's not strictly needed for Sigle migration. Correct?


A suspicious use of incrementer in for loop

Hi
I've found a suspicious use of incrementer in for loop in recent snapshot.
(Path: java/sage/PseudoMenu.java)
In Line 360, listenKids[i] should be listenKids[j]? I have no idea if listenKids.length is always 3 as i is < 3.
 335     for (int i = 0; i < 3; i++)
 336     {
 337       Widget ueListenWidg = null;
 338       if (i == 0)
 339         ueListenWidg = getUEListenWidget(evt.getType());
 340       else if (i == 1 && evt.getSecondaryType() != 0)
 341         ueListenWidg = getUEListenWidget(evt.getSecondaryType());
 342       else if (i == 2 && evt.getTernaryType() != 0)
 343         ueListenWidg = getUEListenWidget(evt.getTernaryType());
 344
 345       if (ueListenWidg != null)
 346       {
 347         // 11/11/03 - I used to not create a child context here, but I added it when I did the
 348         // passive listen stuff
 349         Widget[] listenKids = ueListenWidg.contents();
 350         Catbert.Context childContext = comp.relatedContext.createChild();
 351         childContext.setLocal(Catbert.PASSIVE_LISTEN_VAR, null);
 352         if (evt.getPayloads() != null)
 353           childContext.setLocal(ZPseudoComp.PAYLOAD_VAR, evt.getPayloads());
 354         for (int j = 0; j < listenKids.length; j++)
 355         {
 356           if (listenKids[j].isProcessChainType())
 357           {
 358             if ((ep = ZPseudoComp.processChain(listenKids[j], childContext, null, comp, false)) != null)
 359             {
 360               ep.addToStack(listenKids[i]);
 361               ep.addToStackFinal(ueListenWidg);
 362               return;
 363             }
 364           }
 365         }

Isn't that interesting. I wonder why that's being done or if it's the source of a bug.

Wow...how did you happen to notice that? :)  I'm 95% sure you are right in that it should be 'j' instead of 'i'. Do you want to go ahead and do the change since you found it? Otherwise I'm happy to fix it. And the vast majority of the time this gets executed; 'i' will be zero and listenKids.length == 1...which is why this hasn't shown up as a problem before....or ZPseudoComp.processChain returns null (which will also happen nearly all of the time unless it hits an asynchronously processed API call)

Hmmm...let me try to exploit this bug because I'm curious now. :)

There you go, poking the beehive.

After trying to replicate it...I realized just how rare this is. This needs to come from a Listener that's defined in the Global Theme widget.
So if for example, under the Global Theme widget you had a Delete listener which then had the following underneath it:
-DebugLog("A")
-ChannelUp()
--DebugLog("B")
If video was playing and then you hit Delete, it would print out A, do ChannelUp, then print out B, then do a ChannelUp again and then print out B again. Such as (notice the different thread IDs on each printout):
Tue 1/31 16:29:04.591 [EventRouter-64510658ea39@bb1b993] TESTA
Tue 1/31 16:29:04.786 [AsyncChannelUp@59d6983d] TESTB
Tue 1/31 16:29:05.205 [AsyncChannelUp@60a38575] TESTB
Still, it is a bug so it should be fixed. :)


Update to 1.18

Just changes version it's built against from 1.18-rc1 to 1.18

Why close the PR and author your own commit as opposed to just merging?
Just wondering.

It's not much more work.
I'm not really keen on "one-liners".


CAS 948 -- NPE during SPNEGO Authentication

Fixes #948.  Modify hashCode function of SpnegoCredential in order to avoid NPE when principal has not yet been resolved.

:+1: Excellent.
May I just ask that you add a tiny bit of unit test so we wouldn't break this sort of thing in the future? Tests could compare hashcodes of 2 objects, one with and one without a principal. You could also attempt to load the credential into a hashmap for those objects and see if NPE can be caused, etc.
Otherwise, I think it's perfect.


feat: Added privacy statement

Pull Request checklist
Please review the below PR requirements:

Build was run locally and any changes were pushed
Ensure that the title clearly describes the changes
Issue to be referenced in the PR description rather than in the commits or PR title
Clean commit history

@benalleng I changed my approach entirely so I've marked the other comments as resolved.

@adamjonas do you have any comment on the copy?


szip fails to build if VS2019 is installed

Package: szip:x64-windows
Vcpkg version: 2018.11.23-nohash
Building in an "x64 Native Tools Command Prompt for VS2017".  I have VS2015, VS2017 and VS2019 installed.
Similar to https://github.com/Microsoft/vcpkg/issues/5947 which was marked fixed.
D:\vcpkg-vs2017>.\vcpkg install hdf5:x64-windows
The following packages will be built and installed:
    hdf5[core]:x64-windows
  * szip[core]:x64-windows
Additional packages (*) will be modified to complete this operation.
Starting package 1/2: szip:x64-windows
Building package szip[core]:x64-windows...
-- Using cached D:/vcpkg-vs2017/downloads/szip-2.1.1.tar.gz
-- Extracting source D:/vcpkg-vs2017/downloads/szip-2.1.1.tar.gz
-- Applying patch fix-szip-config-to-set-szip-found.patch
-- Using source at D:/vcpkg-vs2017/buildtrees/szip/src/szip-2.1.1-6b767acfa7
CMake Error at scripts/cmake/vcpkg_configure_cmake.cmake:116 (message):
  Unable to determine appropriate CMake MSBuild generator for:
  Windows-x64-v142.

  This is because CMake 3.12.4 does not currently have a 'Visual Studio 16
  2019' option.

  This can be worked around by either:

    1. Install Visual Studio 2017 Stable

Call Stack (most recent call first):
  ports/szip/portfile.cmake:18 (vcpkg_configure_cmake)
  scripts/ports.cmake:71 (include)

Error: Building package szip:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: szip:x64-windows
  Vcpkg version: 2018.11.23-nohash

Additionally, attach any relevant sections from the log files above.

Logfiles are all empty other than:
Checking patch config/cmake/szip-config.cmake.in...
Applied patch config/cmake/szip-config.cmake.in cleanly.

I do find it surprising that VS2019 is being used to build, and not VS2017 as expected.

https://translate.google.com
  This is because CMake 3.12.4 does not currently have a 'Visual Studio 16
  2019' option.

  This can be worked around by either:

    1. Install Visual Studio 2017 Stable

Install Visual Studio 2017 Stable or Install CMake 3.14 +

Yes, I understand the error.  The issue is the appropriateness of what vcpkg is trying to do.

Visual Studio 2017 is already installed as I stated
I would not expect vcpkg to be trying to build with VS2019 when I'm running vcpkg from a VS2017 command prompt

vcpkg env --debug

From an "x64 Native Tools Command Prompt for VS2017" shell:
D:\vcpkg-vs2017>.\vcpkg env --debug
[DEBUG] Using vcpkg-root: D:\vcpkg-vs2017
[DEBUG] Found path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe
[DEBUG] _wpopen(""C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --version 2>&1")
[DEBUG] _pclose() returned 0 after    76039 us
[DEBUG] _wpopen(""C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" "-DCMAKE_TRIPLET_FILE=D:/vcpkg-vs2017/triplets/x86-windows.cmake" -P "D:/vcpkg-vs2017/scripts/get_triplet_environment.cmake" 2>&1")
[DEBUG] _pclose() returned 0 after    72557 us
[DEBUG] _wpopen(""C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -prerelease -legacy -products * -format xml 2>&1")
[DEBUG] _pclose() returned 0 after    81514 us
[DEBUG] CreateProcessW(cmd.exe /c ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" -vcvars_ver=14.2 amd64_x86   2>&1 <NUL && cmd")
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.0.0
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64_x86'
Microsoft Windows [Version 10.0.17763.404]
(c) 2018 Microsoft Corporation. All rights reserved.

So it picks up VS2019 with vswhere, but it's ignoring the actual environment from which I'm running vcpkg.  Not at all what I'd expect.

and what is written in the documentation?
What is written in your triplet?
you can set the paths to MSVC in TRIPLET

let me look for you
https://github.com/Microsoft/vcpkg/blob/master/docs
https://github.com/Microsoft/vcpkg/blob/master/docs/users/triplets.md
VCPKG_VISUAL_STUDIO_PATH
set(VCPKG_VISUAL_STUDIO_PATH "C:\\Program Files (x86)\\Microsoft Visual Studio\\Preview\\Community")

vcpkg env --debug --triplet x64-windows

Any updates on this open issue?

Looks like this is completely controlled by target triplets, so I'll close this.

This issue is from last year!
@rleigh-codelibre Were you able to fix it? If so, please post the resolution here!

@sfhacker See the files created in https://github.com/microsoft/vcpkg/pull/14613 and the linked documentation and discussion.  I hope this helps!


Using with xpos causes NaNs after rotating Q, K

I discovered that after rotary_emb.rotate_queries_and_keys(Q, K), K now contains a very small fraction of NaNs, which then propagate through the rest of the transformer and result in a NaN loss. What could be causing this / how to address? Happy to provide code if it helps.

@andersonbcdefg ugh! i'm so embarrassed. thank you! https://github.com/lucidrains/rotary-embedding-torch/commit/2605ece8a6a08f5a1eceb8f56cf78ccd7670e1b5

No, thank you for fixing so quickly and making this library available period! Normal people wouldn't be able to use xpos rotary embeddings properly if not for all your work :)


[Services] - After deleting an instance in service and then trying to scaledown the instance by 1 , results in instance being created and destroyed.

Server Version - V0.16.3
Steps to reproduce the problem:
Create an environment -env1
Add service (s1) with scale set to 5.
Delete one of the instances (say the 4th one).
Now edit the service and set the scale to 4.
There needs to be no addition/deletion of the services done.
But we see an instance being created ( env1_s1_4) and existing instance (env1_s1_5) being removed.

Today we always try to ensure that the instances name reflect the scale. If scale is 4, then we expect names _1, _2, _3, _4 to be set on the services names. This behavior will most likely change once I relax the restriction on the services' names (once we let user modify service/environment/individual instances' names)

Tested with server version - V.0.18.1
Create an environment -env1
Add service (s1) with scale set to 5.
Delete one of the instances (say the 4th one).
Now edit the service and set the scale to 4.
I see that the deleted instance is no longer associated with the service and the instances that are in the service are "_1","_2","_3" and "_5".
Works as expected.


Azure Blob Cache - Feedback/Notes

Hi! Firstly massive thumbs up, this is great! I wanted to share some of my experiences, as we've got a website using this, that has LOTS of images, most of which are large assets (2000px+, high quality jpg).
Things I have noticed:
1. Occasional 404's when loading multiple images on the page
The more images we place on the page the higher the percentage of images that can't be served.
When StreamCachedImage is false, we see a combination of 404 & 500 errors.
Error 2 (500)
 An unhandled exception occurred
 System.Net.WebException: The operation has timed out
    at System.Net.HttpWebRequest.GetResponse()
    at ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache.<>c__DisplayClass14_0.     <RewritePath>b__2()
    at ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache.TryFiveTimes(Action delegateAction, Action exceptionAction)
    at ImageProcessor.Web.Plugins.AzureBlobCache.AzureBlobCache.RewritePath(HttpContext context)
    at ImageProcessor.Web.HttpModules.ImageProcessingModule.
 <ProcessImageAsync>d__32.MoveNext()

Error 1 (404)
 ImageProcessor.Common.Exceptions.ImageProcessingException: RewritePath 495 : Unable to rewrite      cached path to:      http://dmb.azureedge.net/cache/6/b/0/d/6/d/6b0d6dc97d8ce33c46ec4c39988d8a6be3a631bf.png

When StreamCachedImage is true, this issue disappears.
The site is running on a Medium Azure instance and my little Surface, so there should be enough grunt to deal with the requests! ;-)
2. How long are the assets cached for? Looking at request performance, it seems the Images are dropped out of cache within the hour.
Cheers! Laurie

The best solution I've found (also using in production with large images) is to set StreamCachedImage to true and then place a CDN in front of ImageProcessor (rather than behind).
So the logic looks like this...

User requests image directly from CDN.
If image does not exist, CDN requests one from ImageProcessor.
CDN caches the image.

This largely ignores ImageProcessor's own cache when it comes to actually serving images but has a significant performance boost as we're not sending back lots of redirects (new HTTP connections that the client has to make).

Hi @uniquelau so sorry for not getting back to you on this sooner! I meant to do so after releasing the last update. I'll try to answer your questions.

I fixed the issue that you were seeing where images were not getting redirected. One of the CDN options on Azure (I forget which) can be pretty slow when first setting up images so timeouts occur which used to not be handled properly. I now correctly check and fallback to blob storage after 1000ms configurable so you are always served an image no matter what. v1.1.3 onwards.
I set the headers to cache to the same defaults as the desk cache. 365 days on the server, 7 days in the browser. If you have any further detail you can share that would be great.

@JasonElkin Thanks for pitching in. 😄 That approach should work well.
I'd love to see a diagram if you could to show exactly how you've set that up on Azure if you could for others to see? I've personally never had the opportunity to set it up like that myself so I'm also very curious.
This conversation seems like a good place to instigate a new one on how we could improve the cache. I originally wrote the initial solution in a couple of hours so it would be great to revisit the design.
So...

What do you see as the main shortcoming of the current cache design?
How can we better design the caching and serving process?

Personally I would love to be able to remove the redirects. They only exist because the url is determined not only by the image request url but by the file size and last write time of the image itself. (This allows versioning which is important.) If we can figure out something smarter there's massive performance boosts to be had.
Looking forward to your input.
James

Thanks @JimBobSquarePants, here's a few thoughts - diagram to follow.

What do you see as the main shortcoming of the current cache design?

I have a suspicion that streaming cached images from the CDN is actually slower than accessing blob storage directly - I'm due to do some performance testing on a deployment this week so I'll have the chance to do some real-world testing and will feed back what I find.
Methods like IsNewOrUpdatedAsync() are fast and trivial tasks for a local filesystem, but blob storage is basically just a NAS and has network overheads. The only solution I can see to get around this is to implement some kind of index to keep track of the cached images without having to make extra requests.
All that having been said, the main issue, as I see it, is that blob storage is always a REST request away.  Any type of cache that's backed by blob storage will either create extraneous redirects, or it act as a proxy - neither of which are particularly efficient options.

How can we better design the caching and serving process?

Where we're using ImageProcessor in-app (as opposed to as a standalone/remote server) we could use a method at render time to query the cache (perhaps still with the help of an index) and write the correct URL directly in-app/page.
That way we can leverage blob storage and/or a CDN for serving the cached files directly.

Hi @JasonElkin ,
Internally the Azure Blob Cache uses a memory cache to reduce some of the overheads but yeah, checking whether the item has been updated or is new is a hassle. An indexer would be an idea but as soon as you start scaling instances then that index could get out of sync.
As for the second suggestion... I have been working on an approach that does the following.

On render call a method that gets the image URL.
In that method make a head request to the URL and cache the redirected response. Any redirects will give us the CDN url
Return the cached response URL and render that on the page.

That shouldn't slow down page render too much on first hit as long as appropriate timeouts and handling are set on the request.

I've done a lot of updates recently to the cache to improve performance. Please give the latest version a go and let me know what you thing.

Any progress or a branch with the url work?

Cached file names are now predictable. There's a static method in ImageProcessor.Web CachedImageHelper.GetCachedImageFileName that you can now call to get the cached file name as a hash.
The rest you would have to do yourself since I don't produce framework specific consumer code. I do have the guts of a method in another library of mine that is doing what I described. It uses code specific to the CMS I'm integrating with though. https://github.com/JimBobSquarePants/Zoombraco/blob/bb5a1f2c7ce8566951249bda86e7a4d4afa80cc3/src/Zoombraco/Models/MediaTypes/ImageExtensions.cs#L91
I do, however need to release an update that handles an odd bug in Azure where requesting the CDN result via a head request can return a 500 code yet also the correct response object. The code is written, just not released.

There's been so many updates to both .Web and the Azure cache since this was opened I can't count them. Basically performance is waaaaaay better and I can handle Azure weirdness better so I'm gonna close this now.


Model update

Unify trainable models

Codecov Report

Merging #95 (a292604) into master (c96d8ab) will decrease coverage by 46.04%.
The diff coverage is 27.10%.

@@             Coverage Diff             @@
##           master      #95       +/-   ##
===========================================
- Coverage   76.29%   30.25%   -46.05%
===========================================
  Files          35       34        -1
  Lines        3405     3530      +125
  Branches      725      730        +5
===========================================
- Hits         2598     1068     -1530
- Misses        614     2385     +1771
+ Partials      193       77      -116

Impacted Files
Coverage Δ

...imulate/canonical_computations/linear_nonlinear.py
17.39% <12.50%> (-82.61%)
:arrow_down:

plenoptic/simulate/models/frontend.py
41.50% <30.64%> (-58.50%)
:arrow_down:

...noptic/simulate/canonical_computations/__init__.py
100.00% <100.00%> (ø)

plenoptic/simulate/models/__init__.py
100.00% <100.00%> (ø)

plenoptic/synthesize/mad_competition.py
10.71% <0.00%> (-75.48%)
:arrow_down:

plenoptic/synthesize/eigendistortion.py
17.68% <0.00%> (-71.43%)
:arrow_down:

plenoptic/tools/display.py
8.71% <0.00%> (-70.54%)
:arrow_down:

plenoptic/synthesize/synthesis.py
8.69% <0.00%> (-67.56%)
:arrow_down:

plenoptic/synthesize/autodiff.py
20.00% <0.00%> (-66.67%)
:arrow_down:

plenoptic/synthesize/metamer.py
24.52% <0.00%> (-60.38%)
:arrow_down:

... and 10 more

Continue to review full report at Codecov.

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


Getstarted rocket button is not togglable

Similar to other header buttons (webchat, notifications) I think the rocket button should be togglable as well.
basically, on click, if open close it and vice versa.

@hatpick this is being tracked in this issue #6993


scorecard,generate-csv: consider api "group" while checking for known types

Description of the change:
Comparing only "kind" of the resource might lead to conflict where two resources might have same kind but in different api groups.
For example an operator could provide a custom resource with name "Deployment" in it's own group. On generating csv for this operator might not consider the provided CR for filling 'alm-examples'
Motivation for the change:
Observed this issue while integrating PMEM-CSI operator which provides Deployment CRD in pmem-csi.intel.com API group.
Checklist
If the pull request includes user-facing changes, extra documentation is required:

[ ] Add a new changelog fragment in changelog/fragments (see changelog/fragments/00-template.yaml)
[ ] Add or update relevant sections of the docs website in website/content/en/docs

LGTM

This PR is a good first step towards a (potential) larger refactor needed to support #3494.


Personal library app

Hi,
I am participant of GSSOC'21. I would like to contribute a simple personal library website using js.
Kindly assign this to me.

@ireneelizabethsabu Sure go for it :)

Any update ?
Reply within 2 days or else i have to close this issue.

I apologize for the delay caused due to end sem exams.I am working on it and  will make the PR within 2 days.

@ireneelizabethsabu update ?

I have sent the PR already.Please look into it.


Discord Webhook Error

It sends this after npm start
SyntaxError: Unexpected token h in JSON at position 445
at JSON.parse ()
at file:///K:/StockAlertBot/src/main.js:67:10
at ModuleJob.run (node:internal/modules/esm/module_job:175:25)
at async Loader.import (node:internal/modules/esm/loader:178:24)
at async Object.loadESM (node:internal/process/esm_loader:68:5)
I removed the URL from config.json and everything worked. Is there a correct format for the URL. This was the one I inputted : https://discord.com/api/webhooks/X/Y. X/Y are subbed.

Hi. Yeah, this error is most likely due to you writing the URL in a wrong format. You can either use the browser method to do it for you or follow the example below:
"WEBHOOK_URLS": [
    "https://discord.com/api/webhooks/X/1",
    "https://discord.com/api/webhooks/X/2"
],

Closed due to inactivity.


Profile the performance of jekyll build in CI

On a recent run, the overall time was 241s, of which I spent 73s in the site build – even though it already has a warm cache and shouldn't need to be doing much. Locally the same build takes ~2s.
Where's all the time going in CI?

🚀 Deployed on https://6614f67d5c080183b4c40d2d--alexwlchan.netlify.app

And this time it was much faster. 😕
Oh well, if it works it works!


Empty p12 certificate of imported certificate

Important notices
[x] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
[x] I have searched the existing issues and I'm convinced that mine is new.
Describe the bug
Empty p12 certificate when try to download an imported existing certificate. This seems to lead to failed connections with OpenVPN.
To Reproduce

Import an existing certifitcate (with private key)
Export ca+user cert+user key in .p12 format

Expected behavior
No empty .p12 file.
Environment
OPNsense 19.7.2-amd64

doesn't happen on my end, can you supply sample data and detailed steps?

I will try to provide sample data as soon as possible. This is the error in the log.
[19-Aug-2019 19:53:08 Europe/Berlin] Exception: Error at /usr/local/opnsense/mvc/app/library/OPNsense/OpenVPN/BaseExporter.php:68 - openssl_pkcs12_export(): cannot get private key from parameter 3 (errno=2) in /usr/local/opnsense/mvc/app/controllers/OPNsense/Base/ApiControllerBase.php:85 Stack trace: #0 [internal function]: OPNsense\Base\ApiControllerBase->APIErrorHandler(2, 'openssl_pkcs12_...', '/usr/local/opns...', 68, Array) #1 /usr/local/opnsense/mvc/app/library/OPNsense/OpenVPN/BaseExporter.php(68): openssl_pkcs12_export(Resource id #41, NULL, false, '', Array) #2 /usr/local/opnsense/mvc/app/library/OPNsense/OpenVPN/ArchiveOpenVPN.php(83): OPNsense\OpenVPN\BaseExporter->export_pkcs12(Resource id #41, false, NULL, Array) #3 /usr/local/opnsense/mvc/app/controllers/OPNsense/OpenVPN/Api/ExportController.php(405): OPNsense\OpenVPN\ArchiveOpenVPN->getContent() #4 [internal function]: OPNsense\OpenVPN\Api\ExportController->downloadAction('1', '5d5ad650c047e') #5 [internal function]: Phalcon\Dispatcher->callActionMethod(Object(OPNsense\OpenVPN\Api\ExportController), 'downloadAction', Array) #6 [internal function]: Phalcon\Dispatcher->dispatch() #7 /usr/local/opnsense/www/api.php(26): Phalcon\Mvc\Application->handle() #8 {main}

sorry, my fault. the private key was crypted.


Add c++20 modules example

https://www.youtube.com/watch?v=c563KgO-uf4
https://www.youtube.com/watch?v=DJTEUFRslbI

Make it work as an example of ss-cpp


5.1.0 nextProps enabling and disabling conditions identical

Hi,
Love the idea and the work you've put into this library . We're rewriting our site in React and were using it to create some lightweight dropdowns. 5.1.0 seems much faster from 4.x but that's likely due to our limited knowledge of react.  Integrating it though we noticed the componentWillReceiveProps if conditions are identical so disableOnClickOutside wasn't being called properly.
See: https://github.com/Pomax/react-onclickoutside/blob/master/index.js#L131
We flipped it and now it's working magnificently.  Don't have time to open a proper pull request until next week cause of our tight deadline, but hope this helps and thanks for helping the community through a mostly thankless job.  If I've got this wrong, please don't hesitate to let us know. Our fix:
        componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
          if (this.props.disableOnClickOutside && !nextProps.disableOnClickOutside) {
            this.enableOnClickOutside();
          } else if (!this.props.disableOnClickOutside && nextProps.disableOnClickOutside) {
            this.disableOnClickOutside();
          }
        },

Allow me to blow your mind: click "edit this file" on https://github.com/Pomax/react-onclickoutside/blob/master/index.js, and just drop your code in, in the right place, then make a pull request without ever having to clone, use a text editor, or any of the other inconveniences if you just have a simple fix that you want to send up and forget about =)
(Github added some really nice things recently)

Mind legitimately blown. We have some great use cases for this where it'll eliminate a lot of hassle.  Opened a pull request for ya.  Thanks for the tip =)

it made github so much nicer for getting contributions for things that are tiny, but would otherwise still take more time "than it's worth". Honestly, github didn't yell about that feature loud enough when they added it =)
I've merged the code and will spin a new release.

v5.1.1 published to npm


Add product analytics

Lots of good solutions out there, plausible, simple, posthog, mixpanel, microsoft clarity etc.

Think we're going inhouse with this with clickhouse


Make sure "logseq-whisper-subtitles-server" is running

The firewall has been turned off

Could you please check and share the error message in the console?


Add support for gzip encoding in HTTP requests

@yuyiguo , here is set of changes to allow DBSClient to use gzip encoding for HTTP POST requests, e.g. bulkblocks API. My original benchmark shows that usage of such encoding can save us 10-20 times on network, e.g. 180MB payload can be easily gzipped to 3MB before sending to server. Of course, the server itself should be aware of such encoding and handle properly such data. That's why I disable it by default (see useGzip=False in DbsApi constructor). But these changes provide a way to start using this encoding of data.
@amaltaro you can also use this as an example for other WMCore client's calls. And, it is related to https://github.com/dmwm/DBS/pull/648 and https://github.com/dmwm/WMCore/issues/10451 issues. I provided concise example of Cherrypy server implementation in my gist.

@yuyiguo it is a issue for our frontends though, if we can reduce payload on FE then FE will need less resources and process it faster. So, if you don't mind I'll merge it after I'll perform additional tests on BE servver.

@vkuznet
I don't mind to merge it at all.

@amaltaro it would be nice if you'll review it before you're going to vacation, such that I can merge and proceed.


hey guys, what's wrong about that.  Unable to download webpage: HTTP Error 404: Not Found (caused by HTTPError());

levinedeMacBook-Pro:k levine$ youtube-dl https://www.youtube.com/watch?v=e-ORhEE9VVg -v
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=e-ORhEE9VVg', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2<IP_ADDRESS>
[debug] Python version 2.7.6 - Darwin-14.1.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] e-ORhEE9VVg: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 308, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1610, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 448, in error
return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
levinedeMacBook-Pro:k levine$ youtube-dl -U

Thank you for the report. Unfortunately, downloading that video works fine for me, so I cannot reproduce the problem. Do you see the problem from multiple ISPs?

oh, I from china .  but  I used ShadowSockets. chrome works fine. maybe it not really global proxy!.  thx..

Shadowsock is a SOCKS5 proxy. youtube-dl hasn't been given any indication of that, and we lack SOCKS5 support anyways.

SOCKS proxies are now supported.


History driver input typings doesn't support history.push API fully

History can do:
history.push({
  pathname: "/home",
  search: "?the=query",
  state: { some: "state" }
})

For example if one wants to replace only search prop. But HistoryIntput typings doesn't allow this kind of input.

@issuehuntfest has funded $40.00 to this issue. See it on IssueHunt

Fixed by #890, I gues it's time to close this issue :)

@staltz sorry for the noise, but I guess you forgot to check issuehunt.

@qti3e Sure, sorry about that, should be done correctly now : )


Add recipe deployment option available/required

Removes the hardcoded "available" deployment purpose and instead uses the value specified in the new "Purpose" option in recipes. New-CMApplicationDeployment defaults to "available" if -DeployPurpose is not specified.
Fixed the SingleRecipe dynamic parameter so it won’t complain about an unresolved part when not explicitly specifying -RecipePath. Also amended the parameter logic to only consider xml files and fall back to the standard recipe directory if called from the CMpackager directory.
Lastly a minor fix to the cast of RecipePath parameter from file to directory.
These should help address #128 , #134 and #138

This is amazing, and I learned about [System.IO.DirectoryInfo]. Thanks for the contribution!


hard coded cuda path and undeclared pytorch dependency

Hi There,
I am interested in using your model but ran into a couple of issues:

lines 8-9 in models_rd.py have a hardcoded path to a windows package.
there is an undeclared dependency pytorch_geometric

I was wondering if you can make some suggestions on the above issues.
many thanks
Sonika

Hi @tsonika, you can try Raindrop in PyPOTS https://github.com/WenjieDu/PyPOTS with only few lines of code.


[Feature Request] Support multiple line comment styles

Some languages, e.g. rust (///) and haskell (-- |) have special line comment styles for docstrings and perhaps other purposes that I'm unaware of. As Comment.nvim only supports one expression for each of line and block comments, the remainder of the docstring preamble is left in place (for rust, /\s*, and for haskell, |\s*). It would be really neat if uncommenting lines styled with the docstring format would remove the entire comment preamble and trim leading spaces the way it does for normal line comments. I imagine this would involve a hierarchy: using rust as an example, check first for ///%s and then //%s. Obviously there's no way to know when commenting lines which style to use without user input, so either ignore the issue and always use some notion of a default style or provide bindings to select the intended style.
I'll note that it may be possible to do the uncommenting portion somewhat hackishly with a post_hook, e.g. by deleting all leading forward slashes and spaces in uncomment mode in the rust example, but a specific feature for multiple comment styles would probably be much cleaner.

I imagine this would involve a hierarchy

You can't say for sure that you can go with the same "hierarchy" approach for every language.
Adding support for doc comments in the plugin would require some thinking. But if you want to implement this by yourself, you can use :h comment.utils functions (more specifically by combining comment.utils.{unwrap_cstr,commenter,uncommenter}).
That being said, I am going to close for now as I don't think I'll be able to add this into the plugin soon.

Okay, thanks for the tip. No promises, but I'll take a look at what you've suggested. Would appreciate an open feedback line on this issue if I have any questions.


mediaViewDisplaySize not being set?

So I have a custom class for my message model which contains a media_ object that is of type JSQPhotoMediaItem?.
I add a UIImage to the image property and set isMediaMessage_ to true. then I try appending my message to my datasource and reloading the CollectionView. When I do this however it hangs up and brings me to this part of the framework:
if ([messageData isMediaMessage]) {
        finalSize = [[messageData media] mediaViewDisplaySize];
 }

The error is: unrecognized selector sent to instance 0x135f05d20
Here is my message model:
`class CustomJSQMessage : NSObject, JSQMessageData {
var senderId_ : String!
var senderDisplayName_ : String!
var date_ : NSDate
var isMediaMessage_ : Bool
var media_ : JSQPhotoMediaItem? //JSQMessageMediaData? //
var messageHash_ : UInt?
var text_ : String
var userIdOwner_: String?
var userIdInquirer_: String?
var messageOwnerType_: String?

init(senderDisplayName: String?, isMediaMessage: Bool, hash: Int, text: String) {
    //self.senderId_ = senderId
    self.senderDisplayName_ = senderDisplayName
    self.date_ = NSDate()
    self.isMediaMessage_ = isMediaMessage
    self.messageHash_ = UInt(arc4random()) //messageHash()
    self.text_ = text
}

func senderId() -> String! {
    return senderId_;
}

func senderDisplayName() -> String! {
    return senderDisplayName_;
}

func date() -> NSDate! {
    return date_;
}

func isMediaMessage() -> Bool {
    return isMediaMessage_;
}

func messageHash() -> UInt {
    return UInt(messageHash_!);
}

func text() -> String! {
    return text_;
}

func userIdOwner() -> String! {
    return userIdOwner_;
}

func userIdInquirer() -> String! {
    return userIdInquirer_;
}

func messageOwnerType() -> String! {
    return messageOwnerType_;
}

}`
anyone have any Idea why it cant find the correct size for my image?
Thanks in advance!

Hey @uknowmeright :smile:
I'm cleaning up old issues and trying to finish the next release of the library. I'm sorry I don't have time to respond to all questions.
I'm going to close this issue, but the community should feel free to continue the discussion.
Other ways to get help:

Ask on StackOverflow with the jsqmessagesviewcontroller tag
See the FAQ
Search previous questions


merged with open-liberty/dev/wlp-jakartaee-transform/rules/jakarta-direct.properties with some reordering to allow easy future merging as needed

Signed-off-by: Scott Marlow<EMAIL_ADDRESS>For comparison with https://github.com/wildfly-extras/batavia/pull/90
This change merges our current settings with new ones from https://github.com/OpenLiberty/open-liberty/blob/integration/dev/wlp-jakartaee-transform/rules/jakarta-direct.properties, with some reordering for easy comparison.
I plan to create a pull request for https://github.com/OpenLiberty/open-liberty/blob/integration/dev/wlp-jakartaee-transform/rules/jakarta-direct.properties of these changes if we use them.

This PR incorporates https://github.com/wildfly-extras/batavia/pull/90


Reading outputs directly

Hello, i am trying to make the steam controller work on my raspberry pi 2, in order to use it for an external game. Therefore, i need to be able to read the different buttons in a program, that only needs to control the gpio's on the board.  So, i just need to know how to grab the data sent from the controller, just like the sc-dump does, however, i need it stored in some variables that i can interact with. I have a hard time finding the functions to call, in order to do this, as my main language is not python. Any help appreciated, as this could be used for many things, including controlling RC-cars, drones and other things from the gpio.

Found a way, where i configured in the sc-dump file, though it is a workaround. This is how i made it:
def dump(_, sci):
    if sci[5] < 0:
        GPIO.output(2,True)
    else:
        GPIO.output(2,False)

I would still like to have a small description, in order to make a correct function that does not just hack another.

Maybe you could use the callback API as in sc-callbacks.py.

I can't seem to find out how to use the callbacks correctly.. I am always left using the pre-made callback functions, where i just read the sci-data, as in my example above. If you have the time to write the lines of code needed to attach a button to a variable in python, it would be much appreciated. Or perhaps explain how the sci in the dump funtion works, in order to use it with  other projects.
p.s.
I love the work you have done for using the steam controller on linux systems, i am surely going to be using it for many of my projects. If in no other ways, by decoding the sci output.

The sci is a tuple built from usb data decoded with struct in init.py
SteamControllerInput._make(struct.unpack('<' + ''.join(_FORMATS), data))
_FORMATS are constructed from STEAM_CONTROLER_FORMAT also in init.py.
using callbacks as in sc-callbakcs.py you should use something like this:
import sys

from steamcontroller import SteamController, SCButtons
from steamcontroller.events import EventMapper, Pos
from steamcontroller.uinput import Keys

def btnAPressedCallback(evm, btn, pressed):
    GPIO.output(2, pressed)

def exitCallback(evm, btn, pressed):
    if not pressed:
        sys.exit()

def evminit():
    evm = EventMapper()
    evm.setButtonCallback(SCButtons.A, btnAPressedCallback)
    evm.setButtonCallback(SCButtons.STEAM, exitCallback)
    return evm

if __name__ == '__main__':
    evm = evminit()
    sc = SteamController(callback=evm.process)
    sc.run()


V2: "not exist, faking successful response"

Not too big of an issue, but i think we all agree that this shouldn't be there :D
recover/recover.go
93    logger.Infof("user %s was attempted to be recovered, user does not exist, faking successful response", recoverVals.GetPID())

So there's no password leaks going on here. Are we worried about divulging too much information by including username/e-mail or what have you? I saw this as useful logging from a support piece. And the functionality of faking a successful response is very useful since we never want to divulge if an attacker was right in guessing an e-mail. These kinds of logs can also lead to the discovery of foul-play and bruteforce attempts. I'm definitely keen on improving it in whatever way we need to, but I'm gonna need to be thrown the obvious bone here. It'd also be good to see some best practice documentation to support whatever we're going to do here.

Man, this was a joke of a "issue"
Was talking about using language like "faking" in a open source library.
The V2 is pretty easy to adjust(once you get used to your style). Thanks for the package man!


ServiceClientCredentials support for SkillHttpClient

Is your feature request related to a problem? Please describe.
In the old Skill SDK (botbuilder-skills), the SkillDialog supported passing in a IServiceClientCredentials object, which would be used in the old SkillHttpTransport  to allow for adding different kinds of authentication or any type of request transformations when connecting to the skills.
With SkillHttpClient (mostly BotFrameworkHttpClient) only supports appId and appPassword authentication and nothing else anymore.
Describe the solution you'd like
It would be nice to be able to define some kind of middleware (or if you moved from axios to the azure ms-rest-js again) in order to transform the outgoing request.
Describe alternatives you've considered
There's no alternative as appId and appPassword are not secure enough for us, so we're using api keys in addition.
Additional context
[enhancement]

@alopix our next release is R8 scheduled ~March 16..  FYI..

Need to validate the other language implementations.

@alopix the fix we've landed on in our current R8 release is to align the JavaScript implementation with the C# and introduce a buildCredential protected member function that can be overriden to provide an alternative token factory. Ideally we starting to realize the ICredentialProvider class needs a rethink (apparently it dates from v3) but we would like to postpone a deeper refactoring.
So hopefully this works for you. Please let us know if it doesn't.

Thanks, but unfortunately that does not really solve the problem.
The solution still only allows for auth via the Authorization header which is not what you would have to use for e.g. an AWS Gateway API Key, which has to be provided via the x-api-key header instead.

Thanks @alopix.
The changes we made in R8 provide some flexibility in the BotFrameworkHttpClient implementation and makes this consistent with other aspects of our framework. We also aligned the JavaScript model with what we had shipped in C# in R7. This is a consistent and good but minor modification. It doesn't seem to address the issue raised here which is looking for something more fundamental.
Without our current bits the solution for controlling specific HTTP headers would be further down the stack. In C# that means a custom HttpClient which can be handed into this class. (BotFrameworkHttpClient is really an application specific HttpClient - designed to be injectable follow the model of HttpClientFactory introduced in recent ASP.) The problem is focusing on the HttpClient is very C# specific and we would ideally like to be reasonably consistent across languages.
We need to review this design all up and see what we can do to make it more flexible. Reopening and marking as R9.

Hi @alopix
Thanks for raising this issue.  Fortunately, the buildCredentials override of 4.8 can be used with a custom CertificateAppCredentials enabling using a certificate instead of appid/password, and also setting the x-api-key header in signRequest
Something like:
const keyPemFile = './private-key.pem';
const pkFromFile = fs.readFileSync(
    path.resolve(__dirname, keyPemFile),
    { encoding: 'utf8'}
);

const adapterSettings = {
    appId: process.env.MicrosoftAppId,
    // appPassword: process.env.MicrosoftAppPassword,
    certificatePrivateKey: pkFromFile,
    certificateThumbprint: process.env.certificateThumbprint,
};

class SignRequestAppCredentials extends CertificateAppCredentials {
    async signRequest(webResource) {
        if (AppCredentials.isTrustedServiceUrl(webResource.url)) {
            webResource.headers.set('x-api-key', 'key value here');
            const token = await this.getToken();
            return new msrest.TokenCredentials(token).signRequest(webResource);
        }
        return webResource;
    }
}

class BuildCredentialsSkillHttpClient extends SkillHttpClient {
    async buildCredentials(appId, oAuthScope) {
        return new SignRequestAppCredentials(appId, adapterSettings.certificateThumbprint, adapterSettings.certificatePrivateKey, undefined, oAuthScope);
    }
}

const credentialProvider = new SimpleCredentialProvider(process.env.MicrosoftAppId, '');
const conversationIdFactory = new SkillConversationIdFactory();
const skillClient = new BuildCredentialsSkillHttpClient(credentialProvider, conversationIdFactory);

4.8RC can be found on myget: https://botbuilder.myget.org/feed/botbuilder-v4-js-daily/package/npm/botbuilder/4.8.0
Please give this a try, and let us know if it meets your requirements.

@EricDahlvang thanks for the sample, unfortunately signRequest will never be called as it's not being used inside the SkillHttpClient (or rather it's parent BotFrameworkHttpClient).
It only ever calls the getToken method and ignores the rest of the interface.
Looking at the repo I cannot find a single reference to the signRequest method actually being used anymore.
I’m not sure if some of the AppCredentials interface isn’t just legacy code from when botbuilder-skills was “merged” and the IServiceClientCredentials interface was somehow turned into the AppCredentials: https://github.com/microsoft/botframework-solutions/blob/master/sdk/typescript/libraries/botbuilder-skills/src/auth/serviceClientCredentials.ts
The legacy SkillHttpTransport actually did call the sign method instead of just getting the token: https://github.com/microsoft/botframework-solutions/blob/master/sdk/typescript/libraries/botbuilder-skills/src/http/skillHttpTransport.ts#L55

@alopix since SkillHttpClient uses axios, a request interceptor should work for setting custom headers on these calls:
const axios = require('axios');
axios.interceptors.request.use(function(config) {
    config.headers['x-api-key'] = process.env.xapikey;
  return config;
}, function(err) {
  return Promise.reject(err);
});

signRequest is called internally, by ms-rest-js: https://github.com/Azure/ms-rest-js/blob/fcc8528c75bc230255fbd902c8682f96b6c9aed6/lib/policies/signingPolicy.ts#L24 So the call is not in the BB codebase.