Skip to content

Commit

Permalink
DCV Library Initial Implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jared-daniels committed Nov 19, 2024
0 parents commit b6c6269
Show file tree
Hide file tree
Showing 160 changed files with 46,417 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:

# For Maven (Java) dependencies
- package-ecosystem: "maven"
directory: "/" # Location of pom.xml
schedule:
interval: "daily" # Frequency of update checks
groups:
all-dependencies:
patterns:
- "*"
103 changes: 103 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '31 19 * * 4'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: java-kotlin
build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too.
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
#- if: matrix.build-mode == 'manual'
# shell: bash
# run: |
# echo 'If you are using a "manual" build mode for one or more of the' \
# 'languages you are analyzing, replace this with the commands to build' \
# 'your code, for example:'
# echo ' make bootstrap'
# echo ' make release'
# exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
42 changes: 42 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java Build and Test with Maven

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Set up Docker Build
uses: docker/setup-buildx-action@v2

- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r .tag_name)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
- name: Run MVN Verify
run: |
mvn -P coverage -B verify --file pom.xml
75 changes: 75 additions & 0 deletions .github/workflows/psl-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Periodic PSL Update

on:
schedule:
- cron: '0 0 1 * *' # Run at midnight on the first of every month
workflow_dispatch:

jobs:
update_psl:
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Download PSL
run: |
curl -o ./library/src/main/resources/public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat
- name: Check for Changes
id: check_changes
run: |
if git diff --exit-code ./library/src/main/resources/public_suffix_list.dat; then
echo "No changes in PSL data."
echo "changes_detected=false" >> $GITHUB_ENV
else
echo "Changes detected in PSL data."
echo "changes_detected=true" >> $GITHUB_ENV
fi
- name: Push Changes to Branch
if: ${{ env.changes_detected == 'true' }}
run: |
git config --global user.email "${{ secrets.GIT_USERNAME }}@digicert.com"
git config --global user.name "${{ secrets.GIT_USERNAME }}"
git add ./library/src/main/resources/public_suffix_list.dat
git commit -m "Update PSL"
git push origin HEAD:psl-update
- name: Create Pull Request
if: ${{ env.changes_detected == 'true' }}
uses: peter-evans/create-pull-request@v3
with:
branch: psl-update
title: "Update PSL"
body: "This PR updates the PSL to the latest version."
base: master


slack_notification:
needs: [update_psl]
if: always()
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run Slack Notification
uses: rohammosalli/slack-action@master
env:
SLACK_BOT_TOKEN: ${{ secrets.PKI_SLACK_TOKEN }}
SLACK_CHANNEL: "dvm-alerts"
GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
GITHUB_RUN_ID: ${{ github.run_id }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
RUN_ID: ${{ github.run_id }}
SEND_SUCCESS_MESSAGE: "false"
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

/example-app/.sql-data/
/example-app/nginx/www/.well-known/pki-validation/*

### IntelliJ IDEA ###
.idea/*
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store

### github conf files ###
settings.xml
toolchains.xml
22 changes: 22 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
COPYRIGHT AND LICENSE INFORMATION
=================================

Copyright (c) 2024, Digicert, Inc.
All rights reserved.

This library is licensed under the MIT License (MIT) - see the LICENSE file for details.

Contributors
------------
Digicert Engineering Team

Third-Party Libraries
---------------------
This project may include third-party libraries, each licensed under their respective terms. Please refer to the LICENSE or NOTICE file for more information on third-party licenses.

Attribution
-----------
If using this library in an open-source or proprietary project, attribution to Digicert, Inc., is appreciated, but not required.

For more information, please visit:
https://github.com/digicert/domain-control-validation
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2024 Digicert Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit b6c6269

Please sign in to comment.