<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jorge Sisco</title>
    <description>The latest articles on DEV Community by Jorge Sisco (@sisco).</description>
    <link>https://dev.to/sisco</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1230602%2F72f6f981-7520-4857-9c61-f2f5f745a3da.png</url>
      <title>DEV Community: Jorge Sisco</title>
      <link>https://dev.to/sisco</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sisco"/>
    <language>en</language>
    <item>
      <title>Optimize Your Git Setup: Strategies for Handling Multiple GitHub Accounts</title>
      <dc:creator>Jorge Sisco</dc:creator>
      <pubDate>Sun, 07 Apr 2024 16:58:02 +0000</pubDate>
      <link>https://dev.to/sisco/optimize-your-git-setup-strategies-for-handling-multiple-github-accounts-3ji8</link>
      <guid>https://dev.to/sisco/optimize-your-git-setup-strategies-for-handling-multiple-github-accounts-3ji8</guid>
      <description>&lt;p&gt;You can easily configure Git settings for each repository you work on or globally for all repositories on your machine. For detailed instructions, refer to the &lt;a href="https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git"&gt;official GitHub documentation on setting your username in Git&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you're looking for a customized solution to set your Git configuration based on the working directory, I recommend the following approach:&lt;/p&gt;

&lt;h2&gt;
  
  
  Home Directory Structure for .gitconfig Files
&lt;/h2&gt;

&lt;p&gt;In your home directory &lt;code&gt;~/&lt;/code&gt;, you should have the main &lt;code&gt;.gitconfig&lt;/code&gt; file along with two additional configuration files: &lt;code&gt;.gitconfig_personal&lt;/code&gt; and &lt;code&gt;.gitconfig_work&lt;/code&gt;. These files are structured as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/
├── .gitconfig
├── .gitconfig_personal
└── .gitconfig_work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In your &lt;code&gt;.gitconfig&lt;/code&gt; file, you will define conditions for each GitHub account's information. The configuration should appear as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[gpg]
    format = ssh
[gpg "ssh"]
    program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
[commit]
    gpgsign = true

[includeIf "gitdir:~/work/"]
    path = .gitconfig_work
[includeIf "gitdir:~/dev/"]
    path = .gitconfig_personal
[core]
    excludesfile = ~/.gitignore_global
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;gitdir&lt;/code&gt; can be any directory you decide to use with one exception:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you're using any cloud file management services like iCloud Drive or any similar cloud storage solution, it's important to be cautious about where you place your git repositories. Initiating a git repository within a directory that is being synchronized to the cloud can lead to significant and frustrating complications.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The section titled &lt;code&gt;[gpg]&lt;/code&gt; in the configuration is used for scenarios where you plan to utilize SSH for authentication purposes and for signing commits via the 1Password Command Line Interface (CLI). However, configuring this section is optional.&lt;/p&gt;

&lt;p&gt;For both &lt;code&gt;.gitconfig_personal&lt;/code&gt; and &lt;code&gt;.gitconfig_work&lt;/code&gt; the setup should be the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[user]
    name = &amp;lt;github_username&amp;gt;
    email = &amp;lt;github_email&amp;gt;
    signingkey = &amp;lt;ssh_public_key&amp;gt; # Optional
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting Up Git SSH Authentication for Multiple GitHub Accounts [Optional]
&lt;/h2&gt;

&lt;p&gt;If you're looking to use SSH keys for authentication with GitHub via the 1Password CLI, it's essential to configure your SSH settings properly. This involves adding a specific host configuration for each GitHub account in the &lt;code&gt;~/.ssh/config&lt;/code&gt; file to differentiate between your work and personal accounts. Here's how to do it:&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;Ensure you have generated SSH keys for both your GitHub accounts. If you haven't done so, follow GitHub's documentation on creating SSH keys. You should have two separate public keys, one for each account.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring SSH for Multiple GitHub Accounts
&lt;/h3&gt;

&lt;p&gt;Open your SSH configuration file: Use a text editor to open &lt;code&gt;~/.ssh/config&lt;/code&gt;. If the file doesn't exist, you can create it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Add the SSH configuration for each account
&lt;/h3&gt;

&lt;p&gt;You'll need to specify a custom host for each GitHub account, as shown in the example below. Replace &lt;code&gt;public_key_gh_work_ed25519.pub&lt;/code&gt; and &lt;code&gt;public_key_gh_personal_ed25519.pub&lt;/code&gt; with the actual filenames of your SSH public keys.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Work account
Host work.github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/public_key_gh_work_ed25519.pub

# Personal account
Host personal.github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/public_key_gh_personal_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reference Docs
&lt;/h2&gt;

&lt;p&gt;After setting up your Git configurations and SSH keys for different GitHub accounts, incorporating the GitHub CLI and 1Password CLI into your workflow can further optimize your development process, making it more secure and efficient.&lt;/p&gt;

&lt;h3&gt;
  
  
  GitHub CLI
&lt;/h3&gt;

&lt;p&gt;The GitHub CLI (gh) is a powerful tool that extends GitHub functionalities to your terminal, allowing you to script and automate various GitHub actions without leaving your command line. Whether you're working with issues, pull requests, repositories, or GitHub Actions, gh offers a seamless way to manage them.&lt;/p&gt;

&lt;p&gt;For detailed instructions on how to install, configure, and use the GitHub CLI, refer to the official &lt;a href="https://cli.github.com/manual/"&gt;GitHub CLI documentation&lt;/a&gt;. It provides comprehensive guides on getting started, command references, and how to perform common GitHub operations directly from your terminal.&lt;/p&gt;

&lt;h3&gt;
  
  
  1Password CLI
&lt;/h3&gt;

&lt;p&gt;The 1Password CLI provides a secure and convenient way to manage your passwords and secrets, including SSH keys for Git authentication, directly from the command line. By integrating the 1Password CLI with your Git setup, as shown in the &lt;code&gt;[gpg "ssh"]&lt;/code&gt; configuration section of your &lt;code&gt;.gitconfig&lt;/code&gt;, you can enhance the security of your Git operations. This is especially useful for signing commits or accessing multiple SSH keys securely without having to store them unencrypted on your filesystem.&lt;/p&gt;

&lt;p&gt;To get started with the 1Password CLI, visit the &lt;a href="https://developer.1password.com/docs/cli/"&gt;official 1Password CLI documentation&lt;/a&gt;. Here, you'll find installation guides, usage examples, and how to integrate it with various tools and workflows, including Git and SSH authentication.&lt;/p&gt;

&lt;p&gt;By leveraging these CLI tools, you can streamline your development process, manage your GitHub activities more efficiently, and secure your Git operations with advanced authentication and encryption methods. These integrations not only save time but also reinforce the security and management of multiple identities and repositories.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Simplifying Serverless: Custom Domains with AWS SAM</title>
      <dc:creator>Jorge Sisco</dc:creator>
      <pubDate>Thu, 22 Feb 2024 11:59:35 +0000</pubDate>
      <link>https://dev.to/sisco/simplifying-serverless-custom-domains-with-aws-sam-3fb</link>
      <guid>https://dev.to/sisco/simplifying-serverless-custom-domains-with-aws-sam-3fb</guid>
      <description>&lt;p&gt;When deploying a Serverless Application Model (SAM) with events that trigger functions via a serverless API gateway, using the default API URL provided by Amazon might not be ideal for your clients.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example of Default Invoke Base URL:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://afjdkwosp3.execute-api.eu-central-1.amazonaws.com/dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding a custom domain enhances the appearance of your service, making it more user-friendly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting the Custom Domain in Your SAM &lt;code&gt;template.yaml&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Your &lt;code&gt;yaml&lt;/code&gt; file for the API will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;MyApi&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Serverless::Api&lt;/span&gt;
  &lt;span class="na"&gt;Properties&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;StageName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Ref&lt;/span&gt; &lt;span class="s"&gt;Environment&lt;/span&gt;
    &lt;span class="na"&gt;DefinitionBody&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;Fn::Transform&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;Name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AWS::Include&lt;/span&gt;
        &lt;span class="na"&gt;Parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;Location&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api/swagger-integrated.yaml&lt;/span&gt;
    &lt;span class="na"&gt;Domain&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;DomainName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s"&gt;${APISubDomainName}.${DomainName}.com&lt;/span&gt;
      &lt;span class="na"&gt;CertificateArn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;!Sub&lt;/span&gt; &lt;span class="s"&gt;arn:aws:acm:${AWS::Region}:${AWS::AccountId}:certificate/${ACMIDENTIFIER}&lt;/span&gt;
      &lt;span class="na"&gt;SecurityPolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TLS_1_2&lt;/span&gt;
      &lt;span class="na"&gt;BasePath&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;'&lt;/span&gt; &lt;span class="c1"&gt;# Base path replaces stage name; if it's '', you don't have to add the stage name in the endpoints.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To incorporate dynamic values in your template, define &lt;code&gt;DomainName&lt;/code&gt;, &lt;code&gt;APISubDomainName&lt;/code&gt;, and &lt;code&gt;ACMIDENTIFIER&lt;/code&gt; in the parameters section as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Parameters&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;DomainName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;&amp;lt;your-domain&amp;gt;&lt;/span&gt;
  &lt;span class="na"&gt;APISubDomainName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api&lt;/span&gt;
  &lt;span class="na"&gt;ACMIDENTIFIER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;Type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;String&lt;/span&gt;
    &lt;span class="na"&gt;Default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;e242ea60-359f-4c49-b052-b9ce6d533cd4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, you can avoid hardcoding by omitting the Default values for parameters and add them through the &lt;code&gt;samconfig.toml&lt;/code&gt; file. However, our focus here is on establishing a custom domain name for the API.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Certificate Manager
&lt;/h2&gt;

&lt;p&gt;Before deploying our SAM, we must complete a few preparatory steps:&lt;/p&gt;

&lt;h3&gt;
  
  
  Import your domain &lt;code&gt;SSL&lt;/code&gt; certificate to ACM
&lt;/h3&gt;

&lt;p&gt;This process will provide you with your &lt;code&gt;ACMIDENTIFIER&lt;/code&gt;, which you can then include in your &lt;code&gt;template.yaml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; It's also necessary to provide the certificate chain to ensure successful SSL certificate verification for requests. Failing to do so might require disabling verification to achieve successful API requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure the Domain Name to your Rest API
&lt;/h2&gt;

&lt;p&gt;In your domain registrar's panel, add a new &lt;code&gt;CNAME&lt;/code&gt; record in your DNS settings that points to your API Gateway's domain name.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The API Gateway's domain name is different from the Invoke URL. This URL can be found in:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4w8zmbhq991cfd2uz6fe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4w8zmbhq991cfd2uz6fe.png" alt="AWS API Gateway Custom domain names" width="800" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy your SAM
&lt;/h2&gt;

&lt;p&gt;You are now ready for deployment. However, be aware that DNS settings changes may take up to 48 hours to propagate fully. Use a &lt;a href="https://dnschecker.org/"&gt;DNS checker&lt;/a&gt; to confirm the CNAME's propagation and to ensure the configuration is correct. Once verified, your API will be accessible via the custom domain.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
