« first day (3443 days earlier)      last day (1506 days later) » 
00:00 - 18:0018:00 - 23:00

12:48 AM
What's that thing called again when you have if condition1 or condition2 or condition3 and it doesn't compute condition2 nor condition3 if condition1 is true?
and 'breaks' early
 
short-circuiting
 
thanks, is it the default in Python?
 
try it for yourself? :P
 
I guess so
winning
 
yeah
@jigglypuff for some more substantial proof see the tutorial
 
12:59 AM
thanks, I'm just happy that I don't have to write some silly nested conditionals for a rather simple check
 
Are your expressions that expensive? Or do they mutate state?
Or would a failure trigger a division by zero or NameError or similar?
 
they do a http request
 
Don't you otherwise need the response? Please tell me you aren't using asspressions ;)
 
1:13 AM
I don't know what aspressions are, I'm checking if something exists using an API, ideally I'd be able to use just one request, but it wasn't designed that way
 
It's my petty name for assignment espressions
if (resp:=requests.get(endpoint1)) is not None or (resp:=requests.get(endpoint2)) is not None:
    print(f'Got {resp}...')
One of the very few valid use cases, but you didn't hear this from me
 
Well my laptop seems like it may be dying and not boot one of these days...time for Quarantinis
 
nah it's all good, I call a functions returning booleans
 
AMC
2:14 AM
IIRC people don’t lose the rep they gained from an answer if the corresponding question is later closed, right?
 
reputation is only lost if the answer/thread is deleted.
 
AMC
2:28 AM
@metatoaster Ugh
 
2:55 AM
that's why sometimes delete voting is necessary, for cases like upvotes to answers to a question that has a bajillion dupes
 
AMC
@metatoaster You would vote to delete the question in that case, right, not the answer?
 
The issue is that the question AND answer will also be deleted. This is why those with high enough reputations are chided for answering questions that have many other dupes (for "farming" easy reputations).
Also for not doing the expected moderation duties that are expected of them by the community.
But yes, the question will be voted to be deleted - the answers will too be deleted as a consequence (but it shouldn't reflect badly on the answerer).
 
3:25 AM
Hi did anyone created django GUI here?
 
4:02 AM
had some fun exploring all the ways to implement temporary files for an application
oh interesting, we can assign to a var within an expression now?
that's awesome!
i don't know how many time's i've wanted that
 
 
3 hours later…
6:53 AM
cbg
 
7:04 AM
cbg
@AndrasDeak I'll just put this on the "crazy things that happened in early 2020" tab
 
7:17 AM
that remind me, I got to think about scopes again, given the scoped-blocks talk the other day, and the fact that I liked pep572 so much because the initial design included closed scopes within the assignment expression. So, implementing ad-hoc scopes could be an interesting project for me to get to know the python codebase. Just getting something simple like this here shouldn't be too hard, right?
:my_scope:
    x = 1
print(x)  # name error
print(my_scope.x)  # works
then I could finally stop abusing fucntions for this kind of stuff
 
@stack with this kind of English you have to guess what it could probably mean. (s)he can't literally mean this so probably means that lol. i wish Python could understand my code like that, life would be a lot easier :D
 
@wim I know them as multisets. Python's equivalent of Counter seems a bit non-obvious for the question, though.
@Arne any hint on how you want to do that? I've only seen context managers and functions, which are all kinda stinky in their own way.
 
@MisterMiyagi Is that identical to Counter though? Wikipedia says "The cardinality of a multiset is constructed by summing up the multiplicities of all its elements. For example, in the multiset {a, a, b, b, b, c} the multiplicities of the members a, b, and c are respectively 2, 3, and 1, and therefore the cardinality of this multiset is 6." But len(Counter(...)) would give 3
 
7:34 AM
@MisterMiyagi no clue honestly, but it looks a little like a class definition, so I thought the building blocks should already be there.
 
@smci not identical, just equivalent. Counter.elements() gives a multiset-like representation.
@Arne So far I've mostly toyed with def plus call-decorator. Used classes for switch statements but nesting of scopes inside the class is the problem.
 
@MisterMiyagi haha, that looks glorious
 
yeah, you know you're up to something when you need type inspection, a metaclass and a custom class namespace. ^^
 
8:43 AM
Morning guys, any ideas how I can combine together these two images so the shoe is in the center ? Images have different sizes
 
trial and error?
funnily enough, it looks like the renders of the images here would do a very good job of being overlapped :P
if you want a logic based approach, my first thought would be to try to create some kind of bounding box, or some straight horizontal and vertical lines, such that they contain the shoe as tightly as possible. You could use a naive "take the background colour, scan left to right, stop where it breaks colours" kind of approach, or something more advanced, maybe contour based perhaps, there will be some good ideas on the internet.
Once you get your box/lines, you can figure out the central point, and just use that to adjust for the centre of the other image
Just first impressions though, there might be better ways to do this. But you might try that approach if you're out of ideas.
 
@ParitoshSingh I tried this :
from PIL import Image

import numpy as np

img = Image.open("final.png")
img_w, img_h = img.size

print(img.size)

background = Image.open("1.png")
bg_w, bg_h = background.size
offset = ((bg_w - img_w) // 2, (bg_h - img_h) // 2)

print(background.size)

# resize the image
size = (1080,1080)
background = background.resize(size,Image.ANTIALIAS)

background.paste(img, (0, 0), img)
background.save('3.png',"PNG")
but it's not in the center
 
cbg guys
 
you're pasting at (0, 0)?
 
yes, because i have no idea how to find the center of that 1080x1080
 
8:53 AM
disclaimer: im not really great at reading this kind of code, but it seems to me like that's your problem. at least attempt to account for where the centre should be somehow before just pasting it
find the centre of the background. find the centre of the image, paste such that they overlap.
 
ok, I'll keep looking into it...feel like PIL is lacking in intstruction of how to use it :(
 
this isn't really a PIL issue though, this is more of a math puzzle at this point
you know the width and height, you can figure out the centre
 
@AnotherUser31 have you tried just taking half of the image size?
 
you know the centre, you can figure out where to paste
(ps. as a hint, the centre of a line can be found by dividing it by 2.)
 
true...it's more about math...you're right...
 
8:58 AM
@AnotherUser31 you already compute offset, why don't you use it?
 
@MisterMiyagi no...didn't tried that...
 
cbg-ning
 
problem is, next shoe could have a different shape...bigger...so i can't have something predefined ....
background size 1080x1080 will always stay the same...
 
then compute it again for the next shoe oO
 
remember, we deal with variables, not just hardcoded numbers
for each image, just write the logic such that it does the correct calculations
 
9:04 AM
brrrrrr :) why so complicated :)))
@MisterMiyagi can't figure out how to compute the offset :(
 
what have you tried to compute the offset?
 
@MisterMiyagi background.paste(img, offset, img)
but the image doesn't look centered to me
looks like a bit lower....
or maybe it's just an illusion
:)
dunno
 
it's centred on the bounding box
 
that means it is centered or not ?
 
unless you want to compute the centroid, that's a centred as it gets
 
9:18 AM
i see...so it's good than..
alright
thank you very much
and sorry again for so many stupid questions :)
 
@AMC yes, especially since you can't delvote answers with a positive score
 
9:43 AM
@shad0w_wa1k3r are you around ?
 
I have this function:
def order_weight(s):
    return ' '.join([str(i) for i in sorted([int(i) for i in s.split(' ')], key = lambda x:(sum(int(i) for i in str(x)), len(str(x))))])
For input: "2000 10003 1234000 44444444 9999 11 11 22 123"
I am supposed to get: '11 11 2000 10003 22 123 1234000 44444444 9999'
But I am getting: '11 11 2000 22 10003 123 1234000 44444444 9999'
What I am missing, I specified the priorities.
First priority: the sum of digits of a number, like for 19 it is 1 + 9 = 10; Second priority is the length of the number, for 19 it is 2, for 100 it is 3
What am I missing?
 
@AjayMishra you are missing five more lines of code that make it readable
 
it would really help if your function wouldn't be one single expression of, oh, three comprehensions nested in themselves and a lambda
 
listen to the wise master
 
10:00 AM
def sumSt(x):
	return sum(int(i) for i in str(x))

def order_weight(s):
	intL = [int(i) for i in s.split(' ')]
	intL.sort(key = lambda x:(sumSt(x), len(str(x))))
	x = [str(i) for i in intL]
	return ' '.join(x)
Relatively more readable, now.
 
frankly, according to the problem description you gave, the "expected output" is wrong
10003 and 22 have the same sum of digits, but 22 has the lower number of digits. it must be first.
 
@AjayMishra your "supposed to get"... ^ that
 
Sorry, their problem description was unclear.
Second priority is first digit of the number, like for 19 it is 1. I know how do to that, thanks though.
 
10:16 AM
"thanks though" sounds as if we didn't solve your problem :)
 
I'm sure the rear view mirror is working much better than before!
 
@MisterMiyagi it's amazing what an oil change can do, hey? :)
 
hi should I use pure math which I have calculated myself using linear algebra to find the collision point of two lines (single row, about 15 O(n)) each update or create/use a vector class which seems overkill but is "easier" to read (will be hard either way)
 
@AndyK I'm now :-p better if you just ask. I'll answer once I'm back
@NicolasGervais closed
 
10:25 AM
@NicolasGervais you can use markdown for higher visibility, see also sopython.com/wiki/cv-pls
 
OK thanks guys. I'll look up your link immediately. I don't come to the chat often
 
@shad0w_wa1k3r hey !
thanks.
 
hi Andy
 
@shad0w_wa1k3r Hi!
Question is the following: once I've retrieved the rows from my database through an objects.all()
I can then display them
through my template
however, let's say you want to use the rows you've retrieved
and change them
 
okay, can you give me some pseudo code for what you want to achieve?
doesn't have to be correct, just wishful
 
10:32 AM
@shad0w_wa1k3r one sec
@shad0w_wa1k3r I've tried that hastebin.com/xocaferopo.py
in my views
line 28 to 31
the thing is I don't know in what type of storage should I store the results e;g lists, dict, else
 
Can you show me an example Denomination object?
You're going to iterate over it inside the template, so list is good. Now, just need to figure out what kind of list elements will be good.
 
sure
 
Also, ideally put the objects in a separate list, since you don't want to manipulate the DB here, just the representation (if I'm assuming correctly)
 
@shad0w_wa1k3r you are correct
 
If you don't mind, can I see the model class? Just the data doesn't give me much info.
 
10:38 AM
@shad0w_wa1k3r yes hastebin.com/aqelejujes.py
 
Also, when you do Denomination.objects.all(), your line is not a string, it's an instance of Denomination.
I suppose you are only concerned with denom_name, is this correct?
 
@shad0w_wa1k3r I knew something was missing. The error I had showed me this but I could no say where lied the issue
@shad0w_wa1k3r yes
 
give me 5 minutes, I'll give some sample code you can use that also explains things
 
@shad0w_wa1k3r cheers.
I was able to setup my page and display the row but suddenly, my nose is close to that wall and I have no idea on how to move around the wall
 
:) happens in unchartered waters
Just confirming, do you want to change the DB values at the same time? (line 31 tells me you're trying to do that)
 
10:45 AM
@shad0w_wa1k3r no for the db, actually, just the way to display it through my view and then template
 
@shad0w_wa1k3r cheers mate
looking at it and testing
 
Ideal approach should be considerably faster for large number of rows
 
@shad0w_wa1k3r it worked brilliant ...
one thing though, I have question :)
 
ask away
 
10:57 AM
can you explain this, please? all_denom_names = Denomination.objects.values_list("denom_name", flat=True)
for me, this line was definitely missing
 
if I'm understanding correctly, the object.all() do an instantiation of the rows for the model you have
however when you do a valuelist, it stores the data differently and you work with it
highly interesting
 
Yes. .all() (& similar methods) will result in Django not only retrieving data from the DB, but also creating instances of the model with the data.
> values() and values_list() are both intended as optimizations for a specific use case: retrieving a subset of data without the overhead of creating a model instance.
 
@shad0w_wa1k3r one question though: why are you creating a model instance? Is the aim to go faster and have all the rows ready to be displayed...?
 
In the ideal approach I've mentioned, I'm avoiding the creation of model instances, since we only need one particular column from the table
The other / first approach I've shown is merely to show otherwise how it usually works
 
11:04 AM
@shad0w_wa1k3r cheers mate. I'll read that particular part
 
you're welcome, just drop your questions (and ping me) if you have more doubts
Django can be a little overwhelming since it does quite a lot
 
@shad0w_wa1k3r it is a bit overwhelming especially the tutorials are limited to easy/discover part stuff. When you are going a bit deeper, trying more specific thing, things can be challenging. But again, many thanks for your help. I o u.
 
np, happy to help
 
11:43 AM
Hello, how are you ?
I am facing a problem.
I want to put sign up and sign in icon in navbar right.
 
@Sagor Hi, welcome to the Python room. Your question is out of topic here.
Please see our room rules - sopython.com/chatroom
There may be other rooms where your question might be more appropriate. Thanks.
 
Thank you.
I have read it
 
thanks
@Sagor if you haven't come across it yet, there's a HTML / CSS / Web Design room
 
12:13 PM
@wim ah, I misunderstood the purpose of the scope parameter. Thanks!
 
brief cbg
 
Played a little bit of Minecraft yesterday. Apparently in the last five years, they've implemented bees and llamas. The terrain generator still occasionally makes free-floating blocks, though. Good dev priorities there.
There was a time when free-floating sky islands were an intentional part of the algorithm, but I'm pretty sure that's not the case anymore
The tooltip for my sword says "deals 8 damage (when held in right hand)". This implies to me that you can hold things in your left hand, too. It'll probably take me a couple hours to discover which button does that.
 
12:35 PM
Yeah... it's certainly not the game I first started playing ~10 years ago for sure :)
 
1:04 PM
Minecraft Server live at mc.sopython.com if you've got too much free time :)
12
 
Capital. I think I'll drop by at 4:00PM EST / 20:00 UTC.
 
1:17 PM
i still dont really know what minecraft is :P I just know it's a game, and apparently it's a big thing
 
It's digital lego, except instead of your bratty sibling obliterating your buildings, an angry cactus man does it
If using multiplayer, s/instead of/in addition to/
 
oh, i see.
and i must admit, that was a surprisingly good explanation for how short it was
 
@ParitoshSingh That's Kevin for ya :)
Umm.... 2 months of Sky Cinema for £1... that's gotta be worth a punt even if only I ever get around to watching one film...
 
2:03 PM
Some of my clients are really suffering right now... one does a food delivery service for events/business lunches/meetings and has only had 2 orders this week compared to about 8/9 a day... and another who's a driving instructor has students cancelling and the examiners don't want to do driving tests right now... chaos...
although they're at least up to date with payments... just don't think they'll be asking for any further development work for a while...
 
@JonClements my friends are being hit financially by the covid, the ones who are having restaurants. The friend I'm thinking of, told me yesterday that without doing anything, the rent and the charges are costing her 8K euros. And because of the restriction, no income.
 
yeah... it's all very :(
 
2:52 PM
wow... that's confusing... taken a bit longer than I'd have thought to work out how to download the minecraft client... all I could see was "Buy Minecraft" - turns out clicking that tells you you've already bought it and then provides a download link...
 
The only way I could get a working client was to fire up my extremely out of date client and click the "your client is out of date, please download the new client" message
 
right - server does work... except it's night there and I walked into a creeper in under 30 seconds... good job me
 
Making an app with PyQt5 is fun and exciting while compiling said app into an executable that works on any platform is horrendous and excruciating :|
 
@Kevin ahh brilliant okay... was left with two hearts after a creeper and then pretty much < 1 minute later got slain by a zombie... great start...
 
2:58 PM
Huddling in a 1x1x2 hole until sunrise is peak Authentic Minecraft Experience
 
How do I tag a message here? Like [cv-pls]
 
ahh.. seems it's dawn now
 
[tag:cv-pls]
 
[tag: ... ]
 
2:59 PM
đź‘Ť
 
okay... can one no longer punch dirt blocks out of existence?
ah no you can... was doing it wrong... this is going so well
 
@Jon are we on a brand new map, or is the old one still around? Not that it matters either way to me, as I intend to find some unspoiled terrain regardless
 
it's brand new... I'm 90% sure I've still got the old map saved somewhere
somewhere being the bit I'm not sure of :)
 
Just as well, since bootstrapping up to a livable base is my favorite part of the game
 
ohhh... just hit a key and it moved stuff into a different hand
not sure which one it was
ahhh.... it's "F" :)
 
3:07 PM
What plants exist in Minecraft?
 
don't ask me... I just managed to die again...
 
I thought people lived for years
 
not this one it seems :)
 
Flowers, wheat, sugarcane, seaweed, trees
 
right... managed to just dig myself a small hole in a cliff face and left it there for now...
 
3:13 PM
Think I'll take a lunch break and pop in
 
3:24 PM
Go for it... don't forget to set me up a spareroom/kennel... else I'm going to be clicking respawn every 10 minutes :)
 
I think I'll put the guest room to the south of the breakfast nook
 
sounds like a plan...
right... can't remember - is magicalblender you?
 
yep
 
okay... did that work?
Okay... who's WillDodge!?
@Kevin and I saw that: [15:31:23] [Server thread/INFO]: <magicalblender> !create_mob("creeper", qty=10000, loyalty_to="magicalblender") :p
 
@JonClements Me, if this requires any real eye-hand coordination then I will be terrible. I want to build a mockup of the plant breeding experiment I am running this summer. Hopefully people will leave me alone and not kill me
 
3:33 PM
!erase_server_log(evidence_of="my thousand year reign of darkness")
Oops, wrong window
 
I don't think anyone has any intention of PvP here @Dodge :)
[15:33:53] [Server thread/INFO]: WillDodge was slain by Zombie Villager
[15:35:05] [Server thread/INFO]: <magicalblender> rip
[15:35:30] [Server thread/INFO]: WillDodge was slain by Zombie Villager
[15:35:36] [Server thread/INFO]: WillDodge lost connection: Disconnected
[15:35:36] [Server thread/INFO]: WillDodge left the game
@Dodge so it appears there's someone more bad at this than I am :p
 
I'm so pro, I only got half killed by mobs on the first night :-P
 
is it night again... I can't see anything where I am
 
I am left handed and have my mouse and everything set up that way, I am working out controls
 
The sun rose a couple seconds ago. It might be dark because I put a door on your cave.
 
3:39 PM
ahh ahhh yes.... and a furnace... melon
 
3:52 PM
Oops... That's not the plug I meant to take out the wall - that one was for the desktop... I'm thinking I'm cursed today or something
 
AMC
@AndrasDeak Oh, I understand why that restriction exists, but at the same time it's quite unfortunate sometimes.
 
@AMC any particular examples of where it's "unfortunate" - if there's a good reason for a positively scored answer to be deleted (like plagiarism or something) you can always mod-flag for it to be deleted...
@Kevin ugh... done by a zombie as well, hey? I suddenly don't feel quite so bad :)
 
He surprised me in my den
 
Max
4:07 PM
Hi Guys, I have a quick question: Can anyone recommend an online course to pick up python essentials coming from other programming languages? I mean a course, where it is assumed, that everyone knows, what loops, classes, linked lists ..... are.
 
umm... looking to purchase a little external monitor - how on earth is this actually worth that amount of money... you can buy a 90" 4K TV for less
 
Ok -- dug a little cubicle to hold my stuff, and my superdeep borehole project is underway. Good progress for a lunch hour.
 
cool stuff... might meet you there again later today then :)
I'll see how many times I can die before then for a laugh :)
[16:08:32] [Server thread/INFO]: WillDodge was blown up by Creeper
wow... we're all doing fantastically well...
 
Tomorrow we turn on hardcore mode, where if you die, you get permabanned
 
I'd win if being first out the game was a thing then :)
 
4:23 PM
I'm good at not being killed by monsters, but atrocious at PVP combat. I'd survive a couple nights, then fall to the roving PC killsquads
 
AMC
@JonClements any particular examples of where it's "unfortunate" Old, popular questions where the top answer(s) are quite poor, and fixing them would be a complete rewrite, not an edit.
I'll try to dig up some examples I had found.
 
anything wrong with just leaving a comment to note your observations? That way, it's a bit of a warning to future readers, and if you're lucky it might prompt the OP to make an addendum to their answer?
Can't believe minecraft is now $26.95 - think I got it for EUR 4.99 in 2012
 
I think I got mine for $15. After it was a silly shareware project and before the apex of its popularity
I still remember the "classic" servers which had no terrain generation features - just an empty 256x256x2048 cuboid that people would fill with whatever nonsense they desired
 
At the end of the day... I bet "Markus Persson" isn't exactly worried about financial things now :)
 
4:40 PM
I don't know who that is, but Minecraft's creator, Hatsune Miku, must have already been quite well off thanks to her already thriving music career
 
AMC
@JonClements Comments, especially on old answers, are not very visible. it might prompt the OP to make an addendum to their answer I think that has happened to me only once, usually OP is either long gone from the site, or they never see it/never respond.
 
@Kevin Perrson founded Mojang... think he made a billion or something from the sale to MS?
 
I'm not terribly fond of popular old answers that have a comment like "this hasn't been the recommended approach for years, nobody should do this", but it at least kind of works -- those comments tend to be upvoted and appreciated by readers, IME
 
@AMC guess it depends on how many comments there are (if they're hidden behind a "(show more comments)" - then yeah, but such things if noticed tend to get upvoted so it is visible... so at least it's there and if the answerer doesn't update, then oh well... c'est la vie
and I just got Kevin'd on part of that message :)
 
But perhaps for every upvote on the comment, there are a hundred users that never read it, and happily use the outdated solution
 
AMC
4:55 PM
@Kevin Yup.
 
if one goes around deleting "outdated solutions" - then we'd probably have to delete half the internet by now :)
 
AMC
Would that be a bad thing, though? ;)
 
I've never seen anything wrong with something being outdated kept as if there's other answers that are more modern, as long as something isn't going to be actively harmful (and there's otherwise a really good reason for deletion) then what does it matter it's kept for historical purposes?
For instance: we don't go deleting stuff like number_list = map(int, text.split()) because now in Python 3.x you have to do number_list = list(map(int, text.split())...
while py2 is end of life - it's still going to be around for quite a while yet in production systems etc...
 
5:24 PM
@Max Well, the official Python tutorial assumes you already know how to program, most likely in C or a language of that family. For more advanced stuff, see Dive Into Python. We also have a short list of recommended tutorials: sopython.com/wiki/What_tutorial_should_I_read%3F
 
Ugh. Noticed a perfect wifi signal from next door. Asked my mum if she could go talk to them and ask if we can use their connection and I'll just pay their bill to try break this pointless standstill. "The husband is really weird... but the wife is nice. I'll ask tomorrow". I'd do it myself but she knows them well so has a decent chance. I was very tempted to just have a strop and storm to my room :P
 
5:36 PM
@roganjosh for an interim - can you not use your phone as a hotspot?
unless you're going to be wanting to stream HD video constantly or do massive downloads - it does kind of work
 
Yeah, that's what I'm doing but I have a few plugins for VSCode that I wanna install and I only have 15GB so it could be quite heavy. Plus it runs about 20kb/sec out here. The whole plan when the house I was renting got sold was to move in here and out the rent away for a deposit to buy... but this issue is getting a little tough to cope with lol
 
20kb/sec!?
 
Cabbage!
 
cbg @Johnston!
 
Long time no see
 
5:41 PM
it is - how are you?
 
So far so good! How about you? Staying safe?
 
I'm pretty much a hermit anyway so think so? :p
 
@JonClements out in t'hills
 
Amen
 
have a good evening guys
rb , c u tomo
 
5:43 PM
@roganjosh ahh... strangely get a bit of a better bandwith on 4g than I do from my broadband at times
 
In Apple's AuthenticationServices classes they have a `ASAuthorizationAppleIdRequest` `user` object
https://developer.apple.com/documentation/authenticationservices/asauthorizationappleidrequest/3153041-user
A sample of this unique ID looks like this:
`000722.49ee6c8ae54547ec864c49c772e1d4fd.1930`

Does anyone happen to know the way it would be derived?
 
@AndyK you too - take care and stay safe!
 
Just by looking at it
 
@Johnston Looks like you don't need to derive it, because Apple sends you one inside an ASAuthorizationAppleIDCredential instance
 
I can see it but I'd like to use the same UID generation myself
 
5:45 PM
any reason why?
 
I really just need a way to create a cryptographically secure uid
 
have you looked at the uuid module ?
 
AFAICT it's not cryptographically secure
Like it's guaranteed unique but not secure
 
I'm not too versed on cryptography. What counts as "secure" in this context?
 
err... an ID doesn't need to be secure... it just needs to be unique
what is it you're trying to do?
 
5:48 PM
Right. But like ID 1 would be easy to say: oh there's probably a 2
I need to send the user's ID in a JWT as an access token
 
If "secure" means "hard to reverse the algorithm that derived the id from the user's information", then I don't think you can have that and guaranteed uniqueness
 
right... but you validate on the backend whatever ID you produce/is sent back they have permission for
 
The tokens will already be secured by a secret
So you'd need the server secret to open it.
 
so err, what's the problem with just using an auto-incrementing ID
 
Technically it will be safe... But it would add another layer of security if the user's ID ever got out somehow... people wouldn't be able to do anything with it
They wouldn't be able to derive another user id from that user id.
 
5:50 PM
well, even if it got out, depending how you handle authorisation, they wouldn't be able to do anything with it anyway
 
Right
They wouldn't
 
unless they also got the token from the client
 
What can they do with it if you don't implement any security? What's the attack vector here?
 
Even then
 
The bad guy discovers my user id is "2". What do they do next?
 
5:51 PM
I don't think there is an attack vector that I can think of
They'd say "Oh Johnston used autoincrementing IDs, what a noob"
This is all overkill. I guess lol
 
definitely not needed imho (and experience)
 
I'm inclined to agree
 
None of this is to say that in general a system is secure if you can't think of a specific way in which it's vulnerable, mind you
 
Right of course
 
I always assume bad guys are more creative than I am
 
5:52 PM
I could put the user ID in a sign JWT
Which would be in a JWT
So a JWT in a JWT.
lol
That's stupid
 
talk about overkill (and pointless)
 
40 JWT's deep lies the User's ID
Each signed with a different secret
 
now you're just going mad :)
 
Each secret is stored in a vault in a different country.
OK well thank you
 
heck - the weakest point is keeping the signing key private
 
5:55 PM
What do you mean?
 
doesn't matter what you have in the JWT
@Johnston well... how secure is your server... could I get into that easily enough to get your key?
 
It's running on AWS EKS.
It's secure. I'm currently having it pentested this minute!
You aren't getting the key (in theory) because it's not stored on the server. It's encrypted using KMS and stored in AWS HSM.
 
The key is stored at the center of my stronghold on the astral plane
 
hahaha
Yeah. I mean in theory you aren't getting the key. So does that change your equation?
 
00:00 - 18:0018:00 - 23:00

« first day (3443 days earlier)      last day (1506 days later) »