{"id":13576844,"url":"https://github.com/go-masonry/mortar","last_synced_at":"2026-01-27T02:12:27.486Z","repository":{"id":39639548,"uuid":"284442347","full_name":"go-masonry/mortar","owner":"go-masonry","description":"Mortar is a GO framework/library for building gRPC (and REST) web services.","archived":false,"fork":false,"pushed_at":"2025-05-12T10:45:44.000Z","size":1989,"stargazers_count":678,"open_issues_count":1,"forks_count":20,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-12T11:43:23.871Z","etag":null,"topics":["dependency-injection","di","fx","golang","grpc","metrics","microservice","middleware","monitoring","opentracing","prometheus","protobuf","trace"],"latest_commit_sha":null,"homepage":"https://go-masonry.github.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-masonry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-08-02T10:50:28.000Z","updated_at":"2025-05-12T10:45:49.000Z","dependencies_parsed_at":"2024-01-25T06:46:53.418Z","dependency_job_id":null,"html_url":"https://github.com/go-masonry/mortar","commit_stats":{"total_commits":156,"total_committers":6,"mean_commits":26.0,"dds":0.1923076923076923,"last_synced_commit":"3baaae40467503f4297f55149634e3c625c23477"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/go-masonry/mortar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-masonry%2Fmortar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-masonry%2Fmortar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-masonry%2Fmortar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-masonry%2Fmortar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-masonry","download_url":"https://codeload.github.com/go-masonry/mortar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-masonry%2Fmortar/sbom","scorecard":{"id":432171,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-masonry/mortar","commit":"7c9438445d5ac3c5070e21196882d2975b7b11bd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":3,"reason":"Found 7/20 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/go-masonry/mortar/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/go-masonry/mortar/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/go-masonry/mortar/go.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/go-masonry/mortar/go.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T03:37:49.462Z","repository_id":39639548,"created_at":"2025-08-19T03:37:49.462Z","updated_at":"2025-08-19T03:37:49.462Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28796962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependency-injection","di","fx","golang","grpc","metrics","microservice","middleware","monitoring","opentracing","prometheus","protobuf","trace"],"created_at":"2024-08-01T15:01:14.911Z","updated_at":"2026-01-27T02:12:27.472Z","avatar_url":"https://github.com/go-masonry.png","language":"Go","funding_links":[],"categories":["Go","Language-Specific"],"sub_categories":["Go"],"readme":"# Mortar\n\n![Go](https://github.com/go-masonry/mortar/workflows/Go/badge.svg)\n[![codecov](https://codecov.io/gh/go-masonry/mortar/branch/master/graph/badge.svg)](https://codecov.io/gh/go-masonry/mortar)\n[![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/go-masonry/mortar)](https://pkg.go.dev/mod/github.com/go-masonry/mortar)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-masonry/mortar)](https://goreportcard.com/report/github.com/go-masonry/mortar)\n\n\u003ctable\u003e\n        \u003ctr\u003e\n            \u003cth\u003e\u003cp align=\"left\"\u003e\u003cimg src=wiki/logo.svg align=\"center\" height=256\u003e\u003c/p\u003e\u003c/th\u003e\n            \u003cth\u003e\n                \u003cp align=\"left\"\u003eMortar is a GO framework/library for building gRPC (and REST) web services. Mortar has out-of-the-box support for configuration, application metrics, logging, tracing, profiling, dependency injection and more. While it comes with predefined defaults, Mortar gives you total control to fully customize it.            \n             \u003c/p\u003e\n            \u003c/th\u003e\n        \u003c/tr\u003e\n\u003c/table\u003e\n\n## Demo\n\nClone this [demo](http://github.com/go-masonry/mortar-demo) repository to better understand some of Mortar capabilities.\n\nWhen you done, read the [documentation](https://go-masonry.github.io).\n\n## Service Template\n\nTo help you bootstrap your services with Mortar [here](https://github.com/go-masonry/mortar-template) you can find a template. Read its README first.\n\n## Features\n\n- Bundled [Grpc-Gateway](https://github.com/grpc-ecosystem/grpc-gateway) (REST Reverse-Proxy).\n- Dependency Injection using [Uber-FX](https://github.com/uber-go/fx).\n- Pimped `*http.Client` with interceptors support.\n- Abstract support for Logging, Configuration, Tracing and Monitoring libraries. Use provided wrappers or your own.\n  - [Jaeger wrapper](https://github.com/go-masonry/bjaeger) client for tracing.\n  - [Prometheus wrapper](https://github.com/go-masonry/bprometheus) client for monitoring/metrics.\n  - [Zerolog wrapper](https://github.com/go-masonry/bzerolog) for logging.\n  - [Viper wrapper](https://github.com/go-masonry/bviper) for configuration.\n- Internal HTTP [Handlers](providers/handlers.go)\n  - _Profiling_ `http://.../debug/pprof`\n  - _Debug_ `http://.../debug/*`\n  - _Configuration_ `http://.../self/config`\n  - _Build Information_ `http://.../self/build`\n  - _Health_ `http://.../health`\n- [Server/Client](providers) Interceptors both for gRPC and HTTP, you can choose which to use and/or add your own. \n    \n    Some examples\n    - HTTP Headers can be forwarded to next hop, defined by list.\n    - HTTP Headers can be included in logs, defined by list.\n    - Made available in `ctx.Context` via gRPC incoming Metadata.\n    - Automatic monitoring and tracing (if enabled) for every RPC defined by the API.\n\n...and more.\n\n### Telemetry (Everything connected)\n\n* Logs have Tracing Information `traceId=6ff7e7e38d1e86f` **across services**\n    ![logs](wiki/logs.png)\n\n* Also visible in Jaeger `traceId=6ff7e7e38d1e86f` if it's sampled.\n    ![jaeger](wiki/jaeger.png)\n\n### Support for `*http.Client` Interceptors, so you can\n\n* Add request and response info to Trace\n\n    \u003c!-- ![jaeger_http](wiki/jaeger_http.png) --\u003e\n\n* Log/Dump requests and/or responses when http request fails.\n\n    ```golang\n    return func(req *http.Request, handler client.HTTPHandler) (resp *http.Response, err error) {\n        var reqBytes, respBytes []byte\n        // If the response is Bad Request, log both Request and Response\n        reqBytes, _ = httputil.DumpRequestOut(req, true) // it can be nil and it's ok\n        if resp, err = handler(req); err == nil \u0026\u0026 resp.StatusCode \u003e= http.StatusBadRequest {\n            respBytes, _ = httputil.DumpResponse(resp, true) // it can be nil\n            logger.WithError(fmt.Errorf(\"http request failed\")).\n            WithField(\"status\",resp.StatusCode).\n            Warn(req.Context(), \"\\nRequest:\\n%s\\n\\nResponse:\\n%s\\n\", reqBytes, respBytes)\n        }\n        return\n    }\n    ```\n\n    ![http_client](wiki/http_client_dump.png)\n\n* Alter requests and/or responses (useful in [Tests](https://github.com/go-masonry/mortar-demo/blob/master/workshop/app/controllers/workshop_test.go#L162))\n\n    ```golang\n    func(*http.Request, clientInt.HTTPHandler) (*http.Response, error) {\n        // special case, don't go anywhere just return the response\n        return \u0026http.Response{\n            Status:        \"200 OK\",\n            StatusCode:    200,\n            Proto:         \"HTTP/1.1\",\n            ProtoMajor:    1,\n            ProtoMinor:    1,\n            ContentLength: 11,\n            Body:          ioutil.NopCloser(strings.NewReader(\"car painted\")),\n        }, nil\n    }\n    ```\n\n### Monitoring/Metrics support\n\nExport to either Prometheus/Datadog/statsd/etc, it's your choice. Mortar only provides the Interface and also **caches** the metrics so you don't have to.\n\n```golang\ncounter := w.deps.Metrics.WithTags(monitor.Tags{\n \"color\":   request.GetDesiredColor(),\n \"success\": fmt.Sprintf(\"%t\", err == nil),\n}).Counter(\"paint_desired_color\", \"New paint color for car\")\n\ncounter.Inc()\n```\n\n\u003e `counter` is actually a *singleton*, uniqueness calculated [here](monitoring/registry.go#L87)\n\n![grafana](wiki/grafana.png)\n\nFor more information about Mortar Monitoring read [here](https://go-masonry.github.io/middleware/telemetry/monitoring/).\n\n### Additional Features\n\n* `/debug/pprof` and other useful [handlers](handlers)\n* Use `config_test.yml` during [tests](https://github.com/go-masonry/mortar-demo/blob/master/workshop/app/controllers/workshop_test.go#L151) to **override** values in `config.yml`, it saves time.\n\nThere are some features not listed here, please check the [Documentation](#documentation) for more.\n\n## Documentation\n\nMortar is not a drop-in replacement.\n\nIt's important to read its [Documentation](https://go-masonry.github.io) first.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-masonry%2Fmortar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-masonry%2Fmortar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-masonry%2Fmortar/lists"}