OIDC, I cannot add extra claims from userinfo endpoint

In ASPNET Core 2.0, extra claims from the userinfo endpoint are not added to User.Claims in a MVC Client application. This worked in Core 1.1, what am I doing wrong? All I am getting is sid,sub,idp and email , all the other claims (including my custom claims) from the userinfo endpoint is missing. I checked the access_token int jwt.io and all the claims are there.
services.AddAuthentication(options =>
            {
                options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
            })
            .AddCookie()
            .AddOpenIdConnect(o =>
            {
                o.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                o.RequireHttpsMetadata = false;
                o.Authority = "xxxxx";
                o.ClientId = "xxxx";
                o.ClientSecret = "xxxx";
                o.ResponseType = "code id_token";
                o.GetClaimsFromUserInfoEndpoint = true;
                o.SaveTokens = true;
                o.SecurityTokenValidator = new JwtSecurityTokenHandler
                {
                    InboundClaimTypeMap = new Dictionary<string, string>()
                };
                o.TokenValidationParameters.NameClaimType = "email";
            });

I wouldn't expect any differences. If you hook into Events.OnUserInformationReceived can you share the resulting json (see .User)?
https://github.com/aspnet/Security/blob/5abcfe7e3d78f777d45503b50de5cea17cf9aa5e/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/Events/OpenIdConnectEvents.cs#L64

The .User in Events.OnUserInformationReceived does show the additional claims as 'Children' tokens. However, these additional claims do not seem to be added to the Identity. I end up with only the claims from the original id_token and not the access_token.
I realised that if I removed 'hybrid' flow and delete the property o.ResponseType = "code id_token";
an changed the flow to 'implicit' it works. I read this in a previous post and tried it. Any way, the code that works is shown below:

Use 'implicit' flow
Remove Response.Type property from OpenIdConnectOptions

services.AddAuthentication(options =>
            {
                options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
            })
            .AddCookie()
            .AddOpenIdConnect(o =>
            {
                o.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                o.RequireHttpsMetadata = false;
                o.Authority = "xxxxx";
                o.ClientId = "xxxx";
                o.ClientSecret = "xxxx";
                o.GetClaimsFromUserInfoEndpoint = true;
                o.SaveTokens = true;
                o.SecurityTokenValidator = new JwtSecurityTokenHandler
                {
                    InboundClaimTypeMap = new Dictionary<string, string>()
                };
                o.TokenValidationParameters.NameClaimType = "email";
            });

Is it that additional claims from the userinfo endpoint are not added for 'hybrid' flows? I did not try other flows. What do I need to do to get the 'hybrid' flow to work? It worked in ASP.NET Core 1.x.

I have exactly the same problem with the same configuration of @rcladmin. I resolved setting AlwaysIncludeUserClaimsInIdToken = true in the client configuration on the IdentityServer4 side, so it is not being obtained from the userinfo endpoint.

These are my findings:

'Implicit' flow (response type : id_token) gets all the claims in the id_token (there is no access_token here) and is added to the identity. However, this flow does not cause a request to userinfo endpoint. Therefore, AlwaysIncludeUserClaimsInIdToken = true has no effect in the implicit flow. This works.

Hybrid flow (response type: code id_token) gets claims from id_token and adds it to identity. It causes a request from the userinfo endpoint and get the extra claims in the access_token, but it does not add it to the Identity.

Ok, I know what's different here. See https://github.com/aspnet/Security/pull/1124#issuecomment-280079805. 2.0 no longer adds all possible information from the user-info endpoint, it was causing major cookie bloat leading to login issues. There is now a system called ClaimActions where you can select which elements you want to map from the user info doc to claims. See OpenIdConnectOptions.ClaimActions. Here are some examples:
https://github.com/aspnet/Security/blob/5abcfe7e3d78f777d45503b50de5cea17cf9aa5e/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/OpenIdConnectOptions.cs#L61-L64
https://github.com/aspnet/Security/blob/5abcfe7e3d78f777d45503b50de5cea17cf9aa5e/samples/SocialSample/Startup.cs#L179

@Tratcher
Hey, It works! Thanks for your help. For those having the same problem this is my code.

Use 'hybrid' flow
Add the claims you want to include with  o.ClaimActions.MapJsonKey

.AddOpenIdConnect(o =>
            {
                o.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                o.RequireHttpsMetadata = false;
                o.Authority = "xxxx";
                o.ClientId = "xxxx";
                o.ClientSecret = "xxxx";
                o.SaveTokens = true;
                o.SecurityTokenValidator = new JwtSecurityTokenHandler
                {
                    InboundClaimTypeMap = new Dictionary<string, string>()
                };
                o.TokenValidationParameters.NameClaimType = "email";
                o.ResponseType = OpenIdConnectResponseType.CodeIdToken;
                o.GetClaimsFromUserInfoEndpoint = true;
                o.ClaimActions.MapJsonKey("Contacts", "Contacts");
            });
````

@Tratcher
Hi everyone!
I have the same issue but I try to include array (role claim).
So when I try to
ClaimActions.MapJsonKey("role", "role")
I get the Exception:

Cannot cast Newtonsoft.Json.Linq.JArray to Newtonsoft.Json.Linq.JToken

I tried to use MapCustomJson but I don't know how to return the array, threre is only string return type, not the List
ClaimActions.MapCustomJson("role", jObject => string.Join(',', ((JArray) jObject["role"]).ToObject<List<string>>()));

The existing extensions are for simple one-to-one json values to claims. In your case role is an array. Do you want that array stored as a single claim? If so you can just call ToString on it.
If you want multiple claims then you can create your own ClaimAction that does that.
https://github.com/aspnet/Security/blob/5abcfe7e3d78f777d45503b50de5cea17cf9aa5e/src/Microsoft.AspNetCore.Authentication.OAuth/Claims/ClaimAction.cs#L40

@balkarov
Get the roles as a string[] : o.ClaimActions.MapCustomJson("role", jobj => jobj["role"].ToString());
This will return something like this example: "role" : ["Admin", "User", "Reader", "Contributor"]

It worked for me too. Thanks @Tratcher

@Tratcher thank you! It is work for me.
But why microsoft did not add "Role" claims by default in Asp Core ? I this "Role" is very popular claims.
public class JsonKeyArrayClaimAction: ClaimAction
{
    /// <summary>
    /// Creates a new JsonKeyArrayClaimAction.
    /// </summary>
    /// <param name="claimType">The value to use for Claim.Type when creating a Claim.</param>
    /// <param name="valueType">The value to use for Claim.ValueType when creating a Claim.</param>
    /// <param name="jsonKey">The top level key to look for in the json user data.</param>
    public JsonKeyArrayClaimAction(string claimType, string valueType, string jsonKey) : base(claimType, valueType)
    {
        JsonKey = jsonKey;
    }

    /// <summary>
    /// The top level key to look for in the json user data.
    /// </summary>
    public string JsonKey { get; }

    public override void Run(JObject userData, ClaimsIdentity identity, string issuer)
    {
        var values = userData?[JsonKey];
        if (!(values is JArray)) return;

        foreach (var value in values)
        {
            identity.AddClaim(new Claim(ClaimType, value.ToString(), ValueType, issuer));
        }
    }
}

And after
o.ClaimActions.Add(new JsonKeyArrayClaimAction("role", "role", "role"));
And after I can use User.IsInRole

@balkarov
I had the same question about Roles and Claims and this is what I found out:

Claims are preferred for authorization than the traditional Membership/Roles we used in the past
Microsoft has provided a new table in Identity called RoleClaims as a 'fix' for traditional users of asp.net identity roles. Its mainly for backward compatibility.
Authorization Policy is based mainly on a User Claim and is the preferred method to protect controllers. You decorate your controller with [Authorize(Policy="ContactsRead'] instead of the traditional User.IsInRole.
As a example, you may have users in a 'Marketing' role, but some user can only read data, some can delete and some can add data. This cannot be accomplished by roles but can be accomplished by user claims. Each user in a role can also have different claims. And you use these claims for the security. Its a better system.
The concept of roles-based authorization is non-existent is modern identitiy systems (facebook, twitter, google, miscosoft, etc). Claim based authorization seems to be the defacto system.

In summary, roles authorization has been an 'asp,net identity thing' that came with the old asp,net identity, claims based authorization has been more  widely accepted and is the recommended method for authorization.
If you are interested to read more:
https://stormpath.com/blog/tutorial-policy-based-authorization-asp-net-core

I know this has been closed, but JsonKeyArrayClaimAction solved my problem too and I could see that added to Claims extension inside the middleware.
//cc: @Tratcher

@tstojecki feel free to open a new issue for that and/or send a PR.

PR sent #1501

JsonKeyClaimAction is in the Microsoft.AspNetCore.Authentication.OAuth v2.1.1 out of the box
Usage: options.ClaimActions.Add(new JsonKeyClaimAction(JwtClaimTypes.Role, null, JwtClaimTypes.Role));
I just can't understand why they pass "role" value to the valueType parameter. Like here: https://github.com/aspnet/Security/issues/1449#issuecomment-332767846
I expected something like "String".
Actually I have dig to the sources and this value is used for the Claim object creation.
/// <param name="valueType">The claim value type. If this parameter is null, then <see cref="F:System.Security.Claims.ClaimValueTypes.String"></see> is used.</param>
So it should be rather null than "role"
And "role" value passed to the valueType parameter obviously leads to the following:


Datasets module with the GDP hourly accessor

[x] Implementation
[x] Test
[x] Docs

New module to provide a convenience accessor to hourly GDP dataset from the Zarr dataset on AWS.
In [1]: from clouddrift import datasets

In [2]: datasets.gdp1h()
Out[2]:
<xarray.Dataset>
Dimensions:                (traj: 17324, obs: 165754333)
Coordinates:
    ids                    (obs) int64 ...
    lat                    (obs) float32 ...
    lon                    (obs) float32 ...
    time                   (obs) datetime64[ns] ...
Dimensions without coordinates: traj, obs
Data variables: (12/55)
    BuoyTypeManufacturer   (traj) |S20 ...
    BuoyTypeSensorArray    (traj) |S20 ...
    CurrentProgram         (traj) float64 ...
    DeployingCountry       (traj) |S20 ...
    DeployingShip          (traj) |S20 ...

Attributes: (12/16)
    Conventions:       CF-1.6
    acknowledgement:   Elipot, Shane; Sykulski, Adam; Lumpkin, Rick; Centurio...
    contributor_name:  NOAA Global Drifter Program
    contributor_role:  Data Acquisition Center
    date_created:      2022-12-09T06:02:29.684949
    doi:               10.25921/x46c-3620
    ...                ...
    processing_level:  Level 2 QC by GDP drifter DAC
    publisher_email<EMAIL_ADDRESS>    publisher_name:    GDP Drifter DAC
    publisher_url:     https://www.aoml.noaa.gov/phod/gdp
    summary:           Global Drifter Program hourly data
    title:             Global Drifter Program hourly drifting buoy collection

@philippemiron can you check if this works when installing with Conda from the environment.yml file? I added the required dependencies for remote Zarr access however on my end it still complains about requests and aiohttp missing, despite them being listed as installed. It must be my misunderstanding of how Conda works.
I also brought netCDF4 and Xarray dependency versions to the latest. Probably not necessary but good to keep up to date as long as the new versions work.
This PR bumps the project version to 0.15.0.

Sorry for the delay. I confirm that it is working!


Release 1.0.0

Overview
It's almost here! We've made significant changes to the codebase and are now compliant with stripe API version 2016-03-07.
I want to give a huge thanks to all of our contributors for their help in making this happen, especially Bill Huneke (@wahuneke) for his impressive design work.
Almost all methods now mimic the parameters of those same methods in the stripe API. Note that some methods do not have some parameters implemented. This is intentional. That being said, expect all method signatures to be different than those in previous versions of dj-stripe.
At this point, you should be able to check out the 162 branch and start playing around. I'm not yet fully confident in saying that the public api won't change. I'll update this when I get further along in testing.
A few things to get excited for

Multiple subscription support (finally)
Multiple sources support (currently limited to Cards)
Full model documentation
Objects that come through webhooks are now tied to the API version set in dj-stripe. No more errors if dj-stripe falls behind the newest stripe API version.
Any create/update action on an object automatically syncs the object.

What still needs to be done

Testing. I'm almost done fixing the tests. DONE!
Documentation. Our original documentation was not very helpful, but it covered the important bits. It will be very out of date after this update and will need to be rewritten. If you feel like helping, we could use all the help we can get to get this pushed out asap.
Master sync re-write. This sounds scary, but really isn't. The current management methods run sync methods on Customer that aren't very helpful and are due for removal. My plan is to write something that first updates local data (via api_retrieve and sync_from_stripe_data) and then pulls all objects from Stripe and populates the local database with any records that don't already exist there.
Plan settings/models dynamic. We have a plan and just need to implement it. See the comment below.

Significant changes (mostly backwards-incompatible)
I kept a log of everything that changed. I believe this is everything; if you notice something I've missed, let me know and I'll add it. I'll go through and double-check before we officially release.
VIEWS/TEMPLATES/EMAIL TEMPLATES/ADMIN PAGES/CONTRIB PACKAGES

All dj-stripe views, templates, email templates, admin pages, and contrib packages (django rest framework) do not support multiple subscriptions at this time.
AccountView no longer provides subscription in context. Use {{ customer.subscription }}
ConfirmFormView now takes in plan_id instead of plan as a url argument for clarity.

SETTINGS

The STRIPE_API_VERSION setting is no longer taken into account. See #116.
The PLAN_CHOICES, PLAN_LIST, and PAYMENT_PLANS objects are removed. Use Plan.objects.all() instead.
The plan_from_stripe_id function is removed. Use Plan.objects.get(stripe_id=<stripe_id>)

SYNCING

sync_plans no longer takes an api_key
sync methods no longer take a cu parameter
All sync methods are now private. We're in the process of building a better syncing mechanism.

UTILITIES

dj-stripe decorators now take a plan argument. If you're passing in a custom test function to subscriber_passes_pay_test, be sure to account for this new argument.

MIXINS

The context provided by dj-stripe's mixins has changed. PaymentsContextMixin now provides STRIPE_PUBLIC_KEY and plans (changed to Plan.objects.all()). SubscriptionMixin now provides customer and is_plans_plural.

MIDDLEWARE

dj-stripe middleware doesn't support multiple subscriptions.

SIGNALS

Local custom signals are deprecated in favor of Stripe webhooks:

cancelled -> WEBHOOK_SIGNALS["customer.subscription.deleted"]
card_changed -> WEBHOOK_SIGNALS["customer.source.updated"]
subscription_made -> WEBHOOK_SIGNALS["customer.subscription.created"]

WEBHOOK EVENTS

The Event Handlers designed by @wahuneke are the new way to handle events that come through webhooks. Definitely take a look at event_handlers.py and webhooks.py.

Exceptions

SubscriptionUpdateFailure and SubscriptionCancellationFailure exceptions are removed. There should no longer be a case where they would have been useful. Catch native stripe errors in their place instead.

MODELS
Charge

Charge.charge_created -> Charge.stripe_timestamp
Charge.card_last_4 and Charge.card_kind are removed. Use Charge.source.last4 and Charge.source.brand (if the source is a Card)
Charge.invoice is no longer a foreign key to the Invoice model. Invoice now has a OneToOne relationship with Charge. (Charge.invoice will still work, but will no longer be represented in the database).

Customer

dj-stripe now supports test mode and live mode Customer objects concurrently (See #440). As a result, the <subscriber_model>.customer OneToOne reverse relationship is no longer a thing. You should now instead add a customer property to your subscriber model that checks whether you're in live or test mode (see djstripe.settings.STRIPE_LIVE_MODE as an example) and grabs the customer from <subscriber_model>.djstripe_customers with a simple livemode= filter.
Customer no longer has a current_subscription property. We've added a subscription property that should suit your needs.
With the advent of multiple subscriptions, the behavior of Customer.subscribe() has changed. Before, calling subscribe() when a customer was already subscribed to a plan would switch the customer to the new plan with an option to prorate. Now calling subscribe() simply subscribes that customer to a new plan in addition to it's current subsription. Use Subscription.update() to change a subscription's plan instead.
Customer.cancel_subscription() is removed. Use Subscription.cancel() instead.
The Customer.update_plan_quantity() method is removed. Use Subscription.update() instead.
CustomerManager is now SubscriptionManager and works on the Subscription model instead of the Customer model.
Customer.has_valid_card() is now Customer.has_valid_source().
Customer.update_card() now takes an id. If the id is not supplied, the default source is updated.
Customer.stripe_customer property is removed. Use Customer.api_retrieve() instead.
The at_period_end parameter of Customer.cancel_subscription() now actually follows the DJSTRIPE_PRORATION_POLICY setting.
Customer.card_fingerprint, Customer.card_last_4, Customer.card_kind, Customer.card_exp_month, Customer.card_exp_year are all removed. Check Customer.default_source (if it's a Card) or one of the sources in Customer.sources (again, if it's a Card) instead.
The invoice_id parameter of Customer.add_invoice_item is now named invoice and can be either an Invoice object or the stripe_id of an Invoice.

Event

Event.kind -> Event.type
Removed Event.validated_message. Just check if the event is valid - no need to double check (we do that for you)

Transfer

Removed Transfer.update_status()
Removed Transfer.event
TransferChargeFee is removed. It hasn't been used in a while due to a broken API version. Use Transfer.fee_details instead.
Any fields that were in Transfer.summary no longer exist and are therefore deprecated (unused but not removed from the database). Because of this, TransferManager now only aggregates total_sum

Invoice

Invoice.attempts -> Invoice.attempt_count
InvoiceItems are no longer created when Invoices are synced. You must now sync InvoiceItems directly.

InvoiceItem

Removed InvoiceItem.line_type

Plan

Plan no longer has a stripe_plan property. Use`api_retrieve()`` instead.
Plan.currency no longer uses choices. Use the get_supported_currency_choices() utility and create your own custom choices list instead.
Plan interval choices are now in `Plan.INTERVAL_TYPE_CHOICES``

Subscription

Subscription.is_period_current() now checks for a current trial end if the current period has ended. This change means subscriptions extended with Subscription.extend() will now be seen as valid.

MIGRATIONS
We'll sync your current records with Stripe in a migration. It will take a while, but it's the only way we can ensure data integrity. There were some fields for which we needed to temporarily add placeholder defaults, so just make sure you have a customer with ID 1 and a plan with ID 1 and you shouldn't run into any issues (create dummy values for these if need be and delete them after the migration).
BIG HUGE NOTE - DON'T OVERLOOK THIS
Subscription and InvoiceItem migration is not possible because old records don't have Stripe IDs (so we can't sync them). Our approach is to delete all local subscription and invoiceitem objects and re-sync them from Stripe.
We 100% recommend you create a backup of your database before performing this upgrade.

@pydanny, @r0fls, @benmurden

Hooray! This is awesome! I'll run through all the changes again.

@pydanny: Another option for the Customer/Subscription Manager change (here)

Hey, nice changelog :). I am using dj-stripe in production based on my branch (the one were I played with multiple credit cards) and it works fine for now.
I will update the staging environment to this branch and will post here all issues I have.

@bartoszhernas: sounds good!

Hey Team,  I have a new project and want to use dj-stripe;  1.0.0 is looking amazing and the milestone list is pretty short.  Is there a timeline for release or should I stick to 0.8?   Or maybe a timeline my team could help shorten with some testing or bug fixing ...

Hi @robert-osborne,
If you're starting from scratch, I would highly suggest jumping on with 1.0.0 so you can work with the latest API set. There are so many great new features (and fixes for bugs present in 0.8.0) in 1.0.0 that you would be missing out on.
As far as a schedule goes, we're realistically looking at the end of July for an official release unless a bunch of time opens up for me. I'll keep this post updated with my schedule and will add a date to the milestone when things settle down and I can actually plan to set aside time to work on this.
That being said, we're pretty close. Jumping on now would just mean you would not yet have a convenience function for syncing objects and you would have to add plans via the ORM (or the Django admin) instead of using a setting. The documentation will also be way off, but I'm sure you'll be able to find your way around.
If you can spare some time, it would be great to get the last 2% of the codebase covered by tests. We're at 98% and the only thing left to test is some of the subscription mechanisms in models.py.
I did come across a migration bug while trying to update a local repo from 0.8.0 to 1.0.0, so if you want to try to take a stab at reproducing it and fixing it, that would also help.

Alex

@robert-osborne: You should have no issues using the 162 branch as of now. The points in my last comment still stand. If you run into any bugs, let me know.

Hey, I am testing it slowly, was crazy hard to fix the database problems (never use forks!).
I somehow managed to get to stable state and started updating code.
I have one problem though, when trying to cancel/resume plan I am getting this error:

DEBUG 2016-06-13 15:29:14,003 resources 37<PHONE_NUMBER>66464 PUSHER: private-user-4
Not Found: /webapps/ahoyapiproduction/media/private/user_4/image_U6Bktop.jpeg
Not Found: /webapps/ahoyapiproduction/media/private/user_4/image_U6Bktop.jpeg
WARNING 2016-06-13 15:38:57,932 middlewares 37<PHONE_NUMBER>66464 "/usr/src/app/media/image_rTH9eBf.jpeg" does not exist
Not Found: /media/image_rTH9eBf.jpeg
WARNING 2016-06-13 15:39:01,028 middlewares 37<PHONE_NUMBER>66464 Invalid API Key provided: True
Internal Server Error: /cards/unsubscribe/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 184, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/viewsets.py", line 87, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python2.7/dist-packages/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/src/app/ahoy/api/apps/cards/resources.py", line 83, in unsubscribe
    request.user.stripe_customer.subscription.cancel(at_period_end=CANCELLATION_AT_PERIOD_END)
  File "/usr/src/app/src/dj-stripe/djstripe/models.py", line 629, in cancel
    stripe_subscription = super(Subscription, self).cancel(at_period_end=at_period_end)
  File "/usr/src/app/src/dj-stripe/djstripe/stripe_objects.py", line 1331, in cancel
    return self._api_delete(at_period_end)
  File "/usr/src/app/src/dj-stripe/djstripe/stripe_objects.py", line 128, in _api_delete
    return self.api_retrieve(api_key).delete()
  File "/usr/src/app/src/dj-stripe/djstripe/stripe_objects.py", line 92, in api_retrieve
    return type(self)._api().retrieve(id=self.stripe_id, api_key=api_key, expand=self.expand_fields)
  File "/usr/local/lib/python2.7/dist-packages/stripe/resource.py", line 284, in retrieve
    instance.refresh()
  File "/usr/local/lib/python2.7/dist-packages/stripe/resource.py", line 288, in refresh
    self.refresh_from(self.request('get', self.instance_url()))
  File "/usr/local/lib/python2.7/dist-packages/stripe/resource.py", line 210, in request
    response, api_key = requestor.request(method, url, params, headers)
  File "/usr/local/lib/python2.7/dist-packages/stripe/api_requestor.py", line 138, in request
    resp = self.interpret_response(rbody, rcode, rheaders)
  File "/usr/local/lib/python2.7/dist-packages/stripe/api_requestor.py", line 270, in interpret_response
    self.handle_api_error(rbody, rcode, resp, rheaders)
  File "/usr/local/lib/python2.7/dist-packages/stripe/api_requestor.py", line 161, in handle_api_error
    rheaders)
AuthenticationError: Invalid API Key provided: True

Which is weird because subscribing to the plan and adding cards work just fine.
Any ideas?

Ok, found in Stripe logs This action requires additional privileges

Interesting. Sounds like a permissions error on stripe maybe? I'll look into it right now.
Are all of your dependencies up to date?

Try cancelling the subscription with curl to double check that it's a stripe issue and not a dj-stripe issue.

@kavdev hey, so the privileges was not from djstripe (something I clicked on dashboard).
I haven't found the issue, but when I switched to this code everything works just fine:
        stripe.api_key = settings.STRIPE_SECRET_KEY
        sub = stripe.Subscription.retrieve(request.user.stripe_customer.subscription.stripe_id)
        sub = sub.delete(at_period_end=CANCELLATION_AT_PERIOD_END)
        # request.user.stripe_customer.subscription.cancel(at_period_end=CANCELLATION_AT_PERIOD_END) # this is the old code
        Subscription.sync_from_stripe_data(sub)

@bartoszhernas: This might be irrelevant, but isn't it request.user.customer?

@bartoszhernas: Just pushed a commit that you should pull. It doesn't solve your issue, but at_period_end wasn't getting passed to the stripe delete call.

@bartoszhernas: Go ahead and pull. The api_key kwarg was being overridden with the at_period_end value. Basically, dj-stripe was sending either True or False as your api key and Stripe got mad. Should be fixed with that last commit.

@kavdev Awesome, thanks a lot, great work!
Do you want me to post issues with 1.0.0 here or to create separate tickets?
All seems to work just fine, except the admin panel:
AttributeError: 'NoneType' object has no attribute 'status'
(25 additional frame(s) were not displayed)
...
  File "djstripe/admin.py", line 152, in subscription_status
    return obj.subscription.status

@bartoszhernas: Taking a look now. New issues would be better, just put [v1.0.0] in front of the subject, e.g. "[v1.0.0] Admin panel subscription status bug"

Ok, will do. I have already deployed this to production since it works better then the old version.
Thanks a lot for fixes and work on this library !

@bartoszhernas: Fantastic to hear that it's working well in production!
I pushed the fix for that admin bug; go ahead and pull at your convenience.

@bartoszhernas: note that Customer.has_active_card() will be Customer.has_active_source() in the next push.

Hey guys, just a heads up that we're integrating the functionality from the 1.0 branch into our site (it isn't live yet, but I'll have the public fork created within the next few days) - We've made several minor fixes but it includes (off the top of my head, the PRs will be more detailed):

Added support for upcoming invoices.
Added support for reprocessing Stripe events via admin interface.
Added support for sub-event registration in event handles.
Added fixes for source deletion when event is received from Stripe.
Added fixes for invoice items being processed correctly (and invoice items for upcoming invoices).
Added fixes for subscription updates (looks like you've fixed this already though).
Added fixes for field differences between djstripe and Stripe.

The changes are mostly compatible and I'll hopefully be able to add additional tests to cover any changes made, where possible.
The background for our integration is that we're launching the first part of our SaaS platform and we'll need the capability to process multiple subscriptions (per product) for a customer, so the 1.0 branch fit our needs well.
We've utilised the heavy lifting provided by the library for Stripe processing and models, but admittedly our views/frontend code is completely custom.  There may be things that we're willing to submit back though, time permitting (you can see for yourselves when the site is live).
We're looking forward to contributing our fixes and helping you get over the line for the 1.0 release!
:+1:

@lskillen: Awesome! I look forward to your contributions.
As for views, my goal is to eventually build a demo example in dj-stripe that will make it easier to use and test the dj-stripe views. So far my main focus lately has been getting the models up to speed.

Moving towards the demo application style would probably help with pushing some of the business logic out of the views and into the forms, models or more utility functions, which in turn would make the views more lightweight and easier to customise to each user's requirements.
This is the approach that we've taken with our integration, where our views (and view mixins) are primarily serving the purpose of gluing together heavyweight forms with presentation, and don't really do a whole lot other than manage this interaction and set context data.
Some of the other things we've already implemented:

Declarative Plans (model-like, not persisted, each app/service declares its own plans/features.)
Account Summary (with balance, discounts, upcoming costs, etc.)
Customer Trial Tracking (create running total of trials to reduce future trial lengths.)
Pre-Dunning/Dunning (track expiring/expired sources, notify customers, chase funds, etc.)
Customer Event Emails (subscription activated, updated, invoice paid, etc.)
PDF Invoice Generation (dynamic, available for all previous invoices in history).
Permissions Hooks (hooks for subscriber access to views based on plans/features/membership).
Custom Payment Source Form (incl. address/country/tax information, for sales tax support).

Some of the things we're in the process of implementing or would like to implement soon:

Sales Tax Support (unfortunately necessary for trading within the EU for digital services).
Dispute Handling (i.e. taking actions on a customer account during disputes, like dunning above).
Asynchronous Events (acknowledge Stripe event immediately, but defer processing to task queue).
Admin Improvements (mostly for the dunning / dispute support above).
Better Tests / Test Coverage (I really admire that you've got 100% test coverage!  #jealous)

I doubt all of these would belong in this library, but if there's any interest in any of the above I could certainly see about turning some of it into a PR if possible in the near future.  Either way we'll continue to contribute where and when we can, and if it makes sense to do so.  The library has been a massive help in gettting us off the ground with Stripe - The 1.0 release of the library is going to be a good one!

@kavdev That's all of our PRs submitted for now - Let me know if you need help with anything, or if any of the PRs require changes.  Cheers! :grinning:

@kavdev: What's the roadmap to the 1.0.0 release?  Is there anything else we can help with?

@lskillen: Three things: object sync, plan initiation, and documentation.
Object Sync
We need functions in sync.py that, based on a fetch_new parameter, either syncs all locally stored objects with Stripe or pulls all objects of that type from Stripe and populates the local database. With that, there should be a sync_all function with the same signature that calls the sync methods for each object type.
Plan Initiantion
See the discussion in #22. Since plans are now used through models instead of a settings registry, we need to think of how to move forward. The settings registry might be a good way to initiate plans, but I don't think it's unreasonable to require users to either create them through the ORM or create them in the Stripe dashboard and call the plan sync function. The major concern with the "plans as models" feature is that users won't understand that plans are, for the most part, immutable. I'm not so sure that's a problem; they'll probably notice fairly quickly that changing a plan locally does nothing to it remotely. The docs should help with this. I'm leaning towards just saying "screw it" and removing the djstripe_plans setting and just explain via the docs how to initialize plans.
Something that isn't on the roadmap for 1.0.0 is updating stripe objects through the Django ORM. In short, a call to save() will send an update() api call to stripe. If an argument is given for an immutable property or a property that doesn't exist on the object, we can either throw an exception or hope that Stripe throws an exception for us.
Documentation
I've started on this with models.py, but there's a lot left to do. Once the other two features are done, I'll crank out documentation. Installation, usage (basically a short doc on everything you can do with the project), docs on all usable modules, contributing, credits, history, support. (The last four are already written, they just need a quick glance over)

@kavdev Sounds great and tantalizingly close!
Other than seeing if we have time to contribute actual code via PRs for any of the above, here are a few tidbits of food for thought:
Object Synchronisation
Depending on the scale of the website a full synchronisation might take a significant amount of time - It would be extremely helpful to be able to decouple from this as a synchronous operation and allow it to be processsed piecemeal and asynchronously.  Not dissimilar to the example I provided for the new webhook event callback (i.e. support hand-off to a task queue).
We utilise something like this for pre-dunning/dunning checks, in which every customer is checked to see if they have a source expiring or expired.  The entire customer data-set is handed off to the task queue, but it is chunked into smaller portions so it can be worked on asynchronously, resulting in a much faster operation.  It also means that one failure doesn't cause the entire thing to fail.
Plan Initiation
Anecdote - We actually do the opposite!  Our plans are defined (per product) in a declarative way during application import, and the plans are registered with the billing system.  Once all applications are ready then we actually build up the DJSTRIPE_PLANS dictionary (including other metadata) before hand-off to dj-stripe for actual creation of the plans later.  This was mostly for convenience at the time, and we'll likely try to match whatever the outcome of this is.
Regardless, given the prominence of the devops / infrastructure-as-code school of thought, I don't think it would be a good idea to completely eliminate local specification of plans.  it wouldn't work well for our use-case, but I could see how it would be nice for some users to be capable of creating plans from Stripe.  In saying that, in those cases where I have reset the database locally during development, but not in Stripe, it would be nice if it just recreated plans instead of saying "plan already exists" (it does, but not locally).
Documentation
I'll have to think about any pain points I might have encountered during our own integration - I still think your idea of a demo application would be fantastic as a fleshed out "quickstart" guide.  I could probably contribute some material to handling multiple subscriptions, or something to do with some of the other features I had mentioned a few comments back.  We're prepping for our own release this month so the time I'll be able to offer will be limited until I get through that!

Interesting.
Object Synchronisation
What I'll probably do is write it synchronously and then add async support later as we did with the webhook event callback.
Plan Initiation
Go ahead and look at the discussion in #22. It has my original implementation plan. If that fits your use case, I'll just stick with that.
Documentation
The demo app will come at a later time. For now the focus is to just make the docs understandable. Any contributions to the usage page will be much appreciated.

@kavdev Is there documentation I can help with? Is there a current list of things left to do?

@kavdev Also is there a roadmap for the rest_api part of the app? I have lots of experience in DRF and would like to see that part of the app expand.

@aleccool213: We need docs on Decorators, Event Handlers (how create and use them, with examples), Model Managers (which could probably be folded into Models), Middleware, Signals (Simply note that a signal is sent for each webhook type. Link to the stripe webhooks doc.), and Views

Because it's in contrib, there's no roadmap for the DRF part of the app -- it's kind of like a "if you need it, add it" situation. Feel free to add as much functionality as you'd like!

A docs section on DRF would also be cool.

@kavdev Interesting, I wouldn't mind being assigned to the Decorators or the View. Should I make an issue for this or shall you?
Because the DRF part of the app is small I can do that for sure. Ill make an issue for this.

@aleccool213: Great! Either make an issue or just create a PR

@lskillen Hey there! I noticed you mentioned sales tax. Is that something you could show me how you implemented? I am needing to implement this in my dj-stripe fork for work.

Bug notice: application_fee was being passed to Stripe.Customer.charge() with the amount argument value.
See https://github.com/kavdev/dj-stripe/pull/382

Here's a rough outline of what we need for documentation:
Installation (currently being updated by @jameshiew)
Usage
- docs on how to use different aspects of dj-stripe:
- checking if a customer has a subscription
- subscribing a customer to a plan
- creating a single charge for a customer
- restricting access based on subscriptions
- Managing subscriptions, cards, etc.
- Creating Invoices and adding line items to an invoice
- Running reports with our model managers
- handling webhook events
- manually syncing data with Stripe
Reference (currently being updated by @aleccool213)
- docs on all the classes and methods in the package (including the contrib rest api)
Contributing (already written, needs polish)
Credits (already written, needs polish)
History/Changelog (already written, needs polish)
Support
- Tell users to use Stack Overflow for any implementation questions they might have
- Inform users about commercial support offered by Cartwheel Web (if @pydanny is still okay with that :))
The usage section of the docs is really the only big thing left to write. @jameshiew, if you're up for creating the docs hierarchy with a bunch of "No content... yet" placeholder, that'd probably make it a bit easier for people to contribute.

@kavdev you can use https://github.com/kentcdodds/all-contributors for Credits section

@aleccool213: good idea. It'll take forever to go back and categorize almost four years of contributions though haha so I vote the contributors section should be updated by the contributors themselves. We'll just set up the initial template with the existing contributors and just their profile images and have people update it with PRs
The contributing section will just have a note - "Submit a pull request to add yourself as a contributor if you feel you've contributed in the following categories [category list]" or something like that.
Not having to update the contributors doc on my end is a nice perk.

Bug notice: old reference to has_valid_card in the confirm form template.
See #391

^ I'm going to keep doing these until this branch is merged and on pypi

(Sorry, this is a bit lengthy. But only because I'm new here and want to include more detail in case I'm off about something.)

The major concern with the "plans as models" feature is that users won't understand that plans are, for the most part, immutable. (comment)

I have some ideas on how to mitigate this while making the workflow more obvious and less error-prone. First, some context.
Plan ownership
After catching up with all past comments, it sounds like some core issues are related to the question of "who owns the plans"? There's two possibilities:

You create plans in Stripe that your app then replicates. It could be a developer, or it could be someone else entirely (my case). Replication can either be done manually by editing DJSTRIPE_PLANS, or automatically with a script or management command.
Treat Stripe like Django treats the database schema: Django (and therefore, a developer) manages them through migrations. Likewise, you can treat a setting or model as an intention to be pushed to Stripe. This is nice when the developer is in charge of setting this all up.

Note that in both cases, Stripe is still the source of truth. Credit cards get charged based on what's in Stripe, not your app. Therefore, all dj-stripe plans are actually local copies, regardless of how it's stored and where the changes come from.
Also, unlike database schemas--which you shouldn't edit directly--you may want to allow plans be edited from the Stripe dashboard. Since I'm working in such an environment, I'd consider it a serious limitation if you couldn't.
So what's the difference? It's how you treat out-of-sync data. (This is a distributed system, after all.) With Stripe-driven (1), you overwrite the local copy and acknowledge that the app may briefly show outdated information. Easy. With app-driven (2), you need to be more careful with the design or you run into all the difficulties pointed out in this comment.
Both ownership models are valid for different projects, and that's fine. They can both work well while still allowing Stripe to be the source of truth. The question is, how?
Initial state

I don't think it would be a good idea to completely eliminate local specification of plans (comment)

I agree. I propose something similar to the current efforts of backwards compatibility: have both. Sort of.
There's actually two reasons for having your app control Stripe. They're independent concerns:

To have your app act as the authority of plan data as discussed above
To have your app work out-of-the-box for spinning up staging or end-to-end test environments, and also for developer convenience when publishing template / example repos

By moving Plans from settings to models, you sacrifice (2) because adding plans require additional actions (as opposed to something you can commit to git, like DJSTRIPE_PLANS), or relies on external data from Stripe (which may be tricky since there's no Heroku-esque "clone" feature of an existing Stripe account).
My proposal is to introduce a new DJSTRIPE_INITIAL_PLANS setting.
This has the same structure as DJSTRIPE_PLANS, but only gets used on empty Stripe accounts. Then rely on the Plan model from that point on. Here, Plan is treated as a local cache of Stripe data that can't be edited directly. (More on this below.)
One nice side effect is that the "move existing customers to a new plan" problem is entirely a Stripe concern now. Updating the initial plans won't affect existing systems (although you still may want to keep them in sync for certain projects, but it's only for convenience at this point). And all plan changes must go through Stripe since Plan is a cache.
Syncing
With static initial plans and dynamic cache models, you effectively get immutability. Changing the initial plan only affects new projects, and whenever a Plan object goes out-of-sync with Stripe, whether by changing Stripe or unwittingly changing Plan (or a bug), you bust it.
There's three aspects here:

Fetching the plans from Stripe (a syncstripe method and management command)
Detecting out-of-sync plans (so a dev knows when they need to run syncstripe)
Managing Stripe plans from the app (i.e. the other direction)

Detection appears to be missing from the current discussion. This could be something like syncstripe --dry-run, an admin button, or perhaps more conveniently, a Django check that prints "Your dj-stripe plans are out of sync" on runserver, similar to the "You have unapplied migrations" message.
For production, Stripe can be wired up to call a webhook that effectively calls syncstripe when plans change. So this is only a problem for local dev environments (and therefore, runserver is a good place to show this message).
Managing Stripe plans from the app
Finally, when you treat Stripe as the source of truth, how do you control changes as if plans were app-driven like database schemas?
For devs who want to treat the app as the authoritative data for plans, DJSTRIPE_INITIAL_PLANS can play a role here too--only a little different from how it works now. This setting still isn't the source of truth, but rather, a convenience to the developer who doesn't want to update Stripe separately.
Running manage.py syncstripe --initial would compare DJSTRIPE_INITIAL_PLANS to what's on Stripe, validate, and make API calls accordingly. (Since financial data is important, it could prompt you before making any changes.) Notice how syncstripe with no arguments won't harm you here. In fact, running syncstripe with --initial will also perform a normal syncstripe when it's done to cache the new state of Stripe into the local Plan model. So the flow is still DJSTRIPE_INITIAL_PLANS -> Stripe -> Plan cache. The command can fail if, say, you removed a plan from DJSTRIPE_INITIAL_PLANS but there's still customers subscribed to it on Stripe, keeping that complexity outside of dj-stripe.
I still like having the name DJSTRIPE_INITIAL_PLANS. It's clear about its "initial-only" intentions that cover most parts of the workflow, and removes some confusion about whether you can update Stripe directly, and the "does the app use the setting or the model" question. You could introduce a new setting, but then you have another thing to keep in sync. Not very DRY. The docs can help devs discover this convenient "update an existing Stripe account from the app" case.
As a closing thought, you'll find similar patterns in a CQRS system. I think the "commands to change external state, models as cache of external state" pattern seems like a good fit here too, since we're dealing with an external system that can change from under you.
Summary

Have a new DJSTRIPE_INITIAL_PLANS setting that populates fresh Stripe accounts on syncstripe
Have Plan be non-editable in the admin and update it only through syncstripe
Include a webhook to handle plan changes from Stripe on production
Include syncstripe --initial for app-driven plan changes

"Customers" is another piece. I think they can be treated in the same way. Add initial Stripe customers from the User model on manage.py syncstripe if Stripe is empty. And only pull from Stripe from that point on with Customers being another local cache.
whew! That's more than I planned on writing. Hopefully this ultimately helps frame the problem a bit differently and offers a decent solution.
What do you think?

Hi @joeyespo! First off, thanks for the writeup - it's a nice hybrid option that we haven't seen before and it works perfectly with what we'd like to accomplish. Well done.
So, a few points to hit:

I agree that Plans should be, for the most part, immutable locally. There are some fields you can actually change, so the plan is to override the save() method to only push through changes on editable fields.
The DJSTRIPE_INITIAL_PLANS setting and the accompanying flow is great
* Having a django system check for out-of-sync plans is a cool idea. I like it.
syncstripe --initial is a great way to bring local plans and customers to Stripe. If the plan already exists on Stripe, let the user know what there is to update and confirm. Override local plans with the DJSTRIPE_INITIAL_PLANS config
* I think webhooks are already set up for the Plan object, but the Plan update hook and downstream flow needs a bit of cleanup
We want to keep a historical record of Plans in the models so we have reliable references from other objects, so the Plan delete webhook will need to be blocked.
As for customer syncing, you're right on track.

There's already a bunch of syncing code for a lot of the models in a data migration; a lot of it can be reused for the syncstripe command.
I think this is a great path forward. If you want to take this on, feel free to submit a pull request. If you have any questions or need help while you're working on it, ping me.
I'm sure we'll hear back from a few others in this thread, but I don't think there will be any opposition. Your solution seems to keep both parties happy.

Bug notice: "metadata" typo.
See https://github.com/kavdev/dj-stripe/commit/df6ee7f33e31fb83765f9881622ce19eee4a5358

So yeah, plans... https://stripe.com/blog/multiplan-subscriptions

Not to take this off-topic, but is there any estimates on the timeline for 1.0 release?

@Sheepzez: There's no hard timeline yet. We'll soon be implementing 20% time at work, so if all goes well, I'll be able to actually put time into finishing this release.
Rough estimate right now is probably June-ish. That said, v1.0.0 is useable as is, provided you have webhooks running and manually add plans.

Here's what I think should still happen before calling it for a 1.0 release:

Finish the sync rewrite
Land idempotency keys
Land improved admin
Fix Django Rest Framework 3.5
Get dj-stripe working with Django 1.11. This is blocked on polymorphic models.
Potentially drop polymorphic models (at least have a discussion about this)
If the views/templates are to be dropped (#428), drop them before the release
Drop Django Braces dependency, if possible (almost done)
2017-01-27 compatibility (#443)
Squash the migrations (it's kinda insane right now)
Save django account IDs to the stripe metadata (ff48aa9c55d3a8b5544260f15206afe09a5f15eb, not PR'd yet)

There's also a bunch of bugfixes and cleanups that can land by the time all that finishes.
In the future though, I should advise: don't wait so long to release new versions :)

I'd also like to see if we can land support for concurrent live + test keys and some checks verifying key sanity. I'm probably going to work on this today a bit.

@jleclanche: That's a solid addition to the roadmap. Thanks for all the shiny new contributions!

In the future though, I should advise: don't wait so long to release new versions :)

Haha no kidding. We were on track for a release at one point, but then work, completing uni, etc. slowed things down. Then I decided to switch from consulting work to working on a few startups full+ time and dj-stripe went to the backburner. Luckily things are opening up a bit again, especially now that that 20% time policy is in effect.

@kavdev Maybe a firm migration guide for people moving from old versions to 1.0.0 could be a nice addition.

@kavdev Maybe a firm migration guide for people moving from old versions to 1.0.0 could be a nice addition.

Agreed. I've just implemented 0.8.0 with heavy modifications because 1.0.0 was still a ways off. As there are some fairly substantial changes to the feature set, I'm totally for having a solid migration guide. Let me know if I can help out with this in any way.

Most likely the last blockers for 1.0:

#521 - fixed upstream, waiting for a release (dmkoch/django-jsonfield#189)
#524 - filed PR (django-polymorphic/django-polymorphic#291), waiting for it to land + a release

RE: #521 - jsonfield 1.0.2 got released today.

RE: #524 - merged, waiting for new django-polymorphic release.

django-polymorphic 1.3 has been released, we should be good to go: https://github.com/django-polymorphic/django-polymorphic/releases/tag/v1.3

@flxfxp agreed. I'm a bit worried about #552 though

I was unaware of this issue. I agree that this should be fixed before moving forward with 1.0.0. I'll look into this later this week.

Okay so I'm fairly confident we have a release candidate. Any objections?

No objections. On the contrary: the sooner we get packages up on PyPI, the better.

A long time coming, excited!

We're ready I think. Let's do this.

Solid. This will be a MOAChangelogs lol

❤ Thanks to everyone who helped make this happen.

Trying to migrate 30,000+ customers from v0.8.0 to v1.0.1 and am receiving the following error when attempting to migrate:
django.db.utils.OperationalError: no such column: djstripe_customer.email

I know you said that we need to start over, but what are the actual steps I need to take to migrate? I don't see those steps outlined anywhere.

@rlfrahm Can you try 1.2.2 instead of 1.0.1? There's several more migration fixes there. If you're still having issues migrating to 1.2.2, could you file a new issue?

The problem with 1.2.2 is that the migration 0001_initial creates all the models... But I've already got models created for djstripe, so my current state clashes with the state in 1.2.2. This is the same problem I'm having with 1.0.0 and on.
I really just need to know how to get from 0.8.0 to >0.8.0. Am I supposed to create a migration for djstripe that moves Customer to some other table name and drops all the tables. Then upgrade to >0.8.0 and run a sync from Stripe and use my old customer tables to ensure that my Django users have the correct stripe id?
Thanks for your help.

Sorry, i meant 1.1.1.


Adding Captor and its test

Hi, I re-create here the pr I made on the typemoq unmaintained repo.
Here it is the the text I wrote for the original pr.
Hi all,
I submit this PR to include Captors to the library. This small contribution is inspired by Mockito's ArgumentCaptor and I find it very useful to test the interaction between view and presenters.
As an example:
type ButtonHandler = () => void;

interface Button {
    name : string
    addClickListener(handler : ButtonHandler) : void
}

interface View {
    onButtonClicked(buttonName : string) : void
}

function linkButton(button : Button, view : View) {
    button.addClickListener(() => view.onButtonClicked(button.name))
}

describe("when a button is linked", () => {
    it ("the view reacts to the click on the button", () => {
        let buttonMock = TypeMoq.Mock.ofType<Button>()
        buttonMock.setup((button) => button.name).returns(() => "name")

        let viewMock = TypeMoq.Mock.ofType<View>()
        let listenerCaptor = TypeMoq.ArgumentCaptor.argumentCaptor<ButtonHandler>()
        linkButton(buttonMock.object, viewMock.object)
        buttonMock.verify((button) => button.addClickListener(listenerCaptor.capture()), Times.once())

        // simulate the click
        listenerCaptor.value()
        viewMock.verify((view) => view.onButtonClicked("name"), Times.once())
    })
})

Please let me know if this addition can be useful.
Best,
Luca

Hey @lucailmartini - Sorry I didn't see this sooner!
I've merged this PR, and will push a new version of typemoq-continued soon :)


[usb] Implement {open,close}DeviceHandle in WebUSB

Implement openDeviceHandle()/closeDeviceHandle() requests in the
libusb-to-WebUSB adaptor. As WebUSB doesn't have a concept of device
handles, but Libusb does, our adaptor is generating them using a simple
counter. The main difficulty is to handle the cases of concurrent
open/close requests, as WebUSB doesn't like concurrent open/close calls,
and we want to correctly handle scenarios when an open request comes
before the close finishes.

Maybe I should ask Reilly to look at this as well...

Maybe I should ask Reilly to look at this as well...

Actually I think there's no strictly USB-specific question in this pull request, it's more like solving a generic programming problem and expressing it in terms of JavaScript. So our internal review and manual testing should be sufficient.

Thanks!


[JAVA-1390] Phase 2: doing the release.

Working release process.  It fits together end to end but it's not pretty, and could use some tidy up, however I thought it best to get some feedback on it as it is. The last couple of stages were more complicated than I expected.
You can test the release by running ./gradlew release -DreleaseVersion=3.0.0
Roll it back by removing the 3.0.0 tag, deleting the draft release notes and resetting the current branch back two commits.

There were a few things that didn't work properly in this pull request.  In particular, it didn't properly sign all the artifacts and Sonatype rejected the upload as a result.  I was unable to get signing to work properly with a multi-project Gradle build using the new Gradle publish plugin.  The only way I got it to work was using the old nexus plugin.


Add support for Twixel API v3

Library currently supports v2. Add support for v3 and allow the user to chose which API version they want to call from.

#4

#4

Merged in changes. Now complete. Hooray.


Why does 'az storage message put' strip quotes?

No matter how many quotes I put, the quotes are always stripped. This does not seem like the correct behavior.
az storage message put `
    --content """""b7e8ad82-542e-4801-901d-d89f56f591a3""""" `

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

ID: fac497f1-2ee4-5060-933b-366ec2836fbf
Version Independent ID: fffc936d-b784-2a49-9f4b-d5e78e9c64e8
Content: az storage message
Content Source: src/azure-cli/azure/cli/command_modules/storage/_help.py
Service: storage
GitHub Login: @rloutlaw
Microsoft Alias: routlaw

hi @Juliehzl could you pls have a look

add to S168

@onionhammer Could you please use --content '\"\"\"acerwv\"\"\"' to add "?

@onionhammer any update?

@yonzhan I ended up encoding with base64 to work around this issue. I still consider this a bug though, so I'm leaving it open intentionally..

Hi @onionhammer ,
Could you try to escape your quotes like this?
az storage message put `
    --content "\`"b7e8ad82-542e-4801-901d-d89f56f591a3\`"" `

so that the Azure CLI args would get \"b7e8ad82-542e-4801-901d-d89f56f591a3\" as input from Powershell and subsequently interpret it as "b7e8ad82-542e-4801-901d-d89f56f591a3"
I don't know why they strip down unescaped double quotes.
You can check how Azure CLI interprets input arguments with --debug switch like this:
az storage message put --debug `
    --content "\`"b7e8ad82-542e-4801-901d-d89f56f591a3\`"" `

would output this in the first line:
Command arguments: ['storage', 'message', 'put', '--debug', '--content', '"b7e8ad82-542e-4801-901d-d89f56f591a3"']


Change 'open' state for a emoji

https://kikobeats.com/#open → https://kikobeats.com/#😎
Emoji could be customizable!

I don't think it's ok for SEO reputation but maybe i'm wrong. :S

I think that is Irrelevant... How to know it?
On Monday, 1 February 2016, Florin Lungu<EMAIL_ADDRESS>wrote:

I don't think it's ok for SEO reputation but maybe i'm wrong. :S
—
Reply to this email directly or view it on GitHub
https://github.com/Kikobeats/uno-zen/issues/178#issuecomment-178193788.


Import Error on M1 Chip

Hey, I have trouble importing the wandb module on my M1 Chip.
I did the installation with the command:
pip install wandb.
But I get the following error, when trying to import wandb in PyCharm:
ImportError: dlopen(/Users/test/PycharmProjects/test_project/venv/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so, 0x0002): tried: '/Users/test/PycharmProjects/test_project/venv/lib/python3.9/site-packages/psutil/_psutil_osx.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/_psutil_osx.cpython-39-darwin.so' (no such file), '/usr/lib/_psutil_osx.cpython-39-darwin.so' (no such file)
Any ideas how to handle this?

Hi @yannickeich,
Looks like there is an issue with psutil installing the incorrect binary, could you try the following
pip uninstall psutil
pip install --no-cache psutil

Thanks,
Ramit

Thank you for your fast reply!
Unfortunately I get the same error,  when I try what you proposed.
Best,
Yannick

Hey @yannickeich,
Perhaps using Rosetta 2 would help resolve this:
arch -arm64 python3 -m pip install wandb

Are you having problems installing other libraries / running other code on your computer? This definitely sounds like a configuration issue between Python and your Mac and not an issue at W&B's end, since I'm able to run wandb SDK fine on my M1 Mac. One other option which might work is actually downloading a fresh install of Python which you know would work with the M1 chip.
Thanks,
Ramit

Hi @yannickeich,
We wanted to follow up with you regarding your support request as we have not heard back from you. Please let us know if we can be of further assistance or if your issue has been resolved.

Hi @yannickeich, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

Hey, I have trouble in configuring Django-mysql environment.
thread '' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.20.3/src/err/mod.rs:788:5:
Python API call failed
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace


Cocoapods support

Hey,
Thanks for the nice library!
It would be nice to see Cocoapods support :)
Cheers!

Hi @fabioknoedt , actually, it does already.

Awesome! Thanks!


Gradle build Failing

Executing tasks: [clean, :app:assembleDebug] in project F:\ANDROID\Android_Studio_Projects\TRYS\NotJustATimer\NotJustATimer3

Task :clean UP-TO-DATE
Task :app:clean UP-TO-DATE
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:generateDebugBuildConfig
Task :app:checkDebugAarMetadata FAILED
Task :app:generateDebugResValues
Task :app:generateDebugResources
Task :app:mergeDebugResources FAILED
Task :app:createDebugCompatibleScreenManifests
Task :app:extractDeepLinksDebug
Task :app:processDebugMainManifest FAILED
Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
Task :app:javaPreCompileDebug
Task :app:mergeDebugShaders
Task :app:compileDebugShaders NO-SOURCE
Task :app:generateDebugAssets UP-TO-DATE
Task :app:mergeDebugAssets FAILED
Task :app:processDebugJavaRes NO-SOURCE
Task :app:checkDebugDuplicateClasses FAILED
Task :app:desugarDebugFileDependencies FAILED
Task :app:mergeDebugJniLibFolders
Task :app:mergeDebugNativeLibs FAILED
Task :app:validateSigningDebug
Task :app:writeDebugAppMetadata
Task :app:writeDebugSigningConfigVersions

FAILURE: Build completed with 7 failures.
1: Task failed with an exception.

What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.Triggertrap:SeekArc:v1.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://repo.maven.apache.org/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://jcenter.bintray.com/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
Required by:
project :app

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

What went wrong:
Execution failed for task ':app:mergeDebugResources'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.Triggertrap:SeekArc:v1.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://repo.maven.apache.org/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://jcenter.bintray.com/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
Required by:
project :app

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

3: Task failed with an exception.

What went wrong:
Execution failed for task ':app:processDebugMainManifest'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.Triggertrap:SeekArc:v1.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://repo.maven.apache.org/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://jcenter.bintray.com/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
Required by:
project :app

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

4: Task failed with an exception.

What went wrong:
Execution failed for task ':app:mergeDebugAssets'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.Triggertrap:SeekArc:v1.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://repo.maven.apache.org/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://jcenter.bintray.com/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
Required by:
project :app

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

5: Task failed with an exception.

What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.Triggertrap:SeekArc:v1.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://repo.maven.apache.org/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://jcenter.bintray.com/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
Required by:
project :app

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

6: Task failed with an exception.

What went wrong:
Execution failed for task ':app:desugarDebugFileDependencies'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.Triggertrap:SeekArc:v1.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://repo.maven.apache.org/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://jcenter.bintray.com/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
Required by:
project :app

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

7: Task failed with an exception.

What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.Triggertrap:SeekArc:v1.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://repo.maven.apache.org/maven2/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
- https://jcenter.bintray.com/com/github/Triggertrap/SeekArc/v1.1/SeekArc-v1.1.pom
Required by:
project :app

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s
19 actionable tasks: 17 executed, 2 up-to-date

android.enableJetifier=true
add this line to your gradle.properties
this is fix my problem


Gaze cursor activation behavior that matches the shell

Overview
Implement gaze cursor activation behavior that matches the HoloLens 2 and Windows Mixed Reality (WMR) shell:

Head cursor appears when app start
Cursor disappears when articulated hands or motion controllers show up (but NOT GGV hands as for hololens 1, or for mouse / gamepad).
Gaze cursor only appears again when voice wake word has been used (for WMR this is the word 'select').

Changes

Fixes: #4176
Add speech command "select" to the speech commands profile, activatable by Alpha1
Remove "toggle diagnostics" and "toggle profiler" speech commands because they are never used.
Small Breaking Change IFocusProvider implements IMixedRealitySpeechHandler. I don't expect that anybody has built a custom focusprovider yet, and if they have the compile error provides obvious solution (implement the interface). I couldn't think of any other way to listen for a speech command that wouldn't result in adding extra game objects that I could listen to events for.

Verification
Tested in editor the following cases:

Articulated hands
GGV Hands
Gamepad
Mouse

Need to still test:

HL1 device
HL2 Device
Using WMR controllers (after voice mode, clicking controller should move back to controller input)

As a reviewer, it is possible to check out this change locally by using the following
commands (substituting {PR_ID} with the ID of this pull request):
git fetch origin pull/{PR_ID}/head:name_of_local_branch
git checkout name_of_local_branch

Something I think that I also don't fully grok is that this is a breaking change (an interface change), and I'm curious to understand the dialogue around the tradeoffs/benefits/risks to doing this.
i.e. is parity in this aspect worth the pain of breaking changes for this interface, or do we believe that this particular thing has a 0% chance of being extended, so the net pain is basically zero and thus the breaking change is okay?
We've been reducing the amount of breaking changes as we stabilize, and generally: 1) we shouldn't do it and 2) if there is significant benefit and we can prove insigifinicant harm or provide a migration script, then maybe it's okay?

Something I think that I also don't fully grok is that this is a breaking change (an interface change), and I'm curious to understand the dialogue around the tradeoffs/benefits/risks to doing this.
i.e. is parity in this aspect worth the pain of breaking changes for this interface, or do we believe that this particular thing has a 0% chance of being extended, so the net pain is basically zero and thus the breaking change is okay?
We've been reducing the amount of breaking changes as we stabilize, and generally: 1) we shouldn't do it and 2) if there is significant benefit and we can prove insigifinicant harm or provide a migration script, then maybe it's okay?

I've updated the change to have it be a smaller breaking change: just have IFocusProvider implement the MRSpeechHandler interface in addition to sourcestatehandler. The chance that IFocusProvider has been extended is small (<10%), however even if somebody extended it, the way to fix the break is obvious from the compile error: implement the missing interface. The migration script in this case would just be manual and should not take long "if you implemented your own FocusProvider, add an implementation of the new method".
I actually couldn't think of a way to not require FocusHandler to listen to a voice command without modifying the interface or having to add a fairly big hack (add game object that implements interface, expose unity event, and listen for that event. Or cast IMRFocusProvider into concrete type and call a public method directly...which seems against the approach of trying to allow others to extend the system). AFAIK there is no way to say "InputSystem.SpeechRecognized += OnSpeechRecognized". You need to implement an interface to get events.
The change fixes a user visible defect "cursor is always visible when hands are down", and helps us get closer to shell parity. I think it is worth the risk of having some small percentage of people add another method to their FocusProvider in this case.

/azp run mrtk_pr

I'm glad that @provencher mentioned the null-comparison-against-interfaces-that-are-monobehaviors-under-the-covers issue.
@provencher do you happen to know of any analyzers that will detect this type of stuff? If not it might be worth it for me to write something like this because having this be called out automatically (instead of having to have someone having to have a super careful eye on all of these reviews calling out those sorts of things)

/azp run mrtk_pr


Getting different results based on punctuation

Is this intended behavior?
print(wer('hello', 'hello.'))
print(wer('hello', 'hello!'))

Gives
0.0
1.0

No, when I worked on this the speech-to-text engine I used did not add insert ! or ?. I will add it to the list of characters which are filtered out.

@nikvaessen imho this should not happen at all - or it should be possible to disable this behavior.
wer() should take an iterable and calculate the WER based on those elements. The input should not be modified any further - also no lower-casing. Imho one should not assume that this is what the caller of wer() wants. It's the callers responsibility to pass in preprocessed input.

Thanks for this input. I've updated the library so that it's easier for users to control what per-processing is done,


Fix test deciding to native-compile

What's wrong
The test you are using is no more working since native-compile have been merged in emacs master.
Directions to reproduce
Rebuild your emacs without --with-native-compilation, restart emacs, straight will try to rebuild packages with native-compilation which is no more available.
diff --git a/straight.el b/straight.el
index 3915e86..2bec43f 100644
--- a/straight.el
+++ b/straight.el
@@ -4837,7 +4837,8 @@ function only modifies the build folder, not the original
 repository. Also note that native compilation occurs
 asynchronously, and will continue in the background after
 `straight-use-package' returns."
-  (when (and (fboundp 'native-compile-async)
+  (when (and (fboundp 'native-comp-available-p)
+             (native-comp-available-p)
              (member 'straight--build-compile straight--build-functions))
     (require 'comp)
     (straight--with-plist recipe (package)

Version information

Emacs version: emacs-28.0.50
Operating system: Linuxmint

Thanks for bringing this to our attention, Thierry.
I've applied a variation on your suggested patch (we still need to keep the fboundp check for native-compile-async to quiet the byte-compiler).


OS check fails in Docker on Windows on module import

https://github.com/asweigart/pyperclip/blob/c3aa4650364f391ec461525f0c81b0685d18684a/src/pyperclip/__init__.py#L543
Can this check be moved out of init?
This throws a FileNotFoundError on powershell.exe missing when running in a Docker container on Windows.

that is true, with this bug it is impossible to use it on docker with windows on wsl platform

First of all, thanks for the great module. Not sure, if my problem is identical — I am running a Linux container on Win10 and I am getting the following.
File "/usr/local/lib/python3.6/dist-packages/pyperclip/__init__.py", line 659, in lazy_load_stub_copy
    return copy(text)
  File "/usr/local/lib/python3.6/dist-packages/pyperclip/__init__.py", line 507, in copy_wsl
    stdin=subprocess.PIPE, close_fds=True)
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'clip.exe': 'clip.exe'

Looking at the code

  if platform.system() == 'Linux' and os.path.isfile('/proc/version'):
        with open('/proc/version', 'r') as f:
            if "microsoft" in f.read().lower():
                return init_wsl_clipboard()

in my Docker box, the /proc/version says

>>> cat /proc/version
Linux version <IP_ADDRESS>-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) <IP_ADDRESS>00220) #1 SMP Wed Mar 2 00:30:59 UTC 2022

but of course there is no access to clip.exe from within the container. It works fine in the WSL itself.
Unless I am mistaken, it would be enough to check for the existence of .dockerenv as explained in https://stackoverflow.com/questions/20010199/how-to-determine-if-a-process-runs-inside-lxc-docker


The latest "WTHIT" mod is running on Quilt，the Mod Menu update detect wrong think is the latest version for Fabric.

I believe this is due to it not recognizing Quilt versions and not recognizing Quilt as a mod loader.
Drama time?

Can also reproduce using Cherished Worlds quilt-6.1.0+1.20.1, Mod Menu 7.1.0 and Quilt 0.19.1, with the latest version of Cherished Worlds on Modrinth for Fabric being fabric-6.1.0+1.20.1.

Can also reproduce using Cherished Worlds quilt-6.1.0+1.20.1, Mod Menu 7.1.0 and Quilt 0.19.1, with the latest version of Cherished Worlds on Modrinth for Fabric being fabric-6.1.0+1.20.1.

I have a suspicion that the Mod Menu cannot recognize the Quilt version of Mods!That's why it's like this!


Remove 'security_groups' column from 'aws_ec2_network_load_balancer' table

Describe the bug
AWS NLBs do not use security group associations so that column is always empty.
NLB table and docs look like they were forked from the alb table
Steampipe version (steampipe -v)
v0.20.9
Plugin version (steampipe plugin list)
latest
Additional context
https://github.com/turbot/steampipe-plugin-aws/pull/1869
is this all that is needed for the pr? (I havent done any code submissions here)
diff --git a/aws/table_aws_ec2_network_load_balancer.go b/aws/table_aws_ec2_network_load_balancer.go
index e07ca75..ebf655b 100644
--- a/aws/table_aws_ec2_network_load_balancer.go
+++ b/aws/table_aws_ec2_network_load_balancer.go
@@ -111,11 +111,6 @@ func tableAwsEc2NetworkLoadBalancer(_ context.Context) *plugin.Table {
                                Description: "The subnets for the load balancer",
                                Type:        proto.ColumnType_JSON,
                        },
-                       {
-                               Name:        "security_groups",
-                               Description: "The IDs of the security groups for the load balancer",
-                               Type:        proto.ColumnType_JSON,
-                       },
                        {
                                Name:        "load_balancer_attributes",
                                Description: "The AWS account ID of the image owner",

The changes that you have mentioned in the issue body look great, you can definitely proceed with a PR 👍.
Are there any other columns that should be removed as well?

@tinder-tder @misraved  Recently, AWS announced the support for the same, probably while we were working on it. Closing this as already we released.
I have raised the new issue for the same; feel free to comment, https://github.com/turbot/steampipe-plugin-aws/issues/1875


Autowiring not working in sample: HelloHandler

Describe the bug

in the azure sample with HelloHandler it is not possible to get injected with any component. If you e. g. want to get any service through @Autowired it will not work.
For me it looks like this class is not managed at all by spring boot
I'm using version 2.3.4.RELEASE of spring boot

Should it work at all?

Please provide more details as to what you are trying t inject and where

Closing it due to lack of follow up from the reporter


⚠ Bofrost.de has degraded performance

In 3e73276, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 1689 ms

Resolved: Bofrost.de performance has improved in 29bd782 after 20 minutes.


"Find in files" (CTRL-SHIFT-F)  only finds in the current file.

VS Code Version:
OS Version:

I have about a dozen mixed .c, .h and .txt files open in VSC.
"Find in files" (CTRL-SHIFT-F)  does not find matches in open or non-open files - only in the current selected file.
I can have nothing, or add . or *.c etc. to the "Files to include" making no difference.
I have nothing in "Files to exclude".
The "Match Case" and "Match Whole Word " settings also do not matter.
I have about a dozen mixed .c, .h and .txt files open in VSC.
"Find in files" (CTRL-SHIFT-F)  does not find matches in open or non-open files - only in the current selected file.
I can have nothing, or add . or *.c etc. to the "Files to include" making no difference.
I have nothing in "Files to exclude".
The "Match Case" and "Match Whole Word " settings also do not matter.
Linux ESI-MGilmer 5.10.16-200.fc33.x86_64 #1 SMP Sun Feb 14 03:02:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Version: 1.53.2
Commit: 622cb03f7e070a9670c94bae1a45d78d7181fbd4
Date: 2021-02-11T11:48:44.518Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: <IP_ADDRESS>-electron.0
OS: Linux x64 5.10.16-200.fc33.x86_64

Does this issue occur when all extensions are disabled?: Yes

I'm having the same problem AFAIK.
I have about a dozen mixed .c..h and .txt files open in VSC.
"Find in files" (CTRL-SHIFT-F)  does not find matches in open or non-open files - only in the current file.
I can have nothing, or add . or *.c etc. to the "Files to include" making no difference.
I have nothing in "Files to exclude".
The "Match Case" and "Match Whole Word " settings also do not matter.
It's running in latest Fedora.
Version: 1.53.2
Commit: 622cb03f7e070a9670c94bae1a45d78d7181fbd4
Date: 2021-02-11T11:48:44.518Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: <IP_ADDRESS>-electron.0
OS: Linux x64 5.10.16-200.fc33.x86_64

CPUs
Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (12 x 4000)

GPU Status
2d_canvas: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: disabled_off opengl: enabled_on protected_video_decode: unavailable_off rasterization: disabled_software skia_renderer: enabled_on video_decode: disabled_software vulkan: disabled_off webgl: enabled webgl2: enabled

Load (avg)
0, 0, 0

Memory (System)
15.29GB (7.94GB free)

Process Argv
--no-sandbox --unity-launch --crash-reporter-id 6d522ad2-c5b1-47fa-852d-d5689b0c570f

Screen Reader
no

VM
0%

Extension	Author (truncated)	Version
cmake-tools	ms-	1.6.0
cpptools	ms-	1.2.1
vscode-print	pdc	0.8.3
cmake	twx	0.0.17

Please check whether any tips on this wiki page are helpful: https://github.com/microsoft/vscode/wiki/Search-Issues

If there's an issue with search, do you see the same issue with quickopen, (or vice versa)?
I don't use "quickopen" and don't know what it is or why I would want to.

If you see an issue with search when you have folder A open, do you see a similar issue with other folders on your computer?
I see this issue in all folders I use regularly

Collecting search logs
Some details are logged for each search. To see these logs, run the command "Developer: Set Log Level...", select "Trace"

Do you want this info?  How does one "run" a "command"?

And just like that - the "all files" search works.


Matrices, Custom keyboards and horizontal Scrolling

So first of, thank you so much for developing such an awesome Pod. It really solved a lot of my problems but I have a few things to still take care of and this seemed like the right place to ask.
Is it possible, and if yes how, to enter and edit matrices ?
How do I implement a custom keyboard in Swift ? I am writing my App in swift and I would like to make a custom keyboard. So I implemented the MTMathKeybard protocol but I can’t get info about what methods to implement.
When the Input gets wider then the width of the label theres currently (to my knowledge) to way to get back and forth. How would you go about this ?
I also have a little Question about your uneditable label but it is in the Issues threat of the Repository. But again, thank you so much for sharing this awesome work. I really am amazed by your work.
All my best,
Jony

Sorry for the late response:
Editing matrices is not implemented. You will have to implement a custom keyboard to do that.
To implement a custom keyboard just implement the two methods on MTMathKeyboard. Look at MTMathKeyboardRootView code to see how those could implemented. Essentially they take an UIKeyInput as a parameter. Whenever your keyboard needs to update the label, it can call the UIKeyInput methods: insertText or deleteBackwards. Then set the keyboard property on the label with your custom keyboard.
To adjust the label when it gets too big look at MTMathEditorExample, that has code to adjust the size of the text.
Hope this helps.

Absolutely no problem =)
Thanks a lot for your answer. So I will play around with the custom keyboard and the example. But is there a way to change the textcolor of the editable label ? The tintColor doesn't seem to do the job.
And again. Thanks a lot for contributing to this awesome project.

To change the color of the text, set the color field on the MathUILabel. If you want to change the color of just part of text there is the \textcolor command you can use.


Improve Seifert surface calculation algorithm to get rid of artefacts

Current implementation  sometimes generates visual artefacts especially on complex knots (see attached screenshot).

.

Another example (from Win):


Missing license LayoutLM model checkpoint

Hi,
The LayoutLM code is licensed under Apache, but for its model checkpoints (layoutlm-base-uncased, layoutlm-base-cased, layoutlm-large-uncased) the license information is missing on HuggingFace. As these checkpoints are directly referenced by the official repo, could you please add this information? @wolfshow ? @ranpox ? @liminghao1630 ?

Thanks! The LayoutLM v1 models can be used for commercial purpose.

Thanks for the comment, @wolfshow ! But could you please specify the explicit license of the model checkpoints on the HuggingFace website? A statement on this forum is no help in the context of commercial usage...

Hi @wolfshow,
Have the good day.
I still not see any license mentioned in https://huggingface.co/microsoft/layoutlm-base-uncased/blob/main/README.md
Is there any updated for license of LayoutLM v1 pre-trained model?


Channel numbers for SpectrumLike

@JohannesBuchner would like to use channel numbers for SpectrumLike when fitting:
"So I have to define a custom model with my template (length=#of channels), after I notice/ignore my channels and pass into it the mask. In the model function I have to return the template(with mask applied) and scale it by a variable. But how each of these steps work in 3ML is not very clear to me."
I will work to provide an example on this.

@JohannesBuchner how exactly is your background defined?

As number of counts expected in each detector channel. The custom background model should normalise the template by a parameter when a particular background spectrum is fitted.

Ok, the reading in of the template is defined and a normalization (as well as an energy scaling parameter) is applied to the template when you load it.
The issue here is that the energy axis for models is defined in photon energy space.
You can see that the way we construct a "background plugin" is by extracting the counts from a pha and turning it into a SpectrumLike plugin:
@classmethod
    def from_background(cls,name,spectrum_like, verbose=True):
        """
        Extract a SpectrumLike plugin from the background of another SpectrumLike (or subclass) instance
        :param name: name of the extracted_plugin
        :param spectrum_like: plugin with background to extract
        :param verbose: if the plugin should be verbose
        :return: SpectrumLike instance from the background
        """

        background_only_spectrum = copy.deepcopy(spectrum_like.background_spectrum)

        background_spectrum_like = SpectrumLike(name, observation=background_only_spectrum, background=None, verbose=verbose)

        return background_spectrum_like

SpectrumLike applies no dispersion to the photon model. So, there should be a 1-to-1 mapping between channel number and energy.
Thus, if you have a background model that depends on channel number, you may need to extract the EBOUNDS from the data used and use those energies when constructing the template. I'm writing up an example write now.
@giacomov does this approach sound sane to you?

@JohannesBuchner Shall we take a look at this together and solve the issue?

I am closing due to inactivity. Please reopen if needed!


Always block  .games domain

Description
The rules always block my domain name which  end with ".games"  .
Audit Logs / Triggered Rule Numbers
---aHm3iwfx---F--
HTTP/2.0 403
Server: nginx
Date: Sun, 17 Oct 2021 07:41:08 GMT
Content-Length: 548
Content-Type: text/html
X-Content-Type-Options: nosniff
Connection: close
X-XSS-Protection: 1; mode=block
Referrer-Policy: no-referrer-when-downgrade
Content-Security-Policy: img-src * blob: data: filesystem:;default-src * data: 'unsafe-eval' 'unsafe-inline'
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

---aHm3iwfx---H--
ModSecurity: Warning. detected SQLi using libinjection. [file "/usr/local/modsecurity-crs/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf"] [line "46"] [id "942100"] [rev ""] [msg ""] [data ""] [severity "0"] [ver "OWASP_CRS/3.4.0-dev"] [maturity "0"] [accuracy "0"] [hostname "<removed from me>"] [uri "/"] [unique_id "1634456468"] [ref "v834,38"]
ModSecurity: Access denied with code 403 (phase 2). Matched "Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file "/usr/local/modsecurity-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "139"] [id "949110"] [rev ""] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"] [data ""] [severity "2"] [ver "OWASP_CRS/3.4.0-dev"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-generic"] [hostname "<removed from me>"] [uri "/"] [unique_id "1634456468"] [ref ""]

Your Environment

CRS version (v3.3.2):
ModSecurity version ( 3.0.5 ):
Web Server and version ( nginx  1.18.0):
Operating System and version: Linux 4.9.0-16-amd64 , Debian  9.13

Confirmation
[x ] I have removed any personal data (email addresses, IP addresses,
passwords, domain names) from any logs posted.

If this help, here is the full debug log  ( domain name is replaced with <my_site>.games )
https://drive.google.com/file/d/1GWD9iQhJitg1J6QU4MU_51YZfsosDnb-/view?usp=sharing


Broken URLs in preview docs

The URL rewriting in #295 does not seem to work as intended. I get in https://ukri-excalibur.github.io/excalibur-tests/preview/PR299/ url's on the main page that look like https://ukri-excalibur.github.io/excalibur-tests/preview/PR299/preview/PR299/install/ ie. the preview/PR299 bit appears twice.

I've been looking at the code but struggling to spot what's the error.  This is with PR #294 (before #295): https://github.com/ukri-excalibur/excalibur-tests/blob/35ceb1f2ea66a48f2a861f30febda0d58b80ee25/preview/PR294/index.html#L1212
This is with PR #295:
https://github.com/ukri-excalibur/excalibur-tests/blob/e1c1b1bd2ff7b88b4e32bbb66931f3eec69f64cb/preview/PR295/index.html#L1212
I'm really missing what's causing the duplicate preview/PRNNN level.  Ok, time to do some debugging.

Ah, wait, it's the second push within the same PR which is messing this up: https://github.com/ukri-excalibur/excalibur-tests/commit/771a2019a9d6fc7626667e460989e4f0e74cdd0e#diff-7fd9bc7707206c4dfa2b00b4bf5684de0c820259a4156c27387ab0f72af9315cR1233.  I'm very confused.


Custom root paths appear to work but they reflect the wrong url on the href

Probably missing adding the root in a key place.

https://github.com/solidjs/solid-app-router/pull/16

Released in 0.0.46


WIP: Add Dockerfile

To recap, I couldn't figure out how to start CI without issuing a PR, and so when we were hunting down #103, I used this to run some tests in Docker, so that I could determine it wasn't just my machine.
But, now that we've written it, we might as well just polish it up and commit it.
@anguslees what part of this do you want to be exercised by CI? I thought Travis could not build docker images.

I've added a bunch of goodies to make it easy to deal with the Dockerfile, and I'm going to try to see if we can build from inside Travis to see if it can be exercised by CI.

This PR is stale; probably it makes more sense to add kubecfg to the bitnami application catalog so we don't need to worry with container delivery pipeline here


File size bug

Hey. It seems some torrents are entering into elastic with 0B of size. but upon opening the magnet into Utorrent, it indeed has file size.
Can you shed any light onto this?
kind regards

Some torrents can't get size from the DHT network and must start
downloading the file to get the size.
On Sun, Mar 11, 2018 at 6:05 AM, ash121121<EMAIL_ADDRESS>wrote:

Hey. It seems some torrents are entering into elastic with 0B of size. but
upon opening the magnet into Utorrent, it indeed has file size.
Can you shed any light onto this?
kind regards
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/AlphaReign/scraper/issues/13, or mute the thread
https://github.com/notifications/unsubscribe-auth/ACnvZjxl4myoI2LQa_oTyRFw8TeIR44kks5tdQTqgaJpZM4SlpaZ
.

What do you propose for as work around? Maybe skill torrents if 0b in size ?

Skip

You can.  I usually don't show the size if size is 0
On Sun, Mar 11, 2018 at 1:46 PM, ash121121<EMAIL_ADDRESS>wrote:

Skip
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/AlphaReign/scraper/issues/13#issuecomment-372138646,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACnvZpx4nKLi3YTkdAs7wZ7tFJjSrZW8ks5tdXDsgaJpZM4SlpaZ
.

i managed to get this bug fixed if you liked to push to update yours?

That would be awesome!

Here you go. enjoy
indexer.zip

src_dist_index_js.zip
Here you go.

If you are familiar with git, you can fork this repo and create a pull
request with your changes.
On Mon, Mar 12, 2018 at 5:55 PM, ash121121<EMAIL_ADDRESS>wrote:

Here you go. enjoy
indexer.zip
https://github.com/AlphaReign/scraper/files/1804823/indexer.zip
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/AlphaReign/scraper/issues/13#issuecomment-372489733,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACnvZoLLyb4JZeVjvKUrlD1jgtcET0Cpks5tdvzZgaJpZM4SlpaZ
.

Sorry not used git that much :D

No problem
On Mon, Mar 12, 2018 at 6:07 PM, ash121121<EMAIL_ADDRESS>wrote:

Sorry not used git that much :D
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/AlphaReign/scraper/issues/13#issuecomment-372492229,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACnvZoLQlowM9_yMtiL2R8rADi8GXUrZks5tdv_JgaJpZM4SlpaZ
.


[ReadMe] Add directions to install packages & update filename

[ReadMe changes]

Added the directions to install the required packages as some users may not have them
Correct file name from Main.py to AirFlow.py

@MadhumithaKolkar


⚠ Bofrost.fr has degraded performance

In 261fd18, Bofrost.fr (https://www.bofrost.fr) experienced degraded performance:

HTTP code: 200
Response time: 2494 ms

Resolved: Bofrost.fr performance has improved in 2c62837 after 6 minutes.


[tutorials: getting started with e-link] add template description from api doc

I think we should move the explanation about @@@entity_uri@@@ and especially user defined parameters from the POST /e-link/templates of the interactive api doc, see last paragraph:

In fact, each template should have the field @@@entity_uri@@@ which identifies an entity. When performing enrichment...

to this paragraph of the e-link tutorial.
@jnehring what do you think?

Good idea! Please dont move it but copy & paste it.

I added a paragraph to What is a template.