-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa9c144
commit 55d3bfa
Showing
73 changed files
with
2,157 additions
and
1,571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
config/*.yml | ||
docs/ | ||
examples/ | ||
pkg/ | ||
test/ | ||
terraform/ | ||
.github/ | ||
|
||
*.md | ||
.dockerignore | ||
.git | ||
.gitignore | ||
.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,41 @@ | ||
# Build Image | ||
FROM golang:1.20 as builder | ||
FROM golang:1.21 as builder | ||
|
||
# Docker BuildX Target Architecture | ||
ARG TARGETARCH | ||
|
||
ENV CGO_ENABLED=0 | ||
WORKDIR /baseca | ||
COPY . /baseca | ||
RUN apt update && apt clean && make build | ||
|
||
# Build ARM64 or AMD64 Binary | ||
RUN apt update && apt clean && \ | ||
if [ "$TARGETARCH" = "amd64" ]; then \ | ||
make build_amd64; \ | ||
elif [ "$TARGETARCH" = "arm64" ]; then \ | ||
make build_arm64; \ | ||
else \ | ||
echo "Unsupported Architecture [$TARGETARCH]"; \ | ||
exit 1; \ | ||
fi | ||
|
||
# Deploy Image | ||
FROM alpine:3.17 | ||
|
||
# Non-Root User | ||
RUN adduser --home /home/baseca baseca --gecos "baseca" --disabled-password && \ | ||
apk --no-cache add ca-certificates && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
# Copy Binary and Configuration from Build Image | ||
COPY --from=builder /baseca/target/bin/linux/baseca /home/baseca/baseca | ||
COPY --from=builder /baseca/config /home/baseca/config | ||
|
||
# Permissions for Non-Root User | ||
RUN chown -R baseca:baseca /home/baseca | ||
|
||
# Switch to Non-Root User | ||
USER baseca | ||
WORKDIR /home/baseca | ||
|
||
CMD ["/home/baseca/baseca"] | ||
# Execute coinbase/baseca | ||
CMD ["/home/baseca/baseca"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDIjCCAougAwIBAgIJAKnL4UEDMN/FMA0GCSqGSIb3DQEBBQUAMGoxCzAJBgNV | ||
BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRgw | ||
FgYDVQQKEw9BbWF6b24uY29tIEluYy4xGjAYBgNVBAMTEWVjMi5hbWF6b25hd3Mu | ||
Y29tMB4XDTE0MDYwNTE0MjgwMloXDTI0MDYwNTE0MjgwMlowajELMAkGA1UEBhMC | ||
VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxGDAWBgNV | ||
BAoTD0FtYXpvbi5jb20gSW5jLjEaMBgGA1UEAxMRZWMyLmFtYXpvbmF3cy5jb20w | ||
gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAIe9GN//SRK2knbjySG0ho3yqQM3 | ||
e2TDhWO8D2e8+XZqck754gFSo99AbT2RmXClambI7xsYHZFapbELC4H91ycihvrD | ||
jbST1ZjkLQgga0NE1q43eS68ZeTDccScXQSNivSlzJZS8HJZjgqzBlXjZftjtdJL | ||
XeE4hwvo0sD4f3j9AgMBAAGjgc8wgcwwHQYDVR0OBBYEFCXWzAgVyrbwnFncFFIs | ||
77VBdlE4MIGcBgNVHSMEgZQwgZGAFCXWzAgVyrbwnFncFFIs77VBdlE4oW6kbDBq | ||
MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHU2Vh | ||
dHRsZTEYMBYGA1UEChMPQW1hem9uLmNvbSBJbmMuMRowGAYDVQQDExFlYzIuYW1h | ||
em9uYXdzLmNvbYIJAKnL4UEDMN/FMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEF | ||
BQADgYEAFYcz1OgEhQBXIwIdsgCOS8vEtiJYF+j9uO6jz7VOmJqO+pRlAbRlvY8T | ||
C1haGgSI/A1uZUKs/Zfnph0oEI0/hu1IIJ/SKBDtN5lvmZ/IzbOPIJWirlsllQIQ | ||
7zvWbGd9c9+Rm3p04oTvhup99la7kZqevJK0QRdD/6NpCKsqP/0= | ||
-----END CERTIFICATE----- |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,16 @@ | ||
package db | ||
|
||
import "github.com/coinbase/baseca/internal/types" | ||
|
||
type CertificateResponseData struct { | ||
Certificate string `json:"certificate"` | ||
IntermediateCertificateChain string `json:"intermediate_certificate_chain,omitempty"` | ||
RootCertificateChain string `json:"root_certificate_chain,omitempty"` | ||
Metadata types.CertificateMetadata `json:"metadata"` | ||
} | ||
|
||
type DatabaseEndpoints struct { | ||
Writer Store | ||
Reader Store | ||
} | ||
|
||
type CachedServiceAccount struct { | ||
type ServiceAccountAttestation struct { | ||
ServiceAccount Account `json:"service_account"` | ||
AwsIid AwsAttestation `json:"aws_iid"` | ||
} | ||
|
||
type CachedProvisionerAccount struct { | ||
type ProvisionerAccountAttestation struct { | ||
ProvisionerAccount Provisioner `json:"provisioner_account"` | ||
AwsIid AwsAttestation `json:"aws_iid"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.