|
*Ignore this terrible snipe.
Hughmoris fucked around with this message at 21:44 on Apr 5, 2020 |
# ? Apr 5, 2020 21:38 |
|
|
# ? Jun 8, 2024 06:05 |
|
https://stackoverflow.com/questions/61063114/how-do-i-find-the-attributes-of-the-chrome-security-certificate-window-for-autom I posted this on Stackoverflow, but may as well post it here since we are all working from home because of COVID. I am making use of my glorious "WFH until the end of days" time transitioning the automated tests to work with well...everything. I ran into a problem with the Chrome Certificate Select security window not working with AutoIT or anything. I need some help trying to identify the name of this goddamn security window so I can bypass it or finding a way to interact with it at all. The goal here is to get to the Cancel Button or get an ESC keypress to go through programmatically so the window moves onto the dev environment. Why the dev environment needs to have the CAC Card dialogue show up at all is beyond me. I tried a bunch of things like creating a Chromewrapper class that uses the Runtime.InteropServices lib to spam this thing with SendMessege, but nothing works because as far as I can tell because once Selenium webdriver hits that "I Accept The Terms" button and the Cert window pops up, all code just hangs. The Debugger can't step into anything. It just treats the rest of the code like it doesn't exist. They also won't give me a soft cert to use for this so I am kinda just....stuck on how to proceed here. In IE we just used AutoIT to send "ESC" or a series of TABs then Enter, to nav to the Cancel Button, but as far as I can tell this window just doesn't exist and nothing can inspect it or see it(for security reasons I am sure.) Can anyone help me out here?
|
# ? Apr 6, 2020 21:08 |
|
friendbot2000 posted:https://stackoverflow.com/questions/61063114/how-do-i-find-the-attributes-of-the-chrome-security-certificate-window-for-autom https://blogs.sap.com/2014/01/30/avoid-certification-selection-popup-in-chrome/ Seems relevant?
|
# ? Apr 6, 2020 22:32 |
|
friendbot2000 posted:https://stackoverflow.com/questions/61063114/how-do-i-find-the-attributes-of-the-chrome-security-certificate-window-for-autom If you run fiddler you can configure it to ignore certificate errors / reply with a specific certificate without prompting. Fiddler's actually pretty useful to have running when doing automated test stuff anyway.
|
# ? Apr 6, 2020 22:42 |
|
Cuntpunch posted:https://blogs.sap.com/2014/01/30/avoid-certification-selection-popup-in-chrome/ Hmmm...I read that post before in my search and its not quite the solution because it involves selecting a specific certificate and they won't shell out for a soft cert for me just yet. In order to get past the dialogue, I have to hit cancel on the "Select Certificate" box to get to the bypass "backdoor" we created...for reasons unknown. I will hold the decision to implement CAC Card functionality to be "more like production" on internal dev/test environments against the dude who implemented it till the day I die. I did find something interesting here though: https://github.com/SeleniumHQ/selenium/issues/5408 Here someone points out that Selenium hasn't finished the Navigate().GoToUrl(...) action yet, which is true because it's stuck in limbo at the auth tier. That is why no code after the action that makes the cert box appear executes. That checks out because that loading icon on the browser tab runs in perpetuity until you close the tab. It doesn't solve my problem, but it's a possible clue? I am just not sure what to do with the said clue. Like, in IE you have the same scenario with the same loading tab, yet you can interact with the Security Cert Popup with AutoIT, why it doesn't work that way in Chrome is what's confusing to me. friendbot2000 fucked around with this message at 02:57 on Apr 7, 2020 |
# ? Apr 7, 2020 02:50 |
|
Why don’t you just import the certificate you’re using into the system certificate store? Chrome should then trust it by default. Alternatively, I think there’s a way to launch chrome in an insecure mode. Google tells me —allow-running-insecure-content. You could try that. Jen heir rick fucked around with this message at 03:52 on Apr 7, 2020 |
# ? Apr 7, 2020 03:43 |
|
Jen heir rick posted:Why don’t you just import the certificate you’re using into the system certificate store? Chrome should then trust it by default. The issue isn't insecure host certs, it's that he's testing a site which uses client certs for auth, and so the browser wants to know *which* of your local certs you are going to use to auth.
|
# ? Apr 7, 2020 15:45 |
|
If I don't have admin rights for a Windows 10 machine, what are my options for learning C#? I have a lot of downtime currently at my job. I have vscode installed but I can't install the dotnet sdk and trying to manually compile my cs file using csc.exe is failing as well.
|
# ? Apr 7, 2020 17:27 |
|
Hughmoris posted:If I don't have admin rights for a Windows 10 machine, what are my options for learning C#? Some cloud solution probably. At my old job when Accenture bought us out they came in with super draconian PC monitoring software and we couldn't even run Visual Studio for weeks. Nobody figured out a workaround, it was a fun few weeks.
|
# ? Apr 7, 2020 17:34 |
|
Hughmoris posted:If I don't have admin rights for a Windows 10 machine, what are my options for learning C#? A second machine :/
|
# ? Apr 7, 2020 17:38 |
|
Hughmoris posted:If I don't have admin rights for a Windows 10 machine, what are my options for learning C#? https://dotnetfiddle.net/
|
# ? Apr 7, 2020 17:41 |
|
friendbot2000 posted:https://stackoverflow.com/questions/61063114/how-do-i-find-the-attributes-of-the-chrome-security-certificate-window-for-autom So I decided to say "gently caress it" and do some weird as environment hacky poo poo to solve the problem I am having with the "Select a Cert" window I mentioned above. I quoted my post for context. So my goal now is to try to programmatically insert a cookie into Chrome that says I have already clicked the "Cancel Button" on the Select a Cert Window shown here: https://imgur.com/5lRnPa0 As mentioned above, clicking the Cancel Button redirects the browser to a backdoor where developers and testers can login and bypass the Auth Tier for the application and sign in without test user ids etc. I need a cookie that remembers I have already done that and keeps it in the browser in perpetuity. The trouble is...I am not sure its possible to do that and I haven't really messed with cookie generation before. Does anyone have any suggestions or advice? friendbot2000 fucked around with this message at 16:28 on Apr 9, 2020 |
# ? Apr 9, 2020 16:21 |
|
Can you access LocalStorage? That might be easier than messing with cookies, which are usually set with a Set-Cookie HTTP header from the web server. Otherwise, when whatever web server loads in the backdoor, you may just want to send the set-cookie header. Just set Max-Age to some fuckoff huge value if you want it to persist forever. Macichne Leainig fucked around with this message at 16:34 on Apr 9, 2020 |
# ? Apr 9, 2020 16:31 |
|
Imagine my surprise in finding out ASP.NET Core does not have a built-in file logger. What do people normally do for error logging in production? (Deploying on Ubuntu in case it makes a difference.)
|
# ? Apr 11, 2020 01:03 |
|
Protocol7 posted:Some cloud solution probably. At my old job when Accenture bought us out they came in with super draconian PC monitoring software and we couldn't even run Visual Studio for weeks. Nobody figured out a workaround, it was a fun few weeks. Thanks. I don't think this will be an issue going forward since I got furloughed today.
|
# ? Apr 11, 2020 01:43 |
|
NoDamage posted:Imagine my surprise in finding out ASP.NET Core does not have a built-in file logger. What do people normally do for error logging in production? (Deploying on Ubuntu in case it makes a difference.) NLog seems to be the most popular one, and it hooks right into ASP.NET Core logging infrastructure to suck all the ASP.NET Core logs into itself. I have been using NLog for 5+ years and have no complaints - works great, I will keep using it for the foreseeable future.
|
# ? Apr 11, 2020 05:50 |
|
NoDamage posted:Imagine my surprise in finding out ASP.NET Core does not have a built-in file logger. What do people normally do for error logging in production? (Deploying on Ubuntu in case it makes a difference.) Serilog has a great API, produces structured logs, has a dedicated ASP.NET middleware, and will write to anything and the kitchen sink. I totally recommend that. The only warning I should give is don't forget to import the Serilog.Sinks.Async package and use it to wrap any logging sink that doesn't explicitly say it's already asynchronous. E.g. the console sink is synchronous so it was bottlenecking my service when I returned large object arrays, until I realized it and wrapped it in Async.
|
# ? Apr 11, 2020 06:59 |
|
My work also uses serilog and it's great. You can pair it with something like Seq, or have it write to whatever else
|
# ? Apr 11, 2020 16:41 |
|
In company, we mostly use SumoLogic with our own implementation of ILogger / ILoggerProvider. I don't remember why, considering there is one available on NuGet.org. There are also couple of 3rd party implementations of file logger available. You can check if any one fits your needs. e.g. this one: https://www.nuget.org/packages/NetEscapades.Extensions.Logging.RollingFile/
|
# ? Apr 11, 2020 19:09 |
|
NihilCredo posted:Serilog has a great API, produces structured logs, has a dedicated ASP.NET middleware, and will write to anything and the kitchen sink. I totally recommend that. SeriLog works great in my experience. It's great that you can have it write logs directly to app insights, too.
|
# ? Apr 11, 2020 20:49 |
|
Did log4net fall out of favor? That’s what we use, but we just write to disk and the windows event log. That said, we’re a bank and generate a LOT of logs. Like our little group generates many GB of logs a day using the RollingFileAppender which then has to be archived for like 5 years or something for audit
|
# ? Apr 11, 2020 21:16 |
|
I still use l4n, but behind my own ILogger interface. It's worked well enough so far for me.
|
# ? Apr 11, 2020 22:53 |
|
My company also uses log4net.
|
# ? Apr 12, 2020 07:36 |
|
New Yorp New Yorp posted:SeriLog works great in my experience. It's great that you can have it write logs directly to app insights, too. NLog has an AI target as well.
|
# ? Apr 13, 2020 13:24 |
|
Anyone using gRPC on Azure Service Fabric? I’m currently working on a demo project which implements a Microservices architecture on ASF. I’m working my through Haishi Bai’s Programming Microsoft Azure Service Fabric (Second Edition) which was published in 2018. In the second chapter, we work with stateless services (which technically don’t have to be stateless, they just don’t use ASF reliable collections). We implement a simple calculator service, and use several different inter-service communication methods. First remoting, then WCF, and finally a custom service using gRPC. So, I install the gRPC, gRPC.Tools, and Google.Protobuf packages, as instructed. I create a Calculator.proto file. The next step is to generate the classes using protoc.exe. The book says that protoc should be in a directory under the packages directory. It’s not. In fact, there’s nothing gRPC related in packages. The nuget docs for the gRPC.Tools package says that this version integrates into MSBuild, so all I should need to do is build the solution and the generated files should be somewhere under the bin/Debug/[platform] directory. They’re not. Any clue as to how I can compile my proto file into the required classes? TIA
|
# ? Apr 19, 2020 22:34 |
|
The way that ad-hoc binaries and tools are delivered using NuGet has changed at least 2 times over the past 5 years. Possibly the guide you use works under old assumptions. In ye olden times, it just worked. Then Microsoft hosed it up and binaries were in %home%\.nuget\something\something. Now in more recent versions they are again more reasonable places. Let's see where it went... right now I can find it under myproject\packages\Grpc.Tools.2.27.0\tools\windows_x64\protoc.exe This is for a .NET Core project, though. If you are not using .NET Core then it might be that it is still in %home%\.nuget\whatever - possibly the 2nd change that unfucked it only applies to .NET Core. I have never seen any integration with the build process, though. I just manually run a script to compile all my .proto files on build or manually. Here's my script: code:
EssOEss fucked around with this message at 05:14 on Apr 20, 2020 |
# ? Apr 20, 2020 05:12 |
|
I have a method that does a bunch of null guard checks at runtime that throw exceptions, and it takes up a lot of space and makes the code harder to read. I've thought about making some sort of NullGuard() helper method that takes a list of arguments, but then I won't have their names for the exception messages. Any ideas for this? I don't know if I can use the new Non-nullable references in C# 8, but I'd prefer not having to teach the rest of the team.
|
# ? Apr 20, 2020 09:33 |
|
Boz0r posted:I have a method that does a bunch of null guard checks at runtime that throw exceptions, and it takes up a lot of space and makes the code harder to read. I've thought about making some sort of NullGuard() helper method that takes a list of arguments, but then I won't have their names for the exception messages. Any ideas for this? I don't know if I can use the new Non-nullable references in C# 8, but I'd prefer not having to teach the rest of the team. I can only think of 2 options: passing nameof(fooInput) into NullGuard with "fooInput" (as a named tuple?) or using reflection to grab attributes, [DisplayName] and so on. If you look at the .NET team's own code they seem to just suck it up and put conditional calls that throw ArgumentNullException at the top of their methods. SAVE-LISP-AND-DIE fucked around with this message at 11:11 on Apr 20, 2020 |
# ? Apr 20, 2020 11:02 |
|
Anyone know of a handy tool/script that'll tell me what NuGet package depends on a specific package? Something is bringing in NLog.Config and I don't see it in any of our project files, so I assume it's in the dep tree of some package we depend on and I want to know who to pester on GitHub.
|
# ? Apr 20, 2020 13:24 |
|
Munkeymon posted:Anyone know of a handy tool/script that'll tell me what NuGet package depends on a specific package? Something is bringing in NLog.Config and I don't see it in any of our project files, so I assume it's in the dep tree of some package we depend on and I want to know who to pester on GitHub. I know I keep sounding like a broken record but Paket has exactly this feature: Of course you probably don't want to adopt Paket just for this one-off question, but you may try committing your changes, running paket convert-from-nuget locally, asking whatever paket why questions you have, and then git resetting.
|
# ? Apr 20, 2020 13:32 |
|
NihilCredo posted:I know I keep sounding like a broken record but Paket has exactly this feature: Yeah, that's worth a shot. Also just love that it's called why quote:NLog.Config - 4.7 is a direct (paket.dependencies) and top-level dependency. Maybe I did the conversion wrong* because that's not even the version that NuGet was restoring. Welp, that's an hour I'm not getting back. *ended up carpet-bombing the paket.dependencies directory with >= because fixing every version and waiting for it to find the next conflict was getting tedious and I really just wanted to Make It Go Munkeymon fucked around with this message at 16:12 on Apr 20, 2020 |
# ? Apr 20, 2020 13:59 |
|
EssOEss posted:...words... Thanks! Found them under the %home%.nuget directory.
|
# ? Apr 20, 2020 15:55 |
|
Munkeymon posted:Yeah, that's worth a shot. Also just love that it's called why If that is all it says, that should mean that:
code:
code:
NihilCredo fucked around with this message at 17:40 on Apr 20, 2020 |
# ? Apr 20, 2020 17:38 |
|
I am working on some services that run on Docker, for authentication we use the Azure AD and I have our reverse proxy setup to authenticate all requests to our hosted services. My question is, and my Google skills are failing me, is there a way to have NGINX forward the Oauth reponse to our backend so that I have a UserPrincipal inside ASP.Net? Is this even possible/smart? The idea of having the reverse proxy doing the authentication was appealing to us because it also terminates the SSL connections.
|
# ? Apr 21, 2020 07:27 |
|
I asked this in General Programming because I thought it was too minor for this thread, but nobody answered, so I guess the .NET specificity of it put people off? So trying it here: I do not know much about nuget; I have some nuget packages another guy did and I've been able to piggyback off his work enough to keep them updated. But now I have a problem I can't figure out. The .nuspec file has code like this: code:
Is there a solution to this besides just making two nuget solutions, one for Framework and one for Core? Some way to detect framework and execute a command with the appropriate location string? Also, since nobody gave me any better solutions I've been working on a separate nuget for Core, but as it turns out I have no idea how to target UserDir in that command language -- %USERPROFILE% doesn't work. Anyone know how to do that? I just want to put this stupid bug to bed, it's got to be a solved problem, there are plenty of NuGet packages targeting Core.
|
# ? Apr 21, 2020 20:43 |
|
NihilCredo posted:What happens (before the paket conversion) if you just run git grep NLog.Config on your repo? It finds all of the NLog.Config sections of our .config files and nothing else. That ran a lot faster than just grepping the directory, too, so thanks for suggesting that specifically. It's probably because of some interaction with updating from legacy framework stuff and my laziness updating paket.dependencies. Disabling NLog.Config in our MyGet account and seeing what complains off-hours might get me the answer with less waiting
|
# ? Apr 22, 2020 19:35 |
|
CapnAndy posted:Also, since nobody gave me any better solutions I've been working on a separate nuget for Core, but as it turns out I have no idea how to target UserDir in that command language -- %USERPROFILE% doesn't work. This is in the csproj file? I would expect $(UserProfile) to work if I remember my MSBuild right.
|
# ? Apr 22, 2020 20:51 |
|
EssOEss posted:This is in the csproj file? I would expect $(UserProfile) to work if I remember my MSBuild right. edit: but it looks like $(UserProfile) is working! CapnAndy fucked around with this message at 23:52 on Apr 22, 2020 |
# ? Apr 22, 2020 23:36 |
|
Mr Shiny Pants posted:I am working on some services that run on Docker, for authentication we use the Azure AD and I have our reverse proxy setup to authenticate all requests to our hosted services. My question is, and my Google skills are failing me, is there a way to have NGINX forward the Oauth reponse to our backend so that I have a UserPrincipal inside ASP.Net? So I got this working today. In ASP ( Giraffe ) I configured a JwtBearer challenge and after some fiddling with Nginx it sets the required headers and now I have Claims inside my application with authentication being done by the reverse-proxy. Mr Shiny Pants fucked around with this message at 17:02 on Apr 26, 2020 |
# ? Apr 26, 2020 16:59 |
|
|
# ? Jun 8, 2024 06:05 |
|
Anyone familiar with using the MVP pattern with winforms? I'm converting an old app for the hell of it (WPF/MVVM, I know, but that's another story). So far, things have been going well. My UI and business logic are separated, and I'm able to write unit tests using Moq to mock the view. The first challenge I've come across is how to properly create an instance of another view (in this case, an about form). The approach I've taken is giving IMainView a method that returns an IAboutView. MainForm implements this by returning a new instance of AboutForm. So, when the user triggers the event that the MainPresenter is listening for, the presenter asks its associated view to create an IAboutView, passes it to a presenter, and then tells it to display. Is this approach valid? It doesn't feel too bad, as my presenters only reference interfaces, not any specific implementations. Relevant snippets below. code:
GI_Clutch fucked around with this message at 21:04 on Apr 26, 2020 |
# ? Apr 26, 2020 20:12 |