10,000 Matching Annotations
  1. Jan 2022
    1. it depends on the application but generally, if an authenticated user doesn't have sufficient rights on a resource, you might want to provide a way to change credentials or send a 401.

      A 403 doesn't tell the client / user agent what the next step is or provide a way to change credentials.

      So maybe a 302 redirect is the best answer after all? Even though it sadly lacks the nice semantic distinction that 401/403 provide...

    2. The statement is "If the request already included Authorization credentials". That means if this is a response from a request which provided the credential (e.g. the response from a RFC2617 Authentication attempt). It is essentially to allow the server to say, "Bad account/password pair, try again". In the posed question, the user is presumably authenticated but not authorized. 401 is never the appropriate response for those circumstances.

      See my comments in https://hyp.is/p1iCnnowEeyUPl9PxO8BuQ/www.rfc-editor.org/rfc/rfc7235

    3. The RFC2617 model is one-user, one-credentials so the case where the user may have a second set of credentials that could be authorized may be ignored. It neither suggests nor implies that some sort of login page or other non-RFC2617 authentication protocol may or may not help - that is outside the RFC2616 standards and definition.
    4. There's a problem with 401 Unauthorized, the HTTP status code for authentication errors. And that’s just it: it’s for authentication, not authorization. Receiving a 401 response is the server telling you, “you aren’t authenticated–either not authenticated at all or authenticated incorrectly–but please reauthenticate and try again.” To help you out, it will always include a WWW-Authenticate header that describes how to authenticate.
    5. So, for authorization I use the 403 Forbidden response. It’s permanent, it’s tied to my application logic, and it’s a more concrete response than a 401. Receiving a 403 response is the server telling you, “I’m sorry. I know who you are–I believe who you say you are–but you just don’t have permission to access this resource. Maybe if you ask the system administrator nicely, you’ll get permission. But please don’t bother me again until your predicament changes.”
    6. status code 401 has been removed from that RFC

      Well, technically it is still mentioned,

      1. in an example
      2. with a reference to RFC7235

      It just doesn't have a whole section about it in this RFC. But I think that's not because it's trying to say that it's no longer needed/useful, but rather because this new RFC has nothing to add about it /doesn't feel it necessary to clarify anything about 401s. That's why it simply links to the previous RFC for information about 401.

    7. +----------------------- | RESOURCE EXISTS ? (if private it is often checked AFTER auth check) +----------------------- | | NO | v YES v +----------------------- 404 | IS LOGGED-IN ? (authenticated, aka user session) or +----------------------- 401 | | 403 NO | | YES 3xx v v 401 +----------------------- (404 no reveal) | CAN ACCESS RESOURCE ? (permission, authorized, ...) or +----------------------- redirect | | to login NO | | YES | | v v 403 OK 200, redirect, ... (or 404: no reveal) (or 404: resource does not exist if private) (or 3xx: redirection)
    8. Special case: Can be used instead of 404 to avoid revealing presence or non-presence of resource

      eh? instead of 404? I would actually say that:

      • 404 is as good or better at avoiding revealing presence or non-presence of resource; probably better because 401 implies that we found the resource but that they needed to be signed in in order to access
      • normally one would use a 404 instead of a 401/403 (usually instead of a 403) to avoid revealing presence or non-presence of resource.

      I think they know which is the correct, as evidenced by how they said about 404 below: "User/agent known but server will not reveal anything about the resource, does as if it does not exist." — I think this must have just been a typo.

  2. datatracker.ietf.org datatracker.ietf.org
    1. User agents are advised to take special care in parsing the field value, as it might contain more than one challenge, and each challenge can contain a comma-separated list of authentication parameters. Furthermore, the header field itself can occur multiple times.
    1. Next, let’s say that your ticket is correct (so you made through security just fine!) and the gate number in your ticket says “Gate 24” but you walk to Gate 27. The attendant cannot authorize you to go through that gate because it’s not the right gate for your ticket.

      They have these mixed up! (Which is understandable, because 401 is misnamed "Unauthorized but should be named "Unauthenticated")

      Checking if authenticated (which, if it fails the check, should return 401 for authentication error) comes first,

      and then checking if authorized (which, if it fails the check, should return 403 for authorization error)

      See https://hyp.is/wRF7wHopEeynafOqKj81vw/stackoverflow.com/questions/3297048/403-forbidden-vs-401-unauthorized-http-responses

    2. In other words, an “incorrect ticket” is similar to messing up your credentials: wrong username and/or password and you receive back a 403 Forbidden. Using the correct credentials but trying to access a resource that is not allowed for those credentials returns you a 401 Unauthorized.

      They have these mixed up! (Which is understandable, because 401 is misnamed "Unauthorized but should be named "Unauthenticated")

      Checking if authenticated (which, if it fails the check, should return 401 for authentication error) comes first,

      and then checking if authorized (which, if it fails the check, should return 403 for authorization error)

      See for example https://www.loggly.com/blog/http-status-code-diagram/

    3. You can also think that 403 happens before 401, despite the natural number order: you will not receive a 401 until you resolve a 403.

      They have these mixed up! (Which is understandable, because 401 is misnamed "Unauthorized but should be named "Unauthenticated")

      Checking if authenticated (which, if it fails the check, should return 401 for authentication error) comes first,

      and then checking if authorized (which, if it fails the check, should return 403 for authorization error)

      See for example https://www.loggly.com/blog/http-status-code-diagram/

    4. If the ticket is incorrect or damaged, you cannot even go through the airport security: when they check your ticket, it will be refused. You are Forbidden to enter the boarding area of the airport.

      It depends what we mean by "incorrect"/damaged "credentials ("ticket")...

      A. If they are invalid or incorrect in the sense that we can't authenticate them as anyone (as it sounds like you mean with "incorrect" or "damaged") (they're not a user in our database or the password doesn't match a user in our database), then you should actually use 401, meaning that the client can/should try (again) to authenticate with different credentials.

      B. But if by "incorrect" you mean (as it sounds like you mean with "you cannot even go through the airport security: when they check your ticket, it will be refused") that the credentials were valid enough to authenticate you as someone (a user in our database), but that (known( user has insufficient credentials, then correct, it should be a 403 forbidden.

      It's even easier to explain / think about if you just think of 401 as being used for any missing or failed authentication. See:

  3. datatracker.ietf.org datatracker.ietf.org
    1. You’d like to access the content of the resource but you’re not logged in (so not authenticated yet). The server will return you a 401 error. You need to log in to be able to access the resource.
    2. You’d like to delete the user, but you’re authenticated as a regular user, not as an admin. The server doesn’t allow regular users to perform such requests, so in the result, the server will send you a 403 error. Re-authentication won’t make any difference.
    1. Now, assume your client attempts to access a resource that it MUST NOT access at all, for example, because it belongs to another user. What status code should your API return? Should it return a 403 or a 401 status code?You may be tempted to return a 403 status code anyway. But, actually, you can't suggest any missing permission because that client has no way to access that resource. So, the 403 status code gives no actual helpful information. You may think that returning a 401 status code makes sense in this case. After all, the resource belongs to another user, so the request should come from a different user.However, since that resource shouldn't be reached by the current client, the best option is to hide it.
    2. Let's explore a different case now. Assume, for example, that your client sends a request to modify a document and provides a valid access token to the API. However, that token doesn't include or imply any permission or scope that allows the client to perform the desired action.In this case, your API should respond with a 403 Forbidden status code. With this status code, your API tells the client that the credentials it provided (e.g., the access token) are valid, but it needs appropriate privileges to perform the requested action.
    1. The key thing about the REST approach is that the server addresses the client state transitions. The state of the client is almost totally driven by the server and, for this reason, discussions on API versioning make little sense, too. All that a client should know about a RESTful interface should be the entry point. The rest should come from the interpretation of server responses.
    1. "links": { "deposits": "/accounts/12345/deposits", "withdrawals": "/accounts/12345/withdrawals", "transfers": "/accounts/12345/transfers", "close-requests": "/accounts/12345/close-requests" } } } The response contains these possible follow-up links: POST a deposit, withdrawal, transfer, or close request (to close the account).
    2. The client transitions through application states by selecting from the links within a representation or by manipulating the representation in other ways afforded by its media type. In this way, RESTful interaction is driven by hypermedia, rather than out-of-band information.
    1. The combined stuff is available to components using the page store as $page.stuff, providing a mechanism for pages to pass data 'upward' to layouts.

      This is very interesting, and something I missed before. At first it sounded like stuff was only for higher level layouts to pass down to lower layouts and pages. But now you're telling me it is bi-directional, and also lets you pass stuff from pages up to higher layouts?!

    2. Code that is per-component instance should go into a second <script> tag.

      But this seems to conflict with https://hyp.is/NO4vMmzVEeylBfOiPbtB2w/kit.svelte.dev/docs

      The load function is reactive, and will re-run when its parameters change, but only if they are used in the function.

      which seems to imply that load is not just run once for the component statically, but rather, since it can be reactive to:

      url, params, fetch, session and stuff

      may be sufficiently like a per-instance callback, that it could be used instead of onMount?

    1. import { goto } from '$app/navigation'; function routeToPage(route: string, replaceState: boolean) { goto(`/${route}`, { replaceState }) } replaceState == true will replace the route instead of adding to the browser history. So, when you click back, you will not go back to the route you came from.
    1. For given hash, OpenStruct constructor only converts its top level keys.require 'ostruct' h = { foo: { bar: 1 } } obj = OpenStruct.new(h) obj.foo # => { bar: 1} obj.foo.bar # => NoMethodError: undefined method `bar' for {:bar=>1}:Hash
    1. It's worth noting that an error can coexist and be returned in a successful request alongside data. This is because in GraphQL a query can have partially failed but still contain some data. In that case CombinedError will be passed to us with graphQLErrors, while data may still be set.
    1. I just got caught out by realising I wasn't wrapping my component in a <Provider> that provides our own GraphQL client because the default context value is a urql client. I get why this is a good default out the box for getting started, but I'd love to disable that so that we can ensure all our components are wrapped with a provider that exposes our custom client.
      • defaults

      • disable defaults/safeguard to make sure you always provide a value

    1. Exchanges are bi-directional. So suppose you have the default order: [dedupExchange, cacheExchange, fetchExchange], then an operation describing the GraphQL request, which is only the intent to send a request, goes from outer to inner, or left to right. It'll reach dedup first, then cache, then fetch. This is the operation stream. The operation result stream goes the other way. fetch might emit a result, which is seen by cache, and then seen by dedup. This is a little abstract and we will need some visuals to make this an accessible concept to everyone. This is how it works because every exchange receives a stream of operations. It can then transform this stream and call forward with an altered stream (so every exchange has full control over filtering, mapping, reducing, timing of operations). Furthermore, every return value of an exchange is a stream of results. This means that the simplest exchange just forwards all operations and returns an unaltered stream of results: ({ forward }) => ops$ => forward(ops$). For your "error exchange" (which we should probably provide by default?) this means that it must come before the fetch exchange: [dedupExchange, cacheExchange, errorExchange, fetchExchange] Specifically, it won't need to alter the operations probably, but it will need to look at the results from the fetchExchange which means it must be outside fetch or come before it. Here's an example of a simple implementation of such an exchange: import { filter, pipe, tap } from 'wonka'; import { Exchange } from 'urql'; export const errorExchange: Exchange = ({ forward }) => ops$ => { return pipe( forward(ops$), tap(({ error }) => { // If the OperationResult has an error send a request to sentry if (error) { // the error is a CombinedError with networkError and graphqlErrors properties sentryFireAndForgetHere() // Whatever error reporting you have } }) ); };

      exchange

    1. It’s important to understand that an implements clause is only a check that the class can be treated as the interface type. It doesn’t change the type of the class or its methods at all. A common source of error is to assume that an implements clause will change the class type - it doesn’t!
    1. My case is that I have a component which takes an object as a prop. As the user changes the object's values, they can either Save or Cancel. So in the component I have two variables: value and valueUnsaved. It's similar to the example on my comment above. To avoid mutating the original object directly, I assign valueUnsaved as a deep clone of value. If value is changed outside of the component, valueUnsaved should be updated.
    2. updating b should update a as well. updating a will update b back again in the reactive declaration.

      don't quite understand.

      how could this ever update a?

         $: b = a * 2;
      
    3. For me there is a distinct difference between these two scripts: let a = 1; $: b = a * 2; let a = 1; let b; $: { b = a * 2 }; The first example defines a "recipe" for how to create b and b is completely defined by that declaration. Outside of that it is immutable, data flows only into a single sink. The second example declares a variable b and then uses a reactive statement to update it. But it also allows you to do with b whatever you want. If someone wants to go that route (definitely not me), they are free to do so at their own risk of ensuring consistency.
    1. I still cannot get over the fact that this is not mentioned in the documentation. I do not want to sound negative or unappreciative towards the work that went into this tool (because it has many awesome parts and awesome people working on it and contributing to it), but I do feel kind of let down that "basic" internal mechanics are not explained at all. You either have to find them out yourself or hope some other programmers did and wrote an article about it.
    1. I'm not sure what behaviour it is that you expect. "$; foo = bar.a" means that you expect foo to always be whatever bar.a is, and "bind:value={foo}" means that you expect foo to to be whatever has been entered in the input. It can't be both!
    1. Oh, I just figured out a workaround for my project, in case it helps someone. If you want the source of truth on the prop to come from the child component, then leave it undefined in the parent. Then, you can make the reactive variable have a condition on the presence of that variable. eg: <script> let prop; $: prop && console.log(prop); </script> <Child bind:prop/> Might not work for every use case but maybe that helps someone.
  4. www.metacritic.com www.metacritic.com
    1. Absolutely shockingly awful game from a company that puts out poor quality games. And furthermore, tries to sue YouTubers who don’t like their games for ‘slander’. Shocking games and shocking developers. Avoid at all costs.
    1. When you give an element a width of 100% in CSS, you’re basically saying “Make this element’s content area exactly equal to the explicit width of its parent — but only if its parent has an explicit width.” So, if you have a parent container that’s 400px wide, a child element given a width of 100% will also be 400px wide, and will still be subject to margins, paddings, and borders — on top of the 100% width setting.
    1. In the "When sending message, automatically" section, uncheck "Place a copy in."

      This seems inconsistent (since we do specify a folder for Drafts), but I confirmed that it still gets stored in Sent even after unchecking this. I guess because Gmail adds the Sent tag on the server, whereas with a draft, it is initiated client-side so the client has to be responsible for adding that tag.

    1. So if you subscribe to both Inbox and All mail you are in practise downloaded your mails twice. If you then delete a mail in inbox it doesnt go away in All mail. It just get the trash-tag. In my opinion you should never subscribe to All mail. You never need to see it. All you need to see are INBOX, TRASH, SENT and the folders YOU created in your gmail-account.
    1. Thunderbird determines connection details (such as ports, server names, security protocols, etc.) by looking up your email provider in a database that contains connection information for all the major Internet Service Providers (ISPs). After determining the provider of your account (as specified after the "@" symbol in your email address) Thunderbird can usually provide the account details.
    1. When you initially logon with OAuth2, you will be redirect to Google’s sign-in page,. Once you have signed in, Google issues you a special OAuth2 token which is saved in Thunderbird and can be seen in the same place as passwords. So when you next logon to gmail, it is using that unique OAuth ID instead of password.
    1. Thunderbird provides the ability to archive messages - that is, to move them from the default folders to archive folders without deleting the messages altogether. This makes it easy to organize archives or move them to a backup device, and keep the Inbox clean. Messages can only be archived manually, not automatically.
    1. Even if you didn't intentionally make any changes, please check that this setting is enabled.

      Similarly...

      I noticed in 2 of the 3 accounts I had set up in Geary that IMAP access was disabled. I don't remember disabling it.

      Geary had downloaded from all 3 of these accounts on 2021-12-15, but was not able to today 2022-01-10.

    2. If there is still a problem, try clearing Captcha again.  I acknowledge you wrote that you already did this, but you must open that page using the account that you are setting up in Thunderbird.  If you are signed into multiple Google accounts, the page will open with the primary account.  To be certain that you have used the correct account, please try again after signing out.

      This is a real usability issue.

      That page (https://accounts.google.com/b/0/DisplayUnlockCaptcha) doesn't even tell you which account is active or give you any way to switch.

      As a guess, I tried changing the number, like this: https://accounts.google.com/b/3/DisplayUnlockCaptcha to the same number as I saw in the URL for the account that I wanted to affect: https://mail.google.com/mail/u/3/#inbox and I think it worked (but again, no way to know for sure which account was affected).

    1. “Money corrupts; bitcoin corrupts absolutely. Disregarding all of bitcoin's shortcomings, a financial instrument that brings out the worst in people—greed—won't change the world for the better.” —https://www.cynicusrex.com/file/cryptocultscience.html.
    1. The highest rating Pure Health Fungus Eliminator got on Amazon is 4.0/5 stars. Meanwhile, it got 4.9 stars out of 5 on its official website. I’m not saying that the higher rating is entirely biased. But I just think that we get to see more honest reviews outside its site.
    1. I wish there's some kind of an optional ghost or something that I can follow after a while to teach me why I cannot get past a certain area.

      I've wished for this in Mario Maker 2, esp. since you can't just open the level in the editor to see where to go like you could in MM1.

    1. Out-of-band communication may even be by beeps from the PC speaker on the server's Motherboard.

      Huh? Please elaborate. Why/when would it do this? Who would be there to hear the beeps?

    1. Your character feels nigh impossible to control - you move very very fast, but if youre in the air, you dont stop moving the moment you stop holding a direction, so you have to constantly cancel out your momentum to stop, but if you dont do it perfectly you suddenly fly in the other direction
    1. I bought this game in order to review it, seeing as there were no current reviews for it. I thought I'd help the game out by maybe giving it that tiny bit of publicity it needed to get off the ground.
    1. A good riddance from the ultra realistic modern 2021 games . Or maybe its my personal opinion that most games towards the better side should be like 16-bit only. It certainly took me back to the era of Nintendo when I frankly used to enjoy gaming the most. The look and feel of Tobe's quite resonates with good old konami games, Contra, adventure island, Super Mario, Circus Charlie, Dangerous Dave.
  5. Dec 2021
    1. A plumber was a man who used lead for many reasons. Since lead was very malleable and had a low melting temperature it was employed quite a great deal to seal and repair.Pipes used to be connected and secured just as they are at present, although now we use plastics or ceramics.
    2. One may think that the pipes leading to the sink, and the job of installing or maintaining them is described as plumbing since pipes were previously made with lead and the Latin word for lead was plumbum (consequently the elemental letters Pb).While this fact is absolutely valid, it is additionally true that plumbers were once employed in additional ways than installing pipes when the phrase plumber originally became popular in French then English within a century around the 14th Century A.D.
    3. Furthermore, lead is very weighty and so it was often used in the role of a weight. At the end of a twine hung to be certain of a perpendicular line it is described as a plumb bob. Persons in charge of water workings earlier than the era of dependable pressure systems had to fall back on on gravity defined methods and so accurate lines and levels were essential.
    1. The diagram raises an interesting question which you may not have thought about before. How does all the information from the internet get to the right device inside the network? If you visit howtogeek.com on your laptop how does it end up on your laptop and not your son’s desktop if the public-facing IP address is the same for all devices? Advertisement pagespeed.lazyLoadImages.overrideAttributeFunctions();tmntag.cmd.push(function(){tmntag.adTag('purch_Y_C_0_1', false);}); This is thanks to a wonderful bit of routing magic known as a Network Address Translation (NAT).

      may not have thought about before

    1. We tag and release gems according to the Semantic Versioning principle. As a result of this policy, you can (and should) specify a dependency on this gem using the Pessimistic Version Constraint with two digits of precision.

      you can (and should)...

    1. Nested contexts tags are overwritten not merged: TestProf::LetItBe.configure do |config| config.default_modifiers[:freeze] = false end context "with reload", let_it_be_modifiers: {reload: true} do # uses freeze: false, reload: true here context "with freeze", let_it_be_modifiers: {freeze: true} do # uses only freeze: true (reload: true is overwritten by new metadata) end end

      good clarification

    1. It's well-suited for dev/test since it doesn't need an external infrastructure, but it's a poor fit for production since it drops pending jobs on restart.

      .

    1. declaration accepts: | null | [] | [null] | [{foo: 'BAR'}] ------------------------------------------------------------------------ [Vote!]! | no | yes | no | yes [Vote]! | no | yes | yes | yes [Vote!] | yes | yes | no | yes [Vote] | yes | yes | yes | yes
    2. [Vote!]! means that the field (in this case votes) cannot return null and that it must resolve to an array and that none of the individuals items inside that array can be null. So [] and [{}] and [{foo: 'BAR'}] would all be valid (assuming foo is non-null). However, the following would throw: [{foo: 'BAR'}, null] [Vote]! means that the field cannot return null, but any individual item in the returned list can be null. [Vote!] means that the entire field can be null, but if it does return a value, it needs to an array and each item in that array cannot be null. [Vote] means that the entire field can be null, but if it does return a value, it needs to an array. However, any member of the array may also be null.
    1. I could look into this more to understand where things are going wrong, if you can suggest to me which part of the way this is working might be off.

      where even to look?

    2. Besides that configuration, SvelteKit is just a normal Vite project that does rendering on both SSR and client-side.

      "is just..."

      This description makes it sound simple

    1. Just import it the normal way. Then Vite can use the CJS version on the server-side and ESM version on the client-side. Forcing it to always be ESM breaks SSR with the latest SvelteKit.

      .

    1. The code isn't going back to the way it was So otherwise you'll be stuck on an old version forever...

      In reply to:

      PS. I will stay with 144 for a while...

    1. So, underscores are not quite as good as spaces. They’re a compromise of language, readability, and semantics, but they’re the best we’ve got. Better than dashes, CamelCase, plus+signs, or anything else. So use them.
    1. The product may not be compatible with routers or gateways with firmware that has been altered, is based on open source programs, or is non-standard or outdated

      It what way? Why not? Wouldn't it just connect to them with standard Wi-Fi protocols like any other device?

    1. Just FYI, there is a nice way to "expect a change" in RSpec. You don't have to use it, what you have is fine, just thought I'd share. expect { widget.paper_trail.update_columns(name: "Bugle") }.to(change { widget.versions.length }).from(1).to(2)
    1. Wait, I'm still interested in a solution to this problem/need! (no activity doesn't necessarily = no interest. I totally understand if the maintainers just aren't interested in implementing this and would rather someone submit a PR... but would it have been any different if I'd pinged this thread every 5 months to show continued interest? )

      no activity doesn't = no interest

    1. If you want to restore the old behavior (thus not reaching level AA), you can apply the following diff: -<Tooltip> +<Tooltip disableInteractive> # Interactive tooltips no longer need the `interactive` prop. -<Tooltip interactive> +<Tooltip>

      How would you even apply this "diff"? I assume this is supposed to just be a hint for what you should look for and either manually or automatically do a global search and replace for (no search and replace tool that I know of accepts a diff instead of search and replace strings, but I guess they are functionally the same thing).