Code Monkey home page Code Monkey logo

Comments (6)

pacphi avatar pacphi commented on May 30, 2024

This is certainly possible. And pretty simple to do. For optionality's sake we might also consider different modes of auth within GitClient.

This article provides some examples (hints) on how to go about it:

And this article is helpful as it explains the options and idiosyncrasies of git auth (as relates to GitHub and GitLab):

I'm open to PRs if you want to give this a try. It may be a while before I have cycles to implement myself.

from cf-butler.

pacphi avatar pacphi commented on May 30, 2024

Have a look at this feature branch. Let me know if it satisfies your needs. Note the updates in the configuration. You no longer specify CF_POLICIES_PROVIDER. All git-backed policies have configuration managed by property prefixed names like: cf.policies.git, CF_POLICIES_GIT.

from cf-butler.

pacphi avatar pacphi commented on May 30, 2024

Completed as of 7eac0ac

from cf-butler.

mjenk664 avatar mjenk664 commented on May 30, 2024

I had started implementing it to see if I could get the code written, but you beat me to it :)
I'll test it out with my team now and update you on our findings.

Thanks for your quick reply and efforts on implementing this feature! @pacphi

from cf-butler.

mjenk664 avatar mjenk664 commented on May 30, 2024

Hi @pacphi ,

I tested out the changes and it seems to fail with the following error when I try to deploy to PAS:

Could not resolve placeholder 'vcap.services.cf-butler-secrets.credentials.CF_POLICIES_GIT_URI' in value "${vcap.services.cf-butler-secrets.credentials.CF_POLICIES_GIT_URI}"

I checked the application-yml file and I didn't see anything wrong with the references in your commit PR. I double-checked my secrets.json and validated that the syntax is correct using jq. Here's my example secrets.json:

{
        "TOKEN_PROVIDER": "userpass",
        "CF_API-HOST": "api.sys.domain",
        "CF_USERNAME": "cfusername",
        "CF_PASSWORD": "cfpassword",
        "CF_ORGANIZATION-BLACK-LIST": [
                "system"
        ],
        "CF_ACCOUNT-REGEX": "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$",
        "CRON_COLLECTION": "* */4 * * * *",
        "CRON_EXECUTION": "* */5 * * * *",
        "CF_POLICIES_GIT_URI": "https://mygituri.com/repo/repo-policies.git",
        "CF_POLICIES_GIT_USERNAME": "myusername",
        "CF_POLICIES_GIT_PASSWORD": "mypassword",
        "CF_POLICIES_GIT_FILE-PATHS": [
                "policy1-AP.json"
        ],
        "EXPOSED_ACTUATOR_ENDPOINTS": "beans,env,info,health,metrics,scheduledtasks,loggers,mappings,prometheus"
}

Am I missing something?

from cf-butler.

pacphi avatar pacphi commented on May 30, 2024

The above issue is fixed as of 2c7b58f. But we have another issue, that I'm tracking with #185.

from cf-butler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.