Double-rendering

Please run the following case:
import React from 'react';
import { createMemoryHistory } from 'history';
import { createStore, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { Button, Text, View } from 'react-native';
import { Route, Switch, Router } from 'react-router-native';
import { connectRouter, ConnectedRouter } from 'connected-react-router';

const normalHistory = createMemoryHistory();
const reduxHistory = createMemoryHistory();
const rootReducer = combineReducers({
  router: connectRouter(reduxHistory),
});
const store = createStore(rootReducer, undefined);

function TestCase({ name, history }) {
  return (
    <Switch>
      <Route
        path="/"
        exact
        render={() => {
          console.log('render foo', { name });
          return <Button title="foo" onPress={() => history.push('bar')} />;
        }}
      />
      <Route
        path="/bar"
        render={() => {
          console.log('render bar', { name });
          const handlePress = () => {
            setTimeout(() => {
              history.push('/baz');
            }, 1000);
          };
          return <Button title="bar" onPress={handlePress} />;
        }}
      />
      <Route
        path="/baz"
        render={() => {
          console.log('render baz', { name });
          return <Text>baz</Text>;
        }}
      />
    </Switch>
  );
}

export default function Entrypoint() {
  return (
    <React.Fragment>
      <View style={{ padding: 20 }}>
        <Router history={normalHistory}>
          <TestCase name="normal" history={normalHistory} />
        </Router>
      </View>
      <View style={{ padding: 20 }}>
        <Provider store={store}>
          <ConnectedRouter history={reduxHistory}>
            <TestCase name="connected" history={reduxHistory} />
          </ConnectedRouter>
        </Provider>
      </View>
    </React.Fragment>
  );
}

Click on foo -> bar -> baz in both of the routers:

"normal" router will output: render baz only once;
"connected" router will output render baz twice.

Why?
    "connected-react-router": "5.0.1",
    "react-router-native": "^4.3.0",

Our history.push() is called in an asynchronous redux-action, so we need it to work as expected in this case.

I'm also dealing with this same issue

Also receiving this issue.

I found that changing any routes from using component prop to render prop did the trick:
Works
        <Switch>
          <Route path={'login'} render={props => <LoginContainer {...props} />} />
        </Switch>

Renders 2x
        <Switch>
          <Route path={'login'} component={props => <LoginContainer {...props} />} />
        </Switch>

I'm also having this issue. Note that I've followed the connected-react-router documentation in the README to setup the Redux store properly. I'm also on<EMAIL_ADDRESS>and<EMAIL_ADDRESS>I've created a simple use case to test:
// AppContainer.js

const AppContainer = () => (
  <Provider store={store}>
    <ConnectedRouter history={history}>
      <App />
    </ConnectedRouter>
  </Provider>
)

On initial application load the App component will render two times:
// App.js

const App = () => {
  console.log('App rendering') /* logs twice */
  return (

      <Switch>
        <Route exact path="/" component={Home} />
        <Route path="/about" component={About} />
      </Switch>

  )
}

This becomes a major issue depending on the complexity of the application. For instance, Nav will also render two times on initial load:
// Nav.js

const Nav = () => {
  console.log('Nav is rendering') /* logs twice */
  return (

      <Link to="/">Home</Link>
      <Link to="/about">About</Link>

  )
}

Depending on the route that loads, that component will also render two times, and so on and so on.
The takeaway here is that ConnectedRouter is rendering twice, as anything outside of it is not affected:
// AppContainer.js

const AppContainer = () => (
  <Provider store={store}>
    <Test /> {/* renders once */}
    <ConnectedRouter history={history}> {/* renders twice */}
      <App />
    </ConnectedRouter>
  </Provider>
)

// Test.js

const Test = () => {
  console.log('Test rendering ') /* logs once */
  return

}

This is issue is still not resolved, still getting this on 6.5.2

Getting this on 6.6.1.

For me the use of render instead of component worked when i remove lazy load functionality.
// This causes double re-render
<Route path="/institution" component={() => <InstitutionContainer hideHeader={state => hideHeader(state)} />} />
// This causes double re-render
<Route path="/institution" render={() => <InstitutionContainer hideHeader={state => hideHeader(state)} />} />
// This doesn't cause double re-render
<Route path="/institution" render={() => <InstitutionContainer hideHeader={state => hideHeader(state)} />} />

I am on 6.8.0 and the issue still happens. However, as @AlexReff pointed out this is caused by React.StrictMode component.

I am on 6.8.0 and the issue still happens. However, as @AlexReff pointed out this is caused by React.StrictMode component.

thanks bro! it worked for me

I am on 6.8.0 and the issue still happens. However, as @AlexReff pointed out this is caused by React.StrictMode component.

It worked form me as well, Thank you!

Is there any way to make connected-react-router correctly working in conjunction with React.StrictMode?

thanks

I changed index.js file from
ReactDOM.render(   <React.StrictMode>     <App />   </React.StrictMode>,   document.getElementById('root') );
To
ReactDOM.render(      <App />,   document.getElementById('root') );
After doing this wrapper "React.StrictMode" removed, Solved this issues well.

I changed index.js file from
ReactDOM.render( <React.StrictMode> <App /> </React.StrictMode>, document.getElementById('root') );
To
ReactDOM.render( <App />, document.getElementById('root') );
After doing this wrapper "React.StrictMode" removed, Solved this issues well.

Worked for me. Thanks!
Didn't know this:
https://stackoverflow.com/questions/61254372/my-react-component-is-rendering-twice-because-of-strict-mode

Thanks to this discussion, I could fix my problem with double renderings due to strict mode, too. I use version 5.2.0.

Should definitely be in the README ...

@Cethy completely agree with you !

Hey everyone! Thanks for this awesome library!
I'm using 6.8.0 and still seeing the issue without React.StrictMode.
I'm using it inside Chrome Extension. Redux Store is wrapped with webext-redux, so it's located in the extension's background page and the React app is running in the Chrome extension's popup mode.
Here's a fragment from package.json:
"connected-react-router": "^6.8.0",
"history": "^4.10.1",
"react": "^16.13.1",
"react-browser-extension-scripts": "3.3.1",
"react-dom": "^16.13.1",
"react-redux": "7.2.0",
"react-redux-firebase": "3.1.0",
"react-router-dom": "5.1.2",
"redux-saga": "1.1.3",
"redux-saga-firebase": "^0.15.0",
"webext-redux": "2.1.6"

Here's my main render:
store
  .ready()                                      // webext-redux wraps regular redux store, so here it is a promise
  .then(() => store.getState())
  .then(selectLocation)                 // getting the route to start the Chrome Extension from the latest screen
  .then((startLocation) => {
    ReactDOM.render(
      <Provider store={store}>
        <ErrorBoundary>               // this is a simple class component with `componentDidCatch`.
          <ReactReduxFirebaseProvider // this guy comes from `react-redux-firebase` and works as Firebase instance connected to store
            firebase={firebase}
            config={{
              userProfile: 'users',
              useFirestoreForProfile: true,
              enableClaims: true,
            }}
            dispatch={store.dispatch}
          >
            <Router history={history}>
              <Routes startLocation={startLocation} />
            </Router>
          </ReactReduxFirebaseProvider>
        </ErrorBoundary>
      </Provider>,
      document.getElementById('root'),
    );
  })
  .catch((e) => console.error(e));

I already spent a few days and nights trying to solve this issue but no luck. Fortunately, I'm here after days of googling.
I tried the following magic after I found this thread:

removed ErrorBoundary
moved ReactReduxFirebaseProvider inside Router

And there were a looot of magic tricks and workarounds before I landed here.
This issue causes initializing the state in useStates twice in each component and all the app is not working as expected. And the app has already grown, so returning back to the regular router is not an option.
Any help is appreciated! Thanks!

React.StrictMode is probably going to be useful going forward. Maybe this would solve the issue and also allow you to watch for mistakes in functional components.


Typo

Dear Documentation Team,
I've just discovered a possible typo, please review and correct it if I'm right.
In the Operational security of the Authentication Agents section in the 9th point the certificate store should be CERT_SYSTEM_STORE_CURRENT_USER because after the automatic renewal the certificates are stored, here not under the local machine certificate store.
Thanks in advance!
Best Regards,
Gergő

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: eafd62b3-145a-7c93-e88d-a7fb29814a0d
Version Independent ID: 999181be-96fa-1be6-36f3-b604f43613ed
Content: Azure Active Directory Pass-through Authentication security deep dive
Content Source: articles/active-directory/hybrid/how-to-connect-pta-security-deep-dive.md
Service: active-directory
Sub-service: hybrid
GitHub Login: @billmath
Microsoft Alias: billmath

@csucsuno1
Thanks for your feedback! I have assigned this issue to the author who will investigate and update as appropriate.


Populate must accept an object

Bug report
populate query parameter only accepts strings and lists, passing an object is not allowed.
Describe the bug
I am trying to deeply populate a dynamic zone having unknown set of components who's field names are unknown upfront. Strapi seems to support this as per example in their documentation: Deeply populate a dynamic zone with 2 components:
const result = await this.$strapi.find('pages', {
  populate: {
    sections: '*',
  },
});

A clear and concise description of what the bug is.
strapi-sdk-js does not allow to define populate parameter as an object as per Strapi documentation.
Steps to reproduce the behavior

Go to the documentation link posted above
Copy the query
Try using populate parameter with strapi-sdk-js
See error: only string | string[] is allowed

Expected behavior
The populate object should be accepted and correctly encoded into a query string, looking something like this:
/api/pages?populate[sections][populate]=%2A

I believe only this line
https://github.com/Stun3R/strapi-sdk-js/blob/43b71d1d94daca353d6a0ba31414c033e0b1a0f1/src/lib/types.ts#L556
needs to be changed to include objects. I will create a PR.

Bug report
populate query parameter only accepts strings and lists, passing an object is not allowed.
Describe the bug
I am trying to deeply populate a dynamic zone having unknown set of components who's field names are unknown upfront. Strapi seems to support this as per example in their documentation: Deeply populate a dynamic zone with 2 components:
const result = await this.$strapi.find('pages', {
  populate: {
    sections: {
      populate: '*'
    },
  },
});

A clear and concise description of what the bug is.
strapi-sdk-js does not allow to define populate parameter as an object as per Strapi documentation.
Steps to reproduce the behavior

Go to the documentation link posted above
Copy the query
Try using populate parameter with strapi-sdk-js
See error: only string | string[] is allowed

Expected behavior
The populate object should be accepted and correctly encoded into a query string, looking something like this:
/api/pages?populate[sections][populate]=%2A

Hi @nextrapi 👋🏻
Thanks for this issue! I'll look into it & do some testing so I could fix it as soon as possible (It should be released tomorrow) 🙌🏻


Mobx support?

So, we have redux/elm like state management. But, what about mobx?
Here is their user guide.
Here is a 10 minute interactive tutorial.

I used to write with Redux, but Mobx changed everything for me. Besides having data react automatically, the most important thing for me was being able to use classes with real references (no normalizing of data required). Also, Typescript... is amazing (Mobx is written in it).

But, what about mobx?

Hi @thinkpadder1 👋
HyperApp's is influenced by the Elm Architecture, hence the suitable comparison to Redux. In HyperApp the model is theoretically immutable, components are stateless, pure functions and actions are a mixture of reducers (old state + data -> new state out) and effects (reactions in Mobx).
Mobx seems to favor object-oriented programming, using classes/prototypes and stateful components. Use of observables, decorators and TypeScript is also popular.
At a glance, Mobx seems entirely different to HyperApp's model, so I have no idea how it could be used with Mobx. I'd be interested in hearing your ideas, though, of how the API would work and look like.

I looked at their examples, found a simple countdown timer example and made the same thing in HyperApp. Let's see how they compare:
Countdown Timer: HyperApp
<script src="https://unpkg.com/hyperapp"></script>

View online

Countdown Timer: React+Mobx
<script src="https://cdn.jsdelivr.net/g/react@15.4.2(react.min.js+react-dom.min.js),lodash<EMAIL_ADDRESS><script<EMAIL_ADDRESS><script<EMAIL_ADDRESS><script src="https://unpkg.com/mobx-react-devtools"></script>

mobx.useStrict(true);

var countdownTimerFactory = function(durationMilliseconds, options) {
    var intervalID;

    var timer = {
        id: _.uniqueId("countdownTimer_"),
        originalMilliseconds: durationMilliseconds
    };

    var settings = _.assign(
        {
            interval: 10,
            runTime: 0,
            resetOnComplete: true
        },
        options
    );

    mobx.extendObservable(timer, {
        durationAsMilliseconds: timer.originalMilliseconds,
        isTimerRunning: false,
        get isComplete() {
            return timer.durationAsMilliseconds <= 0;
        },
        get display() {
            return _.padStart(timer.minutesRemaining, 2, 0) +
                " : " +
                _.padStart(timer.secondsRemaining, 2, 0);
        },
        get durationAsDate() {
            return new Date(timer.durationAsMilliseconds);
        },
        get millisecondsRemaining() {
            return _.round(timer.durationAsDate.getUTCMilliseconds(), 2);
        },
        get secondsRemaining() {
            return timer.durationAsDate.getUTCSeconds();
        },
        get minutesRemaining() {
            return timer.durationAsDate.getUTCMinutes();
        },
        get hoursRemaining() {
            return timer.durationAsDate.getUTCHours();
        },
        get percentageComplete() {
            return 100 -
                _.round(
                    timer.durationAsMilliseconds /
                        timer.originalMilliseconds *
                        100,
                    2
                );
        },
        startTimer: mobx.action("startTimer", function() {
            timer.isTimerRunning = true;
        }),
        stopTimer: mobx.action("stopTimer", function() {
            timer.isTimerRunning = false;
        }),
        reset: mobx.action("resetTimer", function() {
            timer.stopTimer();
            timer.durationAsMilliseconds = timer.originalMilliseconds;
        })
    });

    mobx.autorun("countDownTimer", function() {
        if (timer.isTimerRunning) {
            intervalID = window.setInterval(
                function() {
                    mobx.runInAction("timer tick", function() {
                        timer.durationAsMilliseconds -= settings.interval;
                        if (timer.isComplete) {
                            timer.isTimerRunning = false;
                        }
                    });
                },
                settings.interval
            );
        } else if (intervalID) {
            if (settings.resetOnComplete && timer.isComplete) {
                timer.reset();
            }
            window.clearInterval(intervalID);
        }
    });

    return timer;
};

var Main = mobxReact.observer(function(props) {
    var timer = props.timer;
    return React.DOM.div(
        null,
        React.createElement(mobxDevtools.default),
        React.createElement(timerWithBar, { timer: timer }),
        React.createElement(timerControl, { timer: timer }, timerControl)
    );
});

var timerControl = mobxReact.observer(
    React.createClass({
        render: function() {
            var timer = this.props.timer;
            var button;

            if (timer.isTimerRunning) {
                button = React.DOM.button(
                    { onClick: this.handlePause },
                    "pause"
                );
            } else {
                button = React.DOM.button(
                    { onClick: this.handleStart },
                    "start"
                );
            }

            return React.DOM.div(null, button);
        },
        handleStart: function(event) {
            event.preventDefault();
            this.props.timer.startTimer();
        },
        handlePause: function(event) {
            event.preventDefault();
            this.props.timer.stopTimer();
        }
    })
);

var timerWithBar = mobxReact.observer(function(props) {
    var timer = props.timer;
    return React.DOM.div(
        { className: "active-blind" },
        React.createElement(timerPercentageCompleteRenderer, { timer: timer }),
        React.createElement(timerRenderer, { timer: timer })
    );
});

var timerPercentageCompleteRenderer = mobxReact.observer(function(props) {
    return React.DOM.div(
        { className: "progress-bar-container" },
        React.DOM.div({
            className: "progress-bar",
            style: { width: props.timer.percentageComplete + "%" }
        })
    );
});

var timerRenderer = mobxReact.observer(function(props) {
    var timer = props.timer;
    return React.DOM.div(null, timer.display);
});

var timer = countdownTimerFactory(10000);
ReactDOM.render(
    React.createElement(Main, {
        timer: timer
    }),
    document.getElementById("mount")
);

View online

What can we take from the above?

Mobx has powerful ecosystem and devtools, it's flexible; it does not force you to think in terms of immutable state and reducers.

Mobx can feel frameworky, it's also pretty large, react bindings + mobx is like 64kb minified, and 20kb gzipped. Add React, router, fetch and friends on top and you have 1/10 of a megabyte or more. Now you are ready to start writing your app!

HyperApp's is still in its infancy, the User Guide is still a work in progress and we need more people to try it out and make cool stuff with it

HyperApp applications are functional out of the box, that's a selling point, but also presents a learning curve to newcomers used to traditional imperative / object-oriented programming (I know that Mobx is better than that, but I think they belong to the same category).

Damn, i'm tired and lazy, so i'll paste a pic of what i wrote while i was in lecture in university, haha, so hope you get it and let me know if there is anything to clarify.

The timer example is much too simple. Mobx was originally made because the creator was working on a project with a lot of domain models (more than 500 for his application alone). Imagine trying to create that in Redux/Elm and with functional programming only.
Here is an example with a Todo Store.

@thinkpadder1 Sure. That was just one of the examples in Mobx examples repository.
It seems the link you've posted links to mostly documentation, so it's kind of hard to say anything or make any hard comparisons. I'd rather work on actual examples.
Do you have an example where Mobx really shines? I'd love to code it using HyperApp and see where that takes me.
And I agree with you, a countdown timer is much too simple, but that also begs the question, how come Mobx's implementation of it is so complex?

@thinkpadder1 Mobx is on the left. Both programs are doing the same thing.

HyperApp's example adds a reset button too, and has no dependencies; Mobx's has no reset button and includes lodash and moment.js as dependencies.

And why you deleted my comment? It is perfectly readable and is seen that Mobx absolutely doesn't fit well in elm-like project. It's not just it does fit, it totally can be compared - size and overhead at least.

@jbucaran That is literally the most convoluted example I have ever come across. No one writes their MobX applications like that. I can rewrite it if you would like.
Here is a full application:

Spectacle Editor
spectacle-editor source code
Why we chose MobX over Redux for Spectacle Editor

@thinkpadder1 The example was taken directly from mobx's org, from their mobx-examples repo.

@jbucaran All those examples are written in ES5 and without JSX... He was just showing that you could do it without ES6+, decorators, typescript etc.

@thinkpadder1 Thanks for the links, unfortunately, that's not what I asked for. I'm still agnostic about Mobx's superiority over Redux or TEA (The Elm Architecture).
I think the correct way to debate here, is not with words, but code. I'll ask again, please provide an example where Mobx shines so that I can try to implement the HyperApp's version and learn HyperApp's architecture's choice shortcomings.

All those examples are written in ES5 and without JSX... He was just showing that you could do it without ES6+, decorators, typescript etc.

Sure! That'd certainly improve things a bit, 30%? Not sure. Still, I think it's obvious that example was a poor choice to represent Mobx.

@jbucaran I thought Spectacle Editor was a good example, because of the amount of different models and how they react to one another.
How about this remote control app for Google Play Desktop? It has a lot of side effects and inputs.

@thinkpadder1 Thanks, that's better than docs. I was hoping for some more down to earth examples. Something vanilla like HyperApp's Examples.
Mobx's org still has other examples that I didn't have time to look at, so I'll start by rewriting some of those to HyperApp. Maybe I'll find something.
For example, while writing the countdown timer, I noticed a few things which led to creating a few issues today:

https://github.com/hyperapp/hyperapp/issues/105
https://github.com/hyperapp/hyperapp/issues/106

The bottom line, all this tinkering is good, we can learn from Mobx too.

@jbucaran Sorry, all the smaller examples I have found were just too simple (not what you would use MobX for). 😢
There is also this contacts list application which is much simpler than the Google Play one.

@thinkpadder1 Great! The contacts list one looks simple (in scope), so I could probably rewrite it to HyperApp in a couple of days.
Thanks for bearing with me 🙇.

More examples are coming! In the meantime we should close here since hyperapp will not be adding mobx support anytime soon.


Provided signin and signup pages make responsive

AS per the issue #91 assigned to me , the provided sign in and sign up pages in your website is made responsive . And I tested it several times in my local device and it is working. So please check it.
Linked Issue:  #91

@arghadipmanna101 please give some reply about this pr and this issue #91

do the same work in the updated website. @Pujan-sarkar

okay then i am closing this pr and resending anew one @arghadipmanna101


Documentation bug: Rename length to lengthOf in a test

Also the same documentation bug is still there in the vows homepage.
Could someone fix that?
Can't find the repo for it.

The example on the http://vowsjs.org/ page still refers as length instead of lengthOf

@indexzero @cloudhead Can we change that?

will do.

Thank you :)


[Bug]: Editing an existing Microsoft IDP doesn't show existing scopes.

Preflight Checklist

[X] I could not find a solution in the documentation, the existing issues or discussions
[X] I have joined the ZITADEL chat

Environment
Self-hosted
Describe the bug
I can't see the existing scopes when I try to edit the Microsoft Provider.  I don't know if this is a UI issue or the backend is not persisting the settings.
I would like to see the existing scopes, and really everything that was part of the configuration.
I think Tenant ID isn't being shown either.
To reproduce
Add a microsoft Provider, and take note of the scopes that are added.  i.e. openid profile email
After you save it click on it to edit.
Screenshots

Expected behavior
No response
Version
v2.23.1
Operating System
No response
Relevant Configuration
No response
Additional Context
No response

Hei. @ghstahl
Thanks for your report.
I just tested it myself. Looks like the problem with the scopes only exists on identity providers configured on the organization level. If I configure it on the instance level it works fine.
Also I could reproduce the problem with the tenant id.

This has been fixed.


Issue: Typo in Python Notebook

Cupy: Exercise 4: Is the expected output correct? This does not match the output of my solutions to Exercises 3 and 4.

Fixed with Merge pull request #3 from programmah/main · openhackathons-org/nways_accelerated_programming@2fc1fa7 (github.com)

@muntasers, have you also tested after you merged it?


Desktop integration fails with Appimagelauncher

Aknowledgements

[X] I have checked that there's no other issue describing the same or
similar problem that I currently have, regardless if it has been
closed or open.

[X] I can confirm that this is not an issue with the Discord website,
but it is a problem specific to the WebCord itself. I have tested
if this bug occurs on Chromium/Chrome or any other Chromium-based
browser that uses unpatched/upstream Chromium engine.

[ ] I have tried running the build from the master branch and it does
not have any fixes implemented according to my issue.

[ ] My issue describes one of the unstable and/or not fully implemented
features.

[ ] I have found a workaround to mitigate or temporarily fix this issue
in affected releases (please write it in Additional context section
below).

Operating System / Platform
🐧 Linux
Operating system architecture
x64 (64-bit Intel/AMD)
Electron version
20.1.3
Application version
3.8.3
Bug description
When using the appimage x64 version, Appimagelauncher isn't able to integrate it into the desktop menu. Monitoring the service status, it shows the following:
Integrating: /home/zenurik/Applications/Webcord-3.8.3-x64.AppImage
appimagelauncher-lite.AppImage[21889]: ERROR: appimage_register_in_system : Icon field contains path
appimagelauncher-lite.AppImage[21889]: Error: Failed to register AppImage in system via libappimage
appimagelauncher-lite.AppImage[21889]: ERROR: Failed to register AppImage in system

According to them, this issue is from a broken .desktop file and needs to be fixed in the application's end.
https://github.com/TheAssassin/AppImageLauncher/issues/494#issuecomment-1072757319
Additional context
No response

WebCord is not a project about packaging. It uses Reforged, which is still immature in terms of packaging AppImages. It should be reported in Reforged instead.

It was known, I haven't yet implemented proper desktop integration, mostly because I didn't want to announce another huge dependency in my maker just to resize image files.

Fixed in<EMAIL_ADDRESS>


Unable to modify input_datetime

Home Assistant Android version:
1.3.1 (65) via AppTester
Android version:
9 (OxygenOS 9.0.9
Phone model:
OnePlus 5
Home Assistant version:
103.5
Last working Home Assistant release (if known):
Description of problem:
Everytime you have to change a input_datetime (only a time one tested), the keyboard popup and immediatly close, preventing you to change the value
Also would be nice if in those fields that are technically number-only, if the number-only keypad popups up instead of the whole keyboard.
Traceback (if applicable):
N/A

Additional information:

Possibly the same issue here, I find trying to modify a time field causes the entire app to crash.


Filter out null element from the resulted list from cell types endpoint

Currently if we do a query like this: http://localhost:8080/gxa/sc/json/gene-search/cell-types?symbol=CFTR
then there is a null element in the returned result.
We need to filter that out.

I added the commit that fix this bug in this existing PR: #353

resloves #353


"az costmanagement query" on GovCloud fails with azure-cli 2.24.2; works with azure cli 2.8.0

Describe the bug
When using Azure Gov Cloud with azure-cli 2.24,  this command
az costmanagement query --type "Usage" --timeframe "MonthToDate" --scope "subscriptions/..."

gives this this error:
(InvalidAuthenticationTokenAudience) The access token has been obtained for wrong audience or resource 'https://management.azure.com'. It should exactly match with one of the allowed audiences 'https://management.core.usgovcloudapi.net/','https://management.core.usgovcloudapi.net','https://management.usgovcloudapi.net/','https://management.usgovcloudapi.net'.

The same command worked fine with azure-cli 2.8.0.   A workaround is to use
pip uninstall azure-cli
pip install azure-cli==2.8.0

which makes the command work again for me.
To Reproduce
Start with a clean system without the azure cli (I tried on both macos and ubuntu)
pip install -q --upgrade pip
pip install azure-cli
az cloud set --name AzureUSGovernment
az extension add --name costmanagement
az login
az costmanagement query --type "Usage" --timeframe "MonthToDate" --scope [one-of-your-subscriptions]

Expected behavior
It should give the results of the query --- exactly as it would if you replace the install command above with:
pip install azure-cli==2.8.0
Environment summary
Tried on MacOS and Ubuntu.
  $ az version
  {
    "azure-cli": "2.24.2",
    "azure-cli-core": "2.24.2",
    "azure-cli-telemetry": "1.0.6",
    "extensions": {
      "costmanagement": "0.1.1"
    }
  }

Additional context
The command worked fine with no errors with this config
  $ az version
  {
    "azure-cli": "2.8.0",
    "azure-cli-command-modules-nspkg": "2.0.3",
    "azure-cli-core": "2.8.0",
    "azure-cli-nspkg": "3.0.4",
    "azure-cli-telemetry": "1.0.4",
    "extensions": {
      "costmanagement": "0.1.1",
      "databricks": "0.3.0"
    }
  }

cost management

Add @jiasli who is the owner of Authentication

(InvalidAuthenticationTokenAudience) The access token has been obtained for wrong audience or resource 'https://management.azure.com'. It should exactly match with one of the allowed audiences 'https://management.core.usgovcloudapi.net/','https://management.core.usgovcloudapi.net','https://management.usgovcloudapi.net/','https://management.usgovcloudapi.net'.

The error indicates the ARM's AAD resource ID of AzureUSGovernment is not configured correctly. Please make sure the cloud registration command az cloud register is called with correct --endpoint-active-directory-resource-id argument.

Please make sure the cloud registration command az cloud register is called with correct --endpoint-active-directory-resource-id argument.

With azure-cli==2.8.0 I didn't need such a step.   How would I know what the correct endpoint-active-directory-resource-id is?

You may refer to the document of your cloud (GovCloud) for the correct --endpoint-active-directory-resource-id.
--endpoint-active-directory-resource-id is not mandatory. az cloud register can do auto-detection using --endpoint-resource-manager. It is very likely you manually changed --endpoint-active-directory-resource-id to public ARM resource ID https://management.azure.com/.

@jaisil
I don't think I explicitly changed anything.   We don't have a public cloud account at all; and with azure-cli=2.8.0 it works fine.

Could you share the content of ~/.azure/clouds.config? Any update to the build-in AzureUSGovernment will be saved here.


Using tray when Settings opened freezes Settings window

When I open Settings and then click Check for updates in tray while Settings window is still opened, it does not open the update dialog and the Settings window freezes (while it seems to be responding to the system ("Not responfing" is not shown), just can´t click anything.)
The Exit button in the tray works though.

Because to Settings window is topmost. I can fix that.


Update 05_Translation_Process.md

Typos. Rewording.

Thanks! #deathtozeds

I'm Canadian so have to put extra effort into kicking the z-habit ;)


Improve the naming of Menu widgets.

Now that the new DropDownMenu widget landet, I am a bit surprised by its name choice. It seems to be inspired by the old DropDownButton widget, but it does not really make sense in my mind.
Now we have this:

Widget
Description

PopupMenuButton
Menu that is triggered by a Widget or Icon

DropDownMenu
Menu that is triggered by an input field

What I find confusing is that Popup bs DropDown ... Is both kinda the same. But then why does DropDown mean textfield as trigger?
Use case
Confusing naming of widgets is a problem for new developers. So having more obvious names that align with the spec is good.
Proposal
In general I think the "popup" is a word that does not appear in the material spec. So why not just remove it?
And then align the 2 widgets to each other: (This would be breaking, but could be done by just introducing new widgets):

Widget
Description

MenuButton
Menu that is triggered by a Widget or Icon

MenuTextField
Menu that is triggered by an input field

MenuTextField.autocomplete
Menu that is triggered by an input field and enables text input by keyboard

Appreciate the suggestions and agree that they're sensible and consistent. We did struggle to find an appropriate name for what had been called "ComboBox". Eventually we settled on DropdownMenu because that's what the Material Design team thought it should be called and because it's short. Naming is definitely hard, more so when you're adding a name to an ecosystem of names that's been evolving for 5+ years.

@HansMuller do we have ideas of moving the functionality that we need from PopupMenuButton to DropDownMenu. That way we could have a single widget for this sort of thing, and the particularities (how it's opened, whether it can be filtered, searched, etc.) are simply decided by parameters.


String should gracefully handle regexp: options that Randexp can not

A String attribute with a regexp option defined as /\w+(,\w+)*/ breaks example generation.
Attributor::String.example(options:{regexp: regex})
# => RuntimeError:
  Sorry, "(...)*" is too vague, try setting a range: "(...){0, 3}"

closed by #122


Fix current value of output streams in assumptions

revert change that made imported node outputs not depend on any inputs (each output stream now depends on every input stream)
conservatively check a contract import for not depending on current value of output stream (could relax this restriction by adding contract node summaries)
add tests

Shouldn't ContractOutputContainsContractArguments be removed since ContractDependencyOnCurrentOutput supersedes it and is more general?


[Feature Request] Point local run outputs to flow folder

Is your feature request related to a problem? Please describe.
At the moment, when running flows locally, the outputs are saved using Path().home() which ends up putting the outputs in a hard to access place. Whilst they can be found thanks to the outputs in std out, they are hard to recover later on which hinders the local experience for inspecting results.
Describe the solution you'd like
Always save the outputs int the <flow_directory>/.promptflow like other artifacts that appear there. Thus, they are always easily recoverable.
Describe alternatives you've considered
Make it a parameter that you can pass it to the flow to save logs wherever you want them.
Additional context
I create this PR (https://github.com/microsoft/promptflow/pull/506) but it has been ignored without any feedback, so maybe the process should start with an issue.

Hi @bepuca , thanks for your feedback, and your PR! We had a discussion on this, and we will support this as the suggested parameter way, so that you can specify the output path per run.
Let's use this issue to track.

BTW, I noticed you mentioned in your PR that you have run into many issues running the tests. Could you please summarize them and open another issue on that? We do hope the develop experience could be smooth, so any feedback on that is appreciated!

Hi @bepuca , sorry for the long time waiting, the related PR (#1212 ) has just merged, and it is expected to be shipped in the 1.1.0 release, next week. Please let me know if you have interest to try it before that!


Delete old version of Microsoft.Private.Intellisense in source-build-reference-packages

Can't open issues in dotnet/source-build-reference-packages, so I'm opening it here and assigning it to myself.
I have this PR that manually adds the latest Microsoft.Private.Intellisense version as text to that repo: https://github.com/dotnet/source-build-reference-packages/pull/774
In the comments I was given the suggestion to delete the older version of the package. I can't do it in the same PR because there are other repos that have not updated to the latest package version. I first need to ensure no one is consuming it and then I can safely delete the old version files.
Since this work should be done before we ship .NET 8, I am using that milestone.
cc @ViktorHofer @mthalman @MichaelSimons

I can't do it in the same PR because there are other repos that have not updated to the latest package version.

What other repos? The only ones I see are winforms and wpf, neither of which participate in source-build since it's Linux-only. Since they don't participate in source-build, they don't consume the SBRP package.

What other repos? The only ones I see are winforms and wpf

Yes, those repos. OK, so runtime is the only one with the problem. I'll delete the old code then.

It appears this was addressed with https://github.com/dotnet/source-build-reference-packages/pull/774.  Is there any reason to keep this issue open?


update readme (todo: cfg)

This updates the Readme to contain the new code.
It also changes some meta in the code (but this PR does not modfy the compiled code) I don't like that revert is a label, revert() is a macro, and, well, revert is also an opcode. So this PR disambiguates them

What do you think of these names?

I like it when labels are clearly labels, not opcodes or macros. So %macro do_revert() is pretty clear,  but, push1 throw is not obvious to me.  Why not push1 lbl_throw, so it's apparent that we're pushing a jump destination?


Support for YAML values in "valuesFrom" resource when using "targetPath"

Current solution
Currently when setting spec.valuesFrom.[n].targetPath, the value from ConfigMap/Secret referred is treated as a JSON or string.
This is documented here with the information  "targetPath supports the same formatting as you would supply as an argument to the helm binary using --set [path]=[value]".
Proposed feature
Make possible to use spec.valuesFrom.[n].targetPath to add root field(s) to the YAML values passed with valuesFrom.
Example
Helm Release
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: myapp
  namespace: apps
spec:
  interval: 5m
  releaseName: myapp
  chart:
    spec:
      chart: appchart-with-subchart
      sourceRef:
        kind: HelmRepository
        name: my-charts-repo
  valuesFrom:
    - kind: ConfigMap
      name: config-values
      targetPath: global # <-- targetPath set to pass values to subchart

Values ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
  name: config-values
  namespace: apps
data:
  values.yaml: |
    users:
      user1:
        alias: u1
      users2:
        alias: u2

Result values supplied to the HelmRelease
global:
  users:
    user1:
      alias: u1
    users2:
      alias: u2

Background
Current solution has limitations which is problematic in cases when using subcharts.
We keep some configuration shared between applications in ConfigMaps and apply it with valuesFrom functionality.
However, some Helm charts have subcharts which would also like to use these values. To supply these values to subchart we need them to be prefixed with subchart name or "global". To achieve that we need to duplicate all the values to have "global" prefix in YAML.
With the proposed feature, we could set targetPath to "global" or subchart name and pass these values easily.

Hi. Was there any analisys and/or decision on this request? We would also love being able to use more complete merge capabilities! Thanks


chore(CPlusPlus): add maximal square on dynamic programming

PR Checklist:

[x ] My submission is formatted according to the guidelines in the contributing guide
[x ] My addition is on refer on the language README.md file
[ x] My addition does not have a spelling problem
[ x] My submission has a proper and user-friendly description of the algorithm
[ x] My submission has the time complexity of the algorithm
[ x] My submission has sample input-output of the program (NOT FOR PYTHON)

What kind of change does this PR introduce? (check at least one)

[ ] Bugfix
[ x] New algorithm
[ ] Optimization in previous algorithms
[ ] Code style update
[ ] Refactor
[ ] Documentation
[ ] Other, please describe:

Briefly describe the changes in this PR

Other information:

Hi @RajAdwaita,
Any update?

Sorry, sir was a bit busy with college work,, will contribute more in the next few days .. greetings sir Sent from Mail for Windows From: Ming TsaiSent: 23 February 2022 18:45To: MakeContributions/DSACc: Adwaita Raj Modak; MentionSubject: Re: [MakeContributions/DSA] chore(CPlusPlus): add maximal square on dynamic programming (PR #671) Hi @RajAdwaita,Any update?—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID<EMAIL_ADDRESS>
Hi @RajAdwaita,
This pull request will be closed, any update please re-open this pull request.


While Pulling the amplify app with pull command I am getting error.

While Pulling the amplify app I am getting error.
command : amplify pull --appId  --envName
`
🛑 Cannot prompt for [An unexpected error has occurred, opt in to send an error report to AWS Amplify with non-sensitive project configuration files. Confirm ] in a non-interactive shell

Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
`

AWS Amplify Console repository

Which Category is your question related to? amplify
Amplify CLI Version
10.2.1 version
What AWS Services are you utilizing?
API and DynamoDB
Error on amplify CLI
🛑 Cannot prompt for [An unexpected error has occurred, opt in to send an error report to AWS Amplify with non-sensitive project configuration files. Confirm ] in a non-interactive shell
Resolution: Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'
Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

Hey @ShubhamVerma5588 :wave: thanks for raising this! Would you mind porting this over to our bug template? This will help gather additional context around the issue you are experiencing.
Additionally, it was noticed that Amplify CLI 10.2.1 contained an issue and was reverted to 10.0.0


Any way to set tooltip's container?

Acording to nv.d3.js tooltip's positions based on its container and utilize clientX and clientY, and directive set container to itself. Any way to changes this behaviour? Because my tooltips have wrong position when I enable useInteractiveGuideline

There is an option chartContainer for tooltip. According to the docs: it's
Parent dom element of the SVG that holds the chart. This will make the tooltip dom be created inside this container instead of on the document body.
tooltip: {
  chartContainer: document.body //default
}

But as I found in the source, interactiveLayer.tooltip.chartContainer uses parentNode container and couldn't be changed. So take this into account.

Thank you, btw Is there any way to force view of all added points on line chart?

Directive updates the charts automatically, but if you want to manually update, you can use api, check the docs...
$scope.api.refresh(); // completely render the chart
// or
$scope.api.update(); // only update the view with data, default behaviour

Sorry, I havent explained well. I mean i have a linechart and it has points(sircles) on it, they are visible only when u hover over them, but i whant to show them all time

Also about my first question if i put any elemnt to tooltip prop(for example tooltip: {chartContainer: document.body} or tooltip: {chartContainer: document.getElementById('content')}) I get $rootScope:infdig error

As for points, change css styles:
.nv-point {
  fill-opacity: 1!important;
  stroke-opacity: 1!important;
}

As for chartContainer, it's required tag name or query selector like body, div, .some_class, #id
tooltip: {
  chartContainer: '#element_id'
}

Thank you, css trick works like a charm.
But for 'chartContainer' something goes wrong. In nv.d3.js(1.8.2) there as function initTooltip()(line 756). There is a expresion there -
var container = chartContainer ? chartContainer : document.body;
chartContainer is directive container, no matter what selector I pass to tooltip, or if I pass the element I have $rootScope:infdig error.
Here is my options for chart:
{
	chart: {
		type: "lineChart",
		height: 450,
		margin: {
			top: 20,
			right: 20,
			bottom: 40,
			left: 60
		},
		tooltip: {
			chartContainer: "#content"
		},
		defined: function(d) { return d.y; },
		x: (function(d) { return d.x; }),
		y: (function(d) { return d.y; }),
		useInteractiveGuideline: true,
		xAxis: {
			axisLabel: "Package",
			tickFormat: function (d) {
				return d;
			}

		},
		yAxis: {
			axisLabel: "RSSI",
			tickFormat: function(d) {
				return d;
			},
			axisLabelDistance: 0
		}

	}

}

Yes, if we use useInteractiveGuideline: true, the lib uses interactiveLayer.tooltip instead of tooltip. And in this case interactiveLayer.tooltip.chartContainer equals to parentNode or directive container in our case. Unfortunately, we couldn't change this behaviour and I couldn't help. But you can change the source, if needed.
if we use useInteractiveGuideline: false, the lib uses tooltip, and chartContainer option should work fine
http://plnkr.co/edit/fvbTj55GVgCMFvr84ERw?p=preview

Thank you, a bit strange behavior.

chartContainer is deprecated. How do we set a parent container to the tooltip now?


Return to app

On about page we can't go back to the app. Add a link on the name of the app on top bar

wrong repo


Scrolling- visual automation method and DOM method not working

Hi I am trying to scroll using tagui on a page using the Visual automation method and Dom method which you suggested in tagui  page. both are not working. The hover method worked. Wondering why the visual automation and DOm is not working.
Please see the code below:-
import tagui as t
t.init(visual_automation = True)
lpar_url='sample url'
server_names=["svr1","svr2","svr3","svr4","svr5"]
lpar_url_host='https://sampelhost'
currentServer=server_names[0]
t.url(lpar_url)

Enter the Server Name to Filter Box
t.type('//input[@id="menu-filter"]', currentServer)

ClickSearchIcon
t.click('//span[@class="ui-button-icon ui-icon ui-icon-search"]')

5.Click on the server name
click_server_string='//span[text()="'+currentServer+'"]'

Click Regroup Icon
t.click('//a[@title="Regroup"]')

tried different Scrolling methods. Hover works but not visual automation and DOM ones. Not even clicking on the chrome brower window.
Instead of the target window, scrolling happens in jupyter notebook itslef. The windows is not changing active to the application

t.hover(f'(//div[@class="favs favoff far fa-star"])[{2}]')
// vision method
t.vision('click("lpar.png")')
t.wait(5)
t.keyboard('[down][down]')
//dom method
t.dom('window.scrollBy(0,1000)')

Hi @soorejmg the hover() method works by telling Chrome to scroll a given web element into view.
For the visual automation method, you have to first do a step to click on the web browser (for click on some part of that web browser tab using visual automation) and the tab that you want to do the scrolling down. The down keystroke will be applied to the whatever is on the screen at the moment, ie the current active window and tab.
For dom() method, it may be the website that you are testing on does not support this scrolling command. When I run below code, the program will scroll down the google search results.
import rpa as r
r.init()
r.url('https://google.com')
r.type('q', 'rpa for python[enter]')
r.dom('window.scrollBy(0,1000)')
r.wait(1)
r.dom('window.scrollBy(0,1000)')
r.wait(1)
r.dom('window.scrollBy(0,1000)')
r.wait(1)
r.close()


Remove chocolate go install as it already exists

Fixes #
Checklist

[ ] Added unit / integration tests for windows, macOS and Linux?
[ ] Added a changelog entry in CHANGELOG.md?
[ ] Updated the documentation (README.md, docs)?
[ ] Does your change work on Linux, Windows and macOS?

@SimonBaeumer curious if you could take a look.


ESSNTL-4433: Add PR check

ESSNTL-4433: Run IQE tests in the PR check
This can't be tested before https://gitlab.cee.redhat.com/service/app-interface/-/merge_requests/61374 is merged

/retest

@skateman will need to as I don't have access to the repo.

/retest


is HttpBrowser headless browser?

Hi!
Just want to confirm that HttpBrowser is headless browser?
And does it support to capture screen (take screenshot) ?
Thank so much for such a nice framework!

Hi there, thanx for stopping buy!
Yes, HttpBrowser (despite the name) is actually just a non-UI browser, it just handles the content. No rendering and screen capturing. But you can use:

JEditorPane
FlyingSaucer
CSSBox

and more


When the automation fails to run in Around, the cucumber report is not mounted correctly

I have a problem that when we fail to run the automation directly on Around inside hooks.rb when generating the final cucumber report when there is a background and more than one scenario, the subsequent scenarios do not generate the failure information.
In the example to be reproduced we have an infinite loop in the execution and in Around we have a timeout defined for the execution block, when reaching this time each scenario should fail correctly collecting all the error data but it only happens in the first scenario. in the case of this example project, in the main project, the cucumber report doesn't even fail, leaving it as passed but without any scenario information

To Reproduce
Steps to reproduce the behavior:
1 - Clone de Project:
##Project
2- Just run a comand cucumber, the existing tests will be executed and at the end the report will be presented that can be verified with the second scenario without information
Expected behavior
When failing Around with features with backgroud and various scenarios the final report is assembled correctly.
Additional context
The time out is here TImeout

Hi @T00595
From what I can see from the gemfile.lock file, the project to reproduce your issue is using cucumber 3.1.
This version of cucumber is not maintained anymore. Try upgrading it to 7.1. Doing so you may face some difficulties as there are a lot of changes. Try upgrading one major version at a time and looking at the changelog each time: https://github.com/cucumber/cucumber-ruby/blob/main/CHANGELOG.md

Hi @T00595
From what I can see from the gemfile.lock file, the project to reproduce your issue is using cucumber 3.1.
This version of cucumber is not maintained anymore. Try upgrading it to 7.1. Doing so you may face some difficulties as there are a lot of changes. Try upgrading one major version at a time and looking at the changelog each time: https://github.com/cucumber/cucumber-ruby/blob/main/CHANGELOG.md

HI @aurelien-reeves  this is just an example in the main project we use 5.3.0 but the problem is the same as it happens

cucumber 5.3.0 is not maintained either. Latest version of cucumber are 7.1.0, and 8.0.0-rc.1 which is a pre-release.
Also, please note that Around hooks are discouraged. We know there are pain-points using those.
Is there any reason why you do not update cucumber to 7.1.0?
Finally, I suggest to try other hooks to set your timeout. After/Before hooks have a better support.

@aurelien-reeves We are still in the process of updating, so we can close the problem because the tests in the new version worked

@aurelien-reeves Would you have an example of a model for the timeout because I couldn't implement it in Before/After?

@aurelien-reeves Would you have an example of a model for the timeout because I couldn't implement it in Before/After?

😓 indeed that is not that easy 😓
I had cucumber-js in mind, sorry for that

@aurelien-reeves We are still in the process of updating, so we can close the problem because the tests in the new version worked

Great! I'm glad it is working!


Added support for using sever level rule in vulnerability assessment baseline operations

Added support for using sever level rule in vulnerability assessment
baseline operations

@dsgouda - this is the updated PR.
Can you please merge?

@yaakoviyun please do the following checks:

GEnerate the sdk using generate.ps1
Build at least once before submitting the PR, because the build adds the necessary meta data to the SDK

@shahabhijeet - the current code is after msbuild and code generation.
I've rebuild the code and no more changes exists.

@shahabhijeet - ping

@dsgouda , @shahabhijeet - Done.


Plot temporal coverage model names in bold and italics

Is this okay, @ecomodeller ?

Would be great if we could figure out the easy way to get a consistent and sane datetime axis...

Would be great if we could figure out the easy way to get a consistent and sane datetime axis...

totally agree - I tried to search for something reasonable earlier today with no real luck


Add locale support

Feature request

Extension name: [e.g. firestore-stripe-subscriptions, or leave empty if suggesting a new extension]

Is your feature request related to a problem? Please describe.
Not all browser’s locale have real locale.
Describe the solution you'd like
functions exports.createPortalLink exports.createCheckoutSession
add param locale add pass it to stripe sdk
Describe alternatives you've considered
Here is only one alternative fork project and do it self :)
Additional context
@@ -139,7 +139,6 @@ exports.createCheckoutSession = functions.firestore
},
success_url,
cancel_url,

     locale: context.params.locale,
   },
   { idempotencyKey: context.params.id }
 );

@@ -188,7 +187,6 @@ exports.createPortalLink = functions.https.onCall(async (data, context) => {
const session = await stripe.billingPortal.sessions.create({
customer,
return_url,

 locale: context.params.locale,

});

@ jhuleatt Hy it is possible to get feature support.

I've added locale override for checkout session, however the customer portal does not currently allow overriding of the locale. I've discussed with the team and they will consider adding it in the future.

Checkout session working as expected. The customer portal is also very important to our customers.
and deadline is coming up soon... Thank @thorsten-stripe for the help. Our customer

I've added locale override for checkout session, however the customer portal does not currently allow overriding of the locale. I've discussed with the team and they will consider adding it in the future.

Hy @thorsten-stripe  whether there is any news regarding the change of the customer portal config overide locale

Reopening this issue to make sure folks are aware. The customer portal is available in English, French, German, Italian, Dutch, Danish, Spanish, Japanese, Simplified Chinese, but the language is set automatically based on the customer's browser settings.

Allowing to override this programmatically via the locale parameter is on the team's roadmap but I can't yet share a timeline for it, I'm afraid.


[CI] Print nightly evaluation results to GITHUB_STEP_SUMMARY

We would like to to have a nicer summary page on the nightly evaluation results. The summary should include the scores and thresholds of all models in a markdown table.
An example run: https://github.com/sgl-project/sglang/actions/runs/12060420843
Steps

Learn GITHUB_STEP_SUMMARY at https://github.blog/news-insights/product-news/supercharging-github-actions-with-job-summaries/
Print a summary of the nightly eval to GITHUB_STEP_SUMMARY

See also an example https://github.com/sgl-project/sglang/pull/2274

cc @zhyncs

Another item: Add threshold for human-eval similar to the threshold for gsm-8k


How to send response from bot as code or text snippet?

I am developing one bot
I need to send response from bot to user as code snippet of yaml type.
In general send as code snippet is present in Shortcuts in slack
Please provide code for how to send message to user as code snippet of yaml type from bolt-js!

Hey @Mogadampalli-Jayanth,
Sorry I don't think I fully understand what you are asking here. You want to send a code snippet to the user? Why not use chat.postMessage? Your bot can't invocate a shortcut on its own. It needs to be triggered by the user.

Please can you give a sample code or example on how to send code to user as response from chat.postMessage but not as normal text if possible!

Hey @Mogadampalli-Jayanth, once again I am unsure what you are trying to achieve.
If you want the text to look like code, you can use the standard syntax. If you are trying to use the inside of a string
Something like
app.event('app_mention', async ({ event, client }) => {
  try {
    // directly call the api method 'chat.postMessage'
    const result = await client.chat.postMessage({
      channel: event.channel,
      text: 'Look at how the `code` is formatted'
    });
  }
  catch (error) {
    console.error(error);
  }
});```

@Mogadampalli-Jayanth When it comes to having pre tags in a message, as Steve already mentioned, you can use backquotes as with Github.
`single line here`

```multiple lines
here```

When it comes to text snippets (probably, this is the one you want), files.upload API method is the way to go. It's not possible to post a snippet using chat.postMessage.
const { WebClient } = require('@slack/web-api');
const client = new WebClient(process.env.SLACK_BOT_TOKEN);
const channelIds = 'C11111';
const content = `# An employee record
martin:
  name: Martin D'vloper
  job: Developer
  skill: Elite
`;
(async () => {
    const result = await client.files.upload({
        channels: channelIds,
        content: content,
        title: 'sample.yml',
        filetype: 'yaml'
    })
    console.log(result);
})();

You can find the list of supported file types here: https://api.slack.com/types/file#file_types
Hop this is helpful to you!


Add trivy

Test trivy action

@paulomach is this PR relevant today (given that it's from 2023-11)?

I believe it is. The fact that it's old is about us missing it, instead of it not being important.

if so: is there documentation somewhere about:
* what we're trying to accomplish with this

Ensuring the rock is up-to-date for CVE. Nowadays we are just rebuilding it on our need (e.g. outdated snap) and not when some of the content has vulnerability

* who will be responsible for monitoring alerts & how they will do that
  ?

The duty engineer. Trivy alers will be shown on repo's security report

also, would it be possible rebase this PR so that trivy is added to the reusable workflows?

That's not a bad idea, since all rocks would benefit. @zmraul want to venture on that?

Will talk Enrico the next week. AFAIK BigData uses Trivy.... and maybe we should add it to dpw.
P.S. we need to retriger it at least:
https://github.com/canonical/charmed-mysql-rock/actions/runs/6809760169/job/18516809933
The logs for this run have expired and are no longer available.

@paulomach should we also bump mysql in rock? https://github.com/canonical/charmed-mysql-rock/actions/runs/10424799108/job/28874336111

@paulomach should we also bump mysql in rock? https://github.com/canonical/charmed-mysql-rock/actions/runs/10424799108/job/28874336111

yep

Trivy is not willing to fly :-( https://github.com/canonical/charmed-mysql-rock/actions/runs/10425483416/job/28876474051?pr=35

To make trivy work, these are the minimal steps needed:
      - name: Run Trivy vulnerability scanner
        uses: aquasecurity/trivy-action@master
        with:
          image-ref: 'trivy/charmed-mysql:test'
          format: 'sarif'
          output: 'trivy-results.sarif'
          severity: 'MEDIUM,HIGH,CRITICAL'

      - name: Upload Trivy scan results to GitHub Security tab
        uses: github/codeql-action/upload-sarif@v2
        if: always()
        with:
          sarif_file: 'trivy-results.sarif'

Where image-ref points to a locally uploaded image. The way the CI workflows are setup now on the repo are completely different from when I initially opened the PR, so the way we get the image artifact needs to be updated.


Handle deleted beatmapsets appropriately

currently I just delete them and remove any related data (today it was a set from mapper consents). this wouldn't make sense for all references though, such as voting history or submissions/reviews, where we still want to see what map it was, even if it's been deleted on osu.
I think there should be a deleted flag set when the API returns 404 for those cases, but will need to go through every usage of beatmapsets to see where it might make sense to also delete the reference
notes:

beatmaps can set deleted_at to current time
there's at least one map in voting history that was already deleted, so it'll need to be manually added back with deleted set

and nothing should accept a null beatmapset ID like polls do, because they can refer to deleted beatmapset instead.

adding to this that submissions/reviews can probably just be discarded as well, according to captains. a map only needs to be soft deleted when it was involved in voting.
to prevent accidental deletion e.g. when there is a problem on osu!'s end, maybe there could be some management panel to permanently delete info associated with a deleted map.

all done except need to check if beatmapset ID can be null anywhere.


Nwkaddr update

Some enddevices frequently change there parent (Philips). In some of this cases, they get a new nwkAddr assigned.
Seems this change was not handled yet, so shepherd still used the old address, resulting in device not being reachable anymore (until adapter restart).
Tested this change since some days, my philips motion sensor (sml001) works far better now.

Hmm, interesting observation, thanks.


Support Java 15 (JEP 339) algorithms for signatures

Java 15 includes JEP 339 which adds signature implementations for Ed25519 and Ed448. The API is a bit awkward due to EdDSA keys being little endian while Java is big endian, so this will require a little more glue code than the equivalent in #8.

Included in main.


Add gomplate to arkade get

Description

Motivation and Context

[x] I have raised an issue to propose this change, which has been given a label of design/approved by a maintainer (required) - https://github.com/alexellis/arkade/issues/706

How Has This Been Tested?

Tested using go test ./... command and all the tests (including the new one) are passing
Are you a GitHub Sponsor yet (Yes/No?)

[ ] Yes
[x] No

Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Documentation

[x] I have updated the list of tools in README.md if (required) with ./arkade get -o markdown
[ ] I have updated the list of apps in README.md if (required) with ./arkade install --help

Checklist:

[x] My code follows the code style of this project.
[x] My change requires a change to the documentation.
[x] I have updated the documentation accordingly.
[x] I've read the CONTRIBUTION guide
[x] I have signed-off my commits with git commit -s
[x] I have added tests to cover my changes.
[x] All new and existing tests passed.

[x] I have tested this on arm, or have added code to prevent deployment - there are binaries for arm and they are supported

Thanks for the contribution! Look at my comment below, can you fix that and do a rebase please?

Sure, will apply the required change. Just a quick question, you required a rebase not a merge?

Thanks for the contribution! Look at my comment below, can you fix that and do a rebase please?

Sure, will apply the required change. Just a quick question, you required a rebase not a merge?

Yes we mostly use rebase in a case like yours, we like to keep the one commit/PR rule, unless you have a really good reason for it.

@Shikachuu OK, I have applied the requested changes and did a rebase

If you're happy @Shikachuu then I'm happy. We just need a rebase due to merging another tool just now.

We just need a rebase due to merging another tool just now.

Done

CI approved to run, merging would happen after that.


Specifying bool and nonzero

Consider the following case
cdef class Foo(object):
    def __bool__(self):
        return True
    def __nonzero__(self):
        return self.__bool__()

This causes a RecursionError when calling bool(Foo())
I know the work around is specifying only __bool__ but it's still a bug IMHO

Cython knows both what Python mode you're writing your code in and which version you're compiling for, so it can perform the correct name substitutions. Just use __bool__, it'll show up as the correct method name in both 2 and 3. It should probably be an error to specify both.

PR welcome that issues a warning when users define both that suggests defining only __bool__().

Actually, it could warn whenever someone defines nonzero() in an extension type

+1


improve typehint coverage in utils.py

Aims to remove any strict MyPy errors from the utils.py file, relating to ticket #251

/packit copr-build

recheck

Please, rebase so we can merge that.

/packit copr-build


AndroidX Support

When library is going to migrate to AndroidX?

@kunaldhande
It will come soon.
Please wait for a while.


Is there a support for displaying special characters?

In my code it does not display the "₱" sign correctly it just shows "±" even for other special characters such as "Ω"(Omega), " α"(Alpha)
code is:
let html =`
  <html>
    <body>
      <div>
        ₱  Ω  α
      </div>
    </body>
  </html>
`

output:
± ⓒ ±
Even when I use a HTML code like α still it will render as ±

thanks! I'll get back here if I figure it out.

Registering the font that supports these kinds of special characters needed to be imported, so that react PDF will render it correctly.
ref: React PDF: Fonts


Predicate check array type

What type of PR is this：

[x] bug
[ ] feature
[ ] enhancement
[ ] others

Which issues of this PR fixes ：

Fixes #4305
Problem Summary(Required) ：

Array type couldn't as Predicate

Need check json type? @mofeiatwork

run starrocks_fe_unittest

JSON type support predicate. These information related with specific type should be maintained at Type.java, which could be more clearly.

[FE PR Coverage check]
:heart_eyes: pass : 5 / 5 (100.00%)
file detail

path
covered line
new line
coverage

:large_blue_circle:
com/starrocks/analysis/Predicate.java
2
2
100.00%

:large_blue_circle:
com/starrocks/catalog/Type.java
1
1
100.00%

:large_blue_circle:
com/starrocks/sql/analyzer/ExpressionAnalyzer.java
2
2
100.00%


Branch 192193752

Manually merged following files, PTAL
tensorflow/BUILD
tensorflow/compiler/tests/BUILD
tensorflow/compiler/xla/service/hlo_evaluator.cc
tensorflow/contrib/autograph/operators/control_flow.py
tensorflow/contrib/autograph/pyct/inspect_utils_test.py
tensorflow/core/grappler/costs/op_level_cost_estimator.cc
tensorflow/core/grappler/costs/op_level_cost_estimator.h
tensorflow/core/grappler/optimizers/arithmetic_optimizer.cc
tensorflow/core/kernels/cudnn_rnn_ops.cc
tensorflow/python/keras/_impl/keras/applications/resnet50.py
tensorflow/stream_executor/cuda/cuda_dnn.cc

I think the py3 builds are already failing and broken by internal changes

Somehow the cla is not replying

hmm I see, let's wait for a fix before we push then? We don't want to break the github master. clabot seems to do that when there are too many commits in a PR.

Understood. The build corp has pushed a change to disabled the test

created https://github.com/tensorflow/tensorflow/pull/18366, which includes few more changes. After doing several merge, I am doing efficiently :)


Not all challenges seem to show up in Windows

The nodeschool.io screenshot looks like this:

But mine looks like this:

Is there anything wrong? I'm on Win7 x64<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>

Hey @CamiloMM. The screenshot is overly ambitious :wink: The problems you see are indeed the ones currently implemented, regardless of platform. A recent PR, dealing with FR L10n, also updates the screenshot to only display currently-implemented problems.
@maxogden you probably want to close this one.


Update systemd_unit.rb to make Cookstyle compliant

Description
Fixes Style/BracesAroundHashParameters: Redundant curly braces around a hash parameter. as recent versions of Cookstyle now complain about this code example.
Related Issue
No related issue
Types of changes

[x] Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

[X] I have read the CONTRIBUTING document.
[X] I have run the pre-merge tests locally and they pass.
[X] I have updated the documentation accordingly.
[X] I have added tests to cover my changes.
[X] All new and existing tests passed.
[X] All commits have been signed-off for the Developer Certificate of Origin.

Thanks @cpressland

Thanks @cpressland


Fix build.sh to not rely on default Makefile target

Before this, calling make would get the "check-licenses" target
instead of the "build" target it was written to use.
The recent changes for linting and license headers added new Makefile targets to the top, which accidentally made them the default Makefile target. I used "all" here as the default target because that is an old custom for *nix-y projects that typically were built and installed via ./configure && make && make install -- at least in my experience.

:green_heart: Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS

Expand to view the summary

Build stats

Start Time: 2022-03-29T21:16:54.916+0000

Duration: 8 min 47 sec

Test stats :test_tube:

Test
Results

Failed
0

Passed
240

Skipped
6

Total
246

:robot: GitHub comments
To re-run your PR in the CI, just comment with:

/test : Re-trigger the build.

run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)


Add debugging class

In the recent article, I published: https://medium.freecodecamp.org/learn-this-one-weird-trick-to-debug-css-88529aa5a6a3 I talked about a global CSS debugger. Another method of using this, however, is scoped to an element and its children. E.g.
.debug *:not(path):not(g) {
	color:                    hsla(210, 100%, 100%, 0.9) !important;
	background:               hsla(210, 100%,  50%, 0.5) !important;
	outline:    solid 0.25rem hsla(210, 100%, 100%, 0.5) !important;

	box-shadow: none !important;
}

The difference here is that now whatever is classed as .debug so will it and its children expose the debugger, which could also be customized using CSS variables (such as color).

Pro-tip: do <html class="debug"> then the whole website debugged without a bookmark!


feat: idtoken user credential

Fixes #468
Test on method UserCredential.idTokenWithAudience(...) hasn't been done (I don't know how to do it useful)
Required https://github.com/googleapis/google-http-java-client/pull/1100 to work properly (UrlEncodedContent need to be updated to be compliant with the API call performed)

Any updates on this? Any helps/comments that I can bring to you?

Let me see if I can pass this on to the auth PM who might know more about this.

@silvolu Can you look into this or assign someone to do it? Thanks.

Working on Bazel, I got bit by this one when trying to call a bazel cache running behing Cloud Run. Talk about timing!

The issue #472 has been reviewed and closed (no secret to keep secret). So we can go ahead!

Hi,
Apologies for the delay in replying here. @guillaumeblaquiere thanks for the contribution and @elharo thanks for spending time reviewing this. We need to rewrite this change, as there are some core things that are not correct:

We should not hardcode client id and secret anyway, those should be read from the credentials object itself
id tokens don't have scopes, as they are use for authentication, not authorization, and scopes are for authorization
the code that is acquiring the token is not correct.

I'll do it personally or find someone that can take care of it asap. We'll add both of you to the PR review so you can see what I mean.

Hello
@silvolu, yes, you can generate an id_token with the client_id and the client_secret contained in the user credential (obtained with a gcloud auth login, or a gcloud auth application-default login)
BUT you can't use this id_token to be authorized on private Cloud Functions, private Cloud Run or on IAP. Only these hardcoded "Google" client_id and the client_secret allow you to generate a valid id_token, as the gcloud auth print-identity-token do.
My initial target is to allow the OAuth client library to do this because today we need a service account key file, on the developer machine, to be able to generate a correct id_token accepted by the serverless product on GCP. And a service account key file is a nightmare in term of security (with internal and external developer, because the file are sent by mail, or committed externally,... I wrote an article on this)
Therefore, IMO don't waste your time to implement the id_token generation on user credential, it's useless! (at least for me!)

Anyway, you are right about the scope, we can remove them. @elharo sorry for all the discussions around this useless addition!
I sent an update because I believe in the usefulness of this feature!
Finally, I don't understand what is not correct in the token acquisition! I copied the logic of the ServiceAccountCredentials.idTokenWithAudience() method. How I can do this differently?

For what it's worth, the client id and secrets are hardcoded in google-cloud-sdk itself and the official gsutil command.

just a couple comments...
Unlike serviceaccount based creds, you can't set the audience value for a usercredential.  Its statically bound to the client_id that was used in the login flow.  In the case of gcloud cli, its the aud:<PHONE_NUMBER>9.apps.googleusercontent.com and that client id is on a special allowlist for CloudRun to faciliate development.   If you source your own client_id in the aud: field, that's won't work (cloud run expects the aud value to be the url of the service plus any id token thats whitelisted like that).

If you want to acquire an id_token intended for cloud run where the root-source credential is a user's account, you can use impersonation and then idtokencredentials.
the gcloud equivalent of that is
$ gcloud auth print-identity-token --audiences=https://foo.bar --impersonate-service-account<EMAIL_ADDRESS>
will give an id token for the service account w/o holding a key locally
{
  "aud": "https://foo.bar",
  "azp": "102101550834200708568",
  "exp":<PHONE_NUMBER>,
  "iat":<PHONE_NUMBER>,
  "iss": "https://accounts.google.com",
  "sub": "102101550834200708568"
}

if you want the equivalent in java, its
https://googleapis.dev/java/google-auth-library/latest/com/google/auth/oauth2/IdTokenCredentials.html
 // for ImpersonatedCredentials
 ImpersonatedCredentials imCreds = ImpersonatedCredentials.create(saCreds,
<EMAIL_ADDRESS>null,
     Arrays.asList("https://www.googleapis.com/auth/cloud-platform"), 300);
 IdTokenCredentials tokenCredential = IdTokenCredentials.newBuilder()
     .setIdTokenProvider(imCreds)
     .setTargetAudience(targetAudience)
     .setOptions(Arrays.asList(ImpersonatedCredentials.INCLUDE_EMAIL))
     .build();

(replace saCreds with a userCredential or googlecredential where the underlying type is a user)

@salrashid123, Yes I know the impersonation. But, it's not a solution in my ultimate dream!
In fact, I would like to use the same code on my local environment, with my user credential, and on Google Cloud environment, with service account credentials provided by metadata servers. I mean, based on ADC (Application Default Credential)
I can achieve this when I have to use all the Google APIs, because they only require an access_token, and it's perfect. But, for Cloud Run, Cloud Functions and App Engine (behind IAP), I can't. And it's a problem for the development of services that consume existing and protected deployments.

Yes, I can use impersonation in my code, but I have to create a condition in my code, and I can't run the same code, with the same level of confidence, locally and in the cloud
Yes, I can use a service account key file locally, but there is a lot of risk (and my company have had security issues because of them) and we want to avoid them for the developers.

So, this PR is for solving these issues and finally make the development easier, safer and more secure.

@salrashid123 My understanding was that the point of this PR was to avoid having custom code for situations where the default application credentials are not service account based. It's in everyone's interest to keep the security code as minimal as possible to reduce the attack surface.

ADC based credentials uses a different client_id/secret pair than gcloud (i.,e gclodu auth login uses<PHONE_NUMBER>9.apps.googleusercontent.com,  gcloud auth application-default login uses<PHONE_NUMBER>50-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com   an id token derived from the former (gcloud auth print-identity-token will work against cloud run and GCF (i'd very much doubt it'll work with IAP..)
an id token derived from ADC usercreds  isn't permissiable into cloud run so...if/until that happens, this PR woudn't really help (since the aud field is immutable)...
interms of why the tokenflow isn't working in anycase, change https://github.com/googleapis/google-auth-library-java/blob/9d1b142ef34133198c7973d1de9c8105cd1c32d6/oauth2_http/java/com/google/auth/oauth2/UserCredentials.java#L72
to
  "client_id": "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com",
  "client_secret": "d-FL95Q19q7MQmFpd7hHD0Ty",

...that shoudl return an id_token
eg
# use refresh_token from
gcloud auth application-default login
cat ~/.config/gcloud/application_default_credentials.json

export REFRESH_TOKEN=...
export CLOUDSDK_CLIENT_ID=764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com
export CLOUDSDK_CLIENT_NOTSOSECRET=d-FL95Q19q7MQmFpd7hHD0Ty

curl -s -X POST -H "Content-type:application/x-www-form-urlencoded" "https://oauth2.googleapis.com/token?client_id=$CLOUDSDK_CLIENT_ID&client_secret=$CLOUDSDK_CLIENT_NOTSOSECRET&refresh_token=$REFRESH_TOKEN&grant_type=refresh_token"

then use that id token agains run as the Authorization: Bearer <token> ...<< this shoud't work

btw, the client_id and secret when used in installed application mode are not considered secrets..

@salrashid123, the id_token generated with the user credential, user client_id and user client_secret generate an id_token, but it is not accepted by Cloud Run and Cloud Function. I guess it's because the audience is not correct.
That's why it's important to use the client_id and the client_id allowlisted on GFE to allow this. Even if the audience isn't correct, the special Google sauce makes the call accepted.

correct,  Clodu Run and GCF has a special setting to allow those gcloud cli based id_tokens...it wont' work on other services like IAP at all.    Run and GCF doesn't have the same allow for ADC based creds (i do not know why ADC isn't on that list but i suspect gcloud cli was done not for operational use but to just quickly directly test from cli)

digression:
anyway, we spoke about a proposal to enhance ADC such that it will delegate to some arbitrary external provider for credentials.   If its acceptabl in this scenario for you to set the standared env var GOOGLE_APPLICATION_CREDENTIALS and then do local development and still use the same code, i can officially file the FR on github (though it may take quite sometime to work through)
it'd be something like this
create a config file that defines what to execute to get credentials
$ cat /path/to/external_cred.json
{
   "type": "external_command",
   "command": ["/path/to/some/cred_binary", "get_id_token"]
}

then you set the standard env var and run your code as normal with unifor GoogleCredentials
$ GOOGLE_APPLICATION_CREDENTIALS=/path/to/external_cred.json
$ ./myapplication

in your case, the command would be something like
 "command": ["gcloud", "auth", "print-identity-token"]

the intent is for this to populate a GoogleCredential automatically with the output of the binary (eg, id_token)...from there you need to use that credential to make an httpcall
here's variation of that idea but baked directly into an unsupported library used for accesstokens.

@salrashid123, you  repo is smart and can solve current issue, and the future ones (Google Cloud is opening the authentication mechanism to third party). I don't how it can be integrated into the auth libraries and how developer friendly it could be but it's a good solution!

The complexity associated with all these token types and environments where they are and aren't usable is a perfect example of why a simple .getApplicationDefault() call should work across the board (local, deployed in managed GCP instances etc).
This is way too much low-level details for every GCP developer to grasp. The various authentication options (JWT, access token, OIDC, OAuth2...) are already incredibly confusing and the direction should be towards simplifying and tightening up controls instead of encouraging people to hook into low-level token handling APIs and possibly shoot themselves in the foot.

Can you provide me a status on this PR? If it is not accepted, I have another idea.

help: I'm not a super star in Git and I don't know why my commit comments are rejected.

Hi @guillaumeblaquiere ,
I have some luck using user account credentials to obtain an id_token (without using google cloud sdk or it's client_id/secret) to authenticate against IAP. My use case is that I need to develop a client (CLI) for interacting with a company-internal APIs hosted on App engine + IAP or Cloud Run and I need to support user account authentication.
The following (in python) is working for App Engine behind IAP but not for Cloud Run (I haven't tried Cloud Function):

Generate a pair of Oauth2.0 client_id and client_secret (for Desktop app) and embed them in the client source code.

Use google_auth_oauthlib.flow.InstalledAppFlow to run through an Oauth2 (openid connect) flow, where user is redirected to browser and authenticate to google.

from google_auth_oauthlib.flow import InstalledAppFlow

flow = InstalledAppFlow.from_client_config({
                    "installed": {
                        "client_id": <client_id from step 1>,
                        "client_secret": <client_secret from step 1>,
                        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
                        "token_uri": "https://accounts.google.com/o/oauth2/token",
                    }
                },
                scopes = ['https://www.googleapis.com/auth/userinfo.email', 'openid'],
                redirect_uri='urn:ietf:wg:oauth:2.0:oob'
            )
cred = flow.run_local_server(port=0)

step2 returns cred which contains a refresh_token. Use it to construct a new request, set the "audience" field in the request payload to the client_id of the IAP-App-Engine-app (auto generated by GCP when IAP is enabled for app engine, the second oauth client in the picture in step 1), and send this request to the token endpoint (https://accounts.google.com/o/oauth2/token). The response contains an id_token field with audience claim appropriately set. This id_token can be used as Bearer token to authenticate to IAP.

from google.oauth2._client import _token_endpoint_request
from google.auth.transport.requests import Request

response_data = _token_endpoint_request(Request(), "https://accounts.google.com/o/oauth2/token", {
            "grant_type": "refresh_token",
            "client_id": cred.client_id,
            "client_secret": cred.client_secret,
            "refresh_token": cred.refresh_token,
            "audience": <client_id of the IAP-App-Engine-app, in my case, "9726...-me51...">
        })
response_data['id_token']

However, when I use the same steps for authenticating to Cloud Run, I get error in the last step when I set audience to cloud run url:
RefreshError: ('invalid_audience: Audience is not a valid client ID.', '{\n  "error": "invalid_audience",\n  "error_description": "Audience is not a valid client ID."\n}')

Finally, here's what I'm trying to say:

If google Oauth server accepts cloud run urls as valid client_id, then we would be able to use user credential to authenticate to Cloud Run.

Or another alternative solution could be that if Cloud Run could be associated with a client_id rather than a url, then we would be able to use the above flow for both Cloud Run and App Engine behind IAP. As I understand, cloud run does support IAP via HTTPs Load Balancer, but that's a lot of additional work..

This solution only works for IAP and requires user interaction, which suits my use case because the tool I'm developing is for interactive use cases. Do hope Cloud Run team can support user account auth in the future (As of now, I think using client_id/secret of the googlecloudsdk is more of an irregularity as @salrashid123 pointed out, the client_id of googlecloudsk is specifically added to the whitelist

yeah, its kinda irregular what cloud run, gcf did (i.,e allowlisted this specific client_id intended for gcloud).
the flow you have would allow you to take a further step and echange for an audience of your choosing.   if you want to do that, its a the flow you described above here:  https://github.com/salrashid123/oauth2oidc   << note, thats unsupported by google!
re: using the token for cloud run...
well, cloud run and gcf accept the aud: value that matches its URL (+ the specific exception fo gcloud cli)  In your case, if you've managed to set arbitrary audience using your own flow and clientid, set the audience to the url of the cloud run app (and not use gcloud's clientid)

Hi @salrashid123,
re your comments:

the flow you have would allow you to take a further step and exchange for an audience of your choosing

Did you manage to set arbitrary audience value with user account?
With service account, auth-library supports setting audience to cloud run url.
But if I use user account, I could only exchange for an audience that is a valid client_id within the same GCP project (as you also pointed out in your oauth2oidc repo), but not any audience of my choosing. If I set audience to my cloud run url, I get RefreshError: ('invalid_audience: Audience is not a valid client ID.'. If I set audience to googlecloudsdk client_id (to conform to the allowlist), i.e.<PHONE_NUMBER>9.apps.googleusercontent.com, I get RefreshError: ('invalid_audience: The audience client and the client need to be in the same project.'

aribtrary isn't the right term i shoudve picked  there.  for the user-creds, you can exchange it using the client flow for just audiences that'd share the same project (i.,e use usercreds for an idtoken that you can use on IAP within the same project).  Meaning its a very specific capability here of limited applications.
there isn't a way for user creds + arbitrary-arbitrary aud: values  like you can w/ svc account

What's the final decision on this? I'm still unclear what's the best practice from security standpoint when running tests in services that invoke both GCP APIs and Cloud Run services...
Options that I see right now:

Give all developers a common service account from which keys are issued - not ideal because it's hard to keep track of which key belongs to what user. This also introduces additional off-boarding procedures where JSON keys need to be revoked in addition to GSuite accounts being suspended.
Create test service accounts for each service and use those as user identities when executing tests. This is not a bad option, but now these service account JSON files need to be included in source code which introduces risks with regards to these accounts leaking out.

What does Google suggest here? I still claim that the ideal option would be:

Users run tests locally with their GSuite accounts, as configured via gcloud application-default login
In CI/CD we utilize service account JSON files that are stored in encrypted storage and permissioned so that developers can't access them

Until something like this PR is implemented, I don't see how that could work.

Hey folks, gentle ping :)

as above, the clientId,secret isnt' a problem..but the use of these idtokens is for a unique usecase that cloud run happens to support: it alllows a user's idtokens derived from gcloud for access regardless of the audience value.  Its not a standard thing that'd be supported elsewhere (in a way, its misusing the idtoken thats for user-auth 3LO flow).  IMO, i do not think the pr should be committed (even if it makes local testing of a bit easier)

@guillaumeblaquiere IdToken support has been added to UserCredentials with another PR: https://github.com/googleapis/google-auth-library-java/pull/650
If some scenario is not yet addressed, please open a separate issue.

@TimurSadykov I don't understand the PR #650 . As described here, the idToken is not compliant with Cloud Run (and I'm sure with Cloud Functions and also with IAP).
You have now an id_token, but you can't use it. Great feature!!

the last bit isn't really helpful and i'd say neither that specific error message.   I'm unaware of what condition would give rise to not getting an id_token back on refresh for a user creds (i think it should always be there).
that pr provides the id_token derived from ADC which looks like cloud run has an exemption for  too now (originally i thought it was just for gcloud cli's client_id)
the id_token likely also  works with gcf but not IAP which doen'st entertain any one-off exemptions like that

gcloud auth login --update-adc  sets gcloud cli's clientid

.config/gcloud/application_default_credentials.json
{
  "client_id": "32555940559.apps.googleusercontent.com",

gcloud auth application-default login set ADC's client_id
.config/gcloud/application_default_credentials.json
{
  "client_id": "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com",

both of which you can use to call cloud run
package com.test;

import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.IdTokenCredentials;
import com.google.auth.oauth2.IdTokenProvider;
import com.google.auth.oauth2.UserCredentials;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.HttpTransport;
import com.google.auth.http.HttpCredentialsAdapter;
import com.google.api.client.http.javanet.NetHttpTransport;

import java.io.FileInputStream;
import java.io.File;
public class Main {
	public static void main(String[] args) {
		Main tc = new Main();
	}

	public Main() {
		try
		{
			   //FileInputStream inputStream = new FileInputStream(new File("/path/to/svc_account.json"));
			   //ServiceAccountCredentials credentials = ServiceAccountCredentials.fromStream(inputStream);

			   FileInputStream userStream = new FileInputStream(new File("/home/srashid/.config/gcloud/application_default_credentials.json"));
			   UserCredentials credentials = UserCredentials.fromStream(userStream);

			   String audience_cloud_run_url = "https://myapp-6w42z6vi3q-uc.a.run.app/";

			   // setTargetAudience value is ignored with UserCredentials.
			   // for ADC based user creds, its always "aud": "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com",
			   IdTokenCredentials tokenCredential =  IdTokenCredentials.newBuilder().setIdTokenProvider(credentials).setTargetAudience(audience_cloud_run_url).build();
			   tokenCredential.refresh();
			   System.out.println("Cred: " + tokenCredential.getAccessToken());

			   GenericUrl genericUrl = new GenericUrl(audience_cloud_run_url);
			   HttpCredentialsAdapter adapter = new HttpCredentialsAdapter(tokenCredential);
			   HttpTransport transport = new NetHttpTransport();
			   HttpRequest request = transport.createRequestFactory(adapter).buildGetRequest(genericUrl);
			   request.setThrowExceptionOnExecuteError(false);
			   HttpResponse response = request.execute();
			   String r = response.parseAsString();
			   System.out.println(r);
		}
		catch (Exception ex) {
			System.out.println("Error:  " + ex);
		}
	}

}

@salrashid123 I'm gonna fix the message removing the last bit, we didn't know the ADC Client ID was also accepted for Run/GCF auth. The only reason devs would see that error message is if they create a representation of an ADC user credentials without requiring one of the scopes that would add an id token (openid or userinfo.profile), and we thought that instead of explaining the theory, the best thing we could do was telling them potential solutions. If you have suggestions on how to reformulate it, let me know :)
@guillaumeblaquiere the user credentials in this library are meant to generate credentials from user credentials acquired from the gcloud CLI, using the application default credentials flow. As @salrashid123 explained, to use with Run/GCF you'd need to run "gcloud auth login --update-adc" (or now we know "gcloud auth application-default login" as well :) ), and then just acquire default credentials from the client library.
For IAP, you would need to use "gcloud auth application-default login --client-id-file <path/to/client/id/file>, where the latter is an OAuth2 credential generated in the same project that contains the IAP-secured resource.

Thanks @silvolu and @salrashid123. I will have a try and let you know


fix(husky): stdin is not a tty in git bash

See https://typicode.github.io/husky/#/?id=yarn-on-windows

Isn't this only relevant for Yarn? The code is generated even if the user has selected Npm.
Also what's the purpose of isWindows === true, does it mean that if the user who generated a project used Linux, then nobody who uses Windows will be able to clone and use it? Is it really a good idea to make this implicit?

Fair point, pr is always welcome or I’ll make a fix within this week.

PR sent. I was considering whether it'd be better to keep an empty common.sh for any future use when npm is selected, but as this is a workaround created by husky it'd be most likely redundant, so I just removed it. I also included one suggestion of an improvement based on https://github.com/zkat/npx/issues/220.
I wasn't really used to the codebase of this generator, so I hope I tested it correctly. By the way, is there any contributor guide to this project? New users currently have to figure out how to run the project by running cac as .js via node, which most likely requires bootstrapping lerna, and also to assume what's supposed to be covered by the snapshot tests, considering that this husky change seems to have passed all the tests which should fail. I most likely plan to make some other PR in a near future, as there's plenty of things that new Nuxt users still must figure out by themselves, so having any officially maintained contributors guide available would be helpful to avoid having to waste a few days researching it from scratch by trial & error :)

Thanks for the pr.
Regarding contributor guide, we’ll add to this repo shortly.

[Off-topic] Not related to PR, but regarding the contributor guide, I'll just mention that the SAO will most likely need some explicit guidelines and workarounds in addition to their official docs, as it seems it lacks basic things like file copy and doesn't support EJS features. Here is my today's experience: https://github.com/saojs/sao/issues/176


CSCMatrix transpose method throws "assertion failed"

I have such test:
      val builder = new Builder[Double](rows = 10, cols=10)
      builder.add(0, 0, 1.0)
      builder.add(1, 0, 1.0)

      val a = builder.result

      a.update(0, 0, 0.0)
      a.t.rows must_== a.cols

In this case method call a.t throws "assertion failed". If I remove a.update statement everything would be alright.

thanks for the test case!