Spring Authentication With MetaMask

When choosing a user authentication method for your application, you usually have several options: develop your own system for identification, authentication, and authorization, or use a ready-made solution. A ready-made solution means that the user already has an account on an external system such as Google, Facebook, or GitHub, and you use the appropriate mechanism, most likely OAuth, to provide limited access to the user’s protected resources without transferring the username and password to it. The second option with OAuth is easier to implement, but there is a risk for your user if the user's account is blocked and the user will lose access to your site. Also, if I, as a user, want to enter a site that I do not trust, I have to provide my personal information, such as my email and full name, sacrificing my anonymity.

In this article, we’ll build an alternative login method for Spring using the MetaMask browser extension. MetaMask is a cryptocurrency wallet used to manage Ethereum assets and interact with the Ethereum blockchain. Unlike the OAuth provider, only the necessary set of data can be stored on the Ethereum network. We must take care not to store secret information in the public data, but since any wallet on the Ethereum network is in fact a cryptographic strong key pair, in which the public key determines the wallet address and the private key is never transmitted over the network and is known only by the owner, we can use asymmetric encryption to authenticate users.

Core PostgreSQL

This Refcard aims to serve as a comprehensive quick-reference guide for PostgreSQL, an advanced, enterprise-class, and open-source relational database system. The primary purpose is to help both novice and experienced users understand and utilize the crucial functions of PostgreSQL more efficiently. The guide provides a succinct overview of PostgreSQL's key features, fundamentals, commands, functions, and other essential elements.

Building a Cassandra To-Do List ChatGPT Plugin

ChatGPT plugins offer a way to extend the capabilities of OpenAI's ChatGPT by integrating custom functionalities directly into the conversational AI interface. These plugins enable users to interact with specialized features, transforming ChatGPT into a versatile tool for various tasks. Think of a ChatGPT plugin as a handy tool belt that equips OpenAI's ChatGPT with specialized superpowers. Just like adding a new gadget to your arsenal, a plugin empowers ChatGPT to perform specific tasks seamlessly within the conversation. 

In this blog, we'll dive into implementing the Cassandra to-do list ChatGPT plugin, which acts as a virtual personal assistant for managing your to-do list. It's like having a dedicated task organizer right beside you during your AI-powered conversations. With this plugin, you can effortlessly create, view, and delete tasks, bringing a new level of productivity and organization to your chat-based interactions with ChatGPT.

Why GraphQL API Security Is Unique

Enterprise security teams have had since 2015 to familiarize themselves with GraphQL API security. But many — if not most — still haven’t captured the security nuances of the popular open-source query language. Simply understanding GraphQL’s processes and vulnerable attack vectors isn’t sufficient; it’s also necessary to recognize exploit attempts and nefarious queries (and trigger actions whenever those threats arise). A complete GraphQL security strategy must also be ready to defeat attacks designed to infiltrate GraphQL specifically. A more generalized API security strategy isn’t going to cut it, as headlines continue to prove. 

Security teams likely have either a web application firewall (WAF) performing active application monitoring to detect threats or a comparable in-house solution that leverages access logs to monitor threat behavior. They also likely depend on specific indicators when monitoring for anomalous activity — including HTTP methods and response status codes, sensitive API routes, and API parameters. Keeping an eye on these indicators can identify attacks where clients try to overwhelm a registration endpoint, perform multiple unsuccessful logins, attempt account enumeration, or tamper with key parameters.

The Role of Threat Modeling in Software Development: A Cybersecurity Perspective

In today's digitally interconnected world, software plays an integral role in our daily lives. From online banking and e-commerce to healthcare and transportation, software applications are at the heart of our technological infrastructure. However, with the increasing reliance on software, the risks associated with cyber threats have also grown exponentially. This is where threat modeling steps in as a crucial component of software development, providing a proactive approach to cybersecurity. In this blog, we will delve into the concept of threat modeling and explore its pivotal role in safeguarding software from cyber threats.

Understanding Threat Modeling

Threat modeling is a systematic approach to identifying and mitigating security threats early in the software development process. It is essentially a risk management process that helps software developers anticipate potential vulnerabilities and security weaknesses in their applications. By analyzing and understanding potential threats, development teams can proactively address security concerns, reducing the likelihood of costly security breaches in the future. Threat modeling is an essential practice in software development, playing a pivotal role in reducing cybersecurity risk. 

Common Problems in React Native Apps on iOS Platform: Solutions and Tips

React Native is a popular framework for building cross-platform mobile applications. While it offers numerous advantages like code reusability and native performance, developers often encounter specific challenges when developing React Native apps for the iOS platform. In this article, we'll discuss some common problems that arise during iOS app development with React Native and provide solutions and tips to overcome them.

UI Inconsistencies

React Native aims to deliver a consistent user experience across platforms. However, subtle differences may exist between Android and iOS, such as font rendering and navigation behaviors. To address this issue, use platform-specific components and styles when necessary. React Native's Platform module can help conditionally render components or styles based on the platform.

The Essentials of Amazon S3 Glacier for Affordable and Compliant Long-Term Data Archiving

In the data-intensive landscape of today, businesses and organizations grapple with managing and preserving a significant volume of data over long periods. The importance of long-term data archiving lies in compliance, legal necessities, historical analysis, and disaster recovery. Amazon Web Services (AWS) steps up to this challenge by providing Amazon S3 Glacier.

This affordable cloud-based storage service, designed expressly for long-term data archiving, ensures security and scalability. This guide aims to delve into the characteristics, advantages, and execution of Amazon S3 Glacier for dependable data archiving.

Harnessing Generative AI in Data Analysis With PandasAI

Ever wish your data would analyze itself? Well, we are one step closer to that day. PandasAI is a groundbreaking tool that significantly streamlines data analysis. This Python library expands on the capabilities of the popular Pandas library with the help of generative AI, making automated yet sophisticated data analysis a reality.

By applying generative models like OpenAI's GPT-3.5, PandasAI can understand and respond to human-like queries, execute complex data manipulations, and generate visual representations. Data analysis and AI combine to create insights that open new avenues for businesses and researchers.

How to Extract Images from Google Docs and Google Slides

Imagine you’re working with a lengthy Google Document, or a Google Slides presentation, and you need to extract all the embedded images from the text and save them as individual files.

Extract Images in Google Docs

Extract Individual Images

A simple solution to address this issue is as follows: convert your Google Document or Google Slide into a web page. Here’s how you can do it:

Go to the “File” menu. Select the “Share” submenu and then choose “Publish to Web.” It will generate a public web page that contains all the images from your document or slide. You can simply right-click an image on the page and select the “Save Image” option download it to your local disk.

What we have just discussed is a manual process but we can easily automate this with the help of Google Apps Script.

Extract all Images from a Google Document

Open your Google Document containing the images, go to the Extensions menu and choose Apps Script. Copy-paste the code below and run the saveGoogleDocsImages function to download all images to a specific folder in your Google Drive.

The images are sequentially numbered and the file extension is the same as that of the embedded inline image.

function saveGoogleDocsImages() {
  // Define the folder name where the extracted images will be saved
  const folderName = 'Document Images';

  // Check if a folder with the specified name already exists
  const folders = DriveApp.getFoldersByName(folderName);

  // If the folder exists, use it; otherwise, create a new folder
  const folder = folders.hasNext() ? folders.next() : DriveApp.createFolder(folderName);

  // Get all the images in the document's body and loop through each image
  DocumentApp.getActiveDocument()
    .getBody()
    .getImages()
    .forEach((image, index) => {
      // Get the image data as a Blob
      const blob = image.getBlob();

      // Extract the file extension from the Blob's content type (e.g., 'jpeg', 'png')
      const [, fileExtension] = blob.getContentType().split('/');

      // Generate a unique file name for each image based on its position in the document
      const fileName = `Image #${index + 1}.${fileExtension}`;

      // Set the Blob's name to the generated file name
      blob.setName(fileName);

      // Create a new file in the specified folder with the image data
      folder.createFile(blob);

      // Log a message indicating that the image has been saved
      Logger.log(`Saved ${fileName}`);
    });
}

Extract all Images from Google Slides

The Apps Script code to download images from a Google Slides presentation is similar. The function iterates over the slides in the presentation and then for each slide, the function iterates over the images in that slide.

function extractImagesFromSlides() {
  // Define the folder name where the extracted images will be saved
  const folderName = 'Presentation Images';

  // Check if a folder with the specified name already exists
  const folders = DriveApp.getFoldersByName(folderName);

  // If the folder exists, use it; otherwise, create a new folder
  const folder = folders.hasNext() ? folders.next() : DriveApp.createFolder(folderName);

  // Iterate through each slide in the active presentation
  SlidesApp.getActivePresentation()
    .getSlides()
    .forEach((slide, slideNumber) => {
      // Retrieve all images on the current slide
      slide.getImages().forEach((image, index) => {
        // Get the image data as a Blob
        const blob = image.getBlob();

        // Extract the file extension from the Blob's content type (e.g., 'jpeg', 'png')
        const fileExtension = blob.getContentType().split('/')[1];

        const fileName = `Slide${slideNumber + 1}_Image${index + 1}.${fileExtension}`;

        // Set the Blob's name to the generated file name
        blob.setName(fileName);

        // Create a new file in the specified folder with the image data
        folder.createFile(blob);

        Logger.log(`Saved ${fileName}`);
      });
    });
}

Unpacking the ‘As-a-Service’ Model

In today's fast-paced digital era, how we perceive, market, and derive value from products, talents, services, and even individual personalities has undergone a seismic shift. This transformation is largely attributed to the internet's unparalleled global connectivity. Businesses, irrespective of their scale, have the potential to flourish in this landscape, provided they remain agile and attuned to the ever-changing digital trends. However, this vast, interconnected world also brings with it the challenges of rapidly evolving trends and a deluge of information.

To navigate the complexities of this digital maze, innovators and entrepreneurs have turned to technology, devising new tools and marketing strategies. One of the most groundbreaking innovations to emerge from this digital renaissance is the "as-a-service" business model. This model, with its multifaceted layers, is still in its nascent stages but holds immense promise. It offers both fledgling startups and established giants a roadmap to crystallize their operational objectives. More importantly, it carves out avenues for expansion, fostering deeper and more meaningful engagement with their target audience.

Eliminating Bugs Using the Tong Motion Approach

Software debugging can often feel like a never-ending maze. Just when you think you're on the right track, you hit a dead-end. But, by employing the age-old technique of the process of elimination and using the analogy of the 'Tong Motion,' we can navigate this maze more effectively.

As a side note, if you like the content of this and the other posts in this series, check out my Debugging book that covers this subject. If you have friends who are learning to code, I'd appreciate a reference to my Java Basics book. If you want to get back to Java after a while, check out my Java 8 to 21 book.

Spring Boot Configuration Properties Explained

Do you also get lost in the configuration annotations of Spring Boot and how to use them? In this blog, you will take a look at the configuration annotations, what they mean, and how you can apply them in your code — everything is explained by means of examples. Enjoy!

Introduction

The annotations containing the word configuration in Spring Boot can be overwhelming. You have @Configuration, @EnableConfigurationProperties, @ConfigurationPropertiesScan, etc. But what do they actually do, and how do you need to apply them in your code?

Why Real-time Data Integration Is a Priority for Architects in the Modern Era

Staying ahead of the curve in today's quickly expanding digital landscape is more than a goal—it's a requirement.  For architects, mastering real-time data integration consequently becomes indispensable, and the reason is clear: modern businesses crave instantaneous insights, fluid user experiences, and the agility to adapt strategies on the fly. 

This is why Change Data Capture (CDC) has become increasingly important in the field of architecture. It allows for the continuous integration of data changes from/to various sources, ensuring that systems are always up-to-date. 

Compliance Automated Standard Solution (COMPASS), Part 6: Compliance to Policy for Multiple Kubernetes Clusters

(Note: A list of links for all articles in this series can be found at the conclusion of this article.)

In Part 4 of this multi-part series on continuous compliance, we presented designs for Compliance Policy Administration Centers (CPAC) that facilitate the management of various compliance artifacts connecting the Regulatory Policies expressed as Compliance-as-Code with technical policies implemented as Policy-as-Code. The separation of Compliance-As-Code and Policy-As-Code is purposeful, as different personas (see Part 1) need to independently manage their respective responsibilities according to their expertise, be they controls and parameters selection, crosswalks mapping across regulations, or policy check implementations. The CPAC enables users to deploy and run technical policy checks according to different Regulatory Policies on different Policy Validation Points (PVPs) and, depending upon the level of generality or specialty of the inspected systems, the CPAC performs specific normalization and aggregation transformations. We presented three different designs for CPAC: two for handling specialized PVPs with their declarative vs. imperative policies, and one for orchestrating diverse PVP formats across heterogeneous IT stack levels and cloud services.

PaaS4GenAI: Connecting Generative AI (WatsonX) On IBM Cloud Platform From Oracle Integration Cloud

Generative AI has been the talk of the hour due to its powerful capabilities for doing multiple things like sentiment analysis, summary generation, fact extraction, name entity extraction, email generation, etc. 

The powerful capabilities and established use cases of generative AI can be used in different business scenarios, and business flows to perform certain tasks automatically. Capabilities to connect WatsonX from Oracle Cloud through products like Oracle Integration Cloud (OIC) further facilitate using WatsonX for doing certain things by feeding prompts to WatsonX to get desired output. 

Unpacking the New National Cybersecurity Strategy: Key Takeaways for Developers and Security Experts

At Black Hat 2023, Kemba Walden, Acting National Cyber Director at the White House, outlined a new national cybersecurity strategy aimed at strengthening defenses through workforce development and technology initiatives.

For developers and technology professionals, this strategy has major implications, validating the importance of cybersecurity skills while offering expanded career pathways. Let’s explore the key announcements and what they mean for IT talent.