Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error types to policy #765

Merged
merged 3 commits into from Apr 5, 2019

Conversation

Projects
None yet
3 participants
@dstiliadis
Copy link
Member

dstiliadis commented Apr 4, 2019

Adds additional error types in the policy object.

dstiliadis added some commits Mar 30, 2019

@aporeto-dimitri

This comment has been minimized.

Copy link
Contributor

aporeto-dimitri commented Apr 4, 2019

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "engine-refactor",
    "component": "enforcerd",
    "pr-id": "1094",
    "commit-sha": "b211631648f95c68f476566a00b09d2ef14d5a3c"
  },
  {
    "project": "engine-refactor",
    "component": "integrations-lib",
    "pr-id": "95",
    "commit-sha": "2ca15f70ded1f3477eb0f1da4b774bb5c25810dd"
  },
  {
    "project": "engine-refactor",
    "component": "trireme-lib",
    "pr-id": "765",
    "commit-sha": "e33befde874d0ede2895dac5c1a32fdba2ea030d"
  }
]
@codecov

This comment has been minimized.

Copy link

codecov bot commented Apr 4, 2019

Codecov Report

Merging #765 into master will decrease coverage by 0.14%.
The diff coverage is 4%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #765      +/-   ##
==========================================
- Coverage   56.86%   56.72%   -0.15%     
==========================================
  Files          91       91              
  Lines        8525     8547      +22     
==========================================
  Hits         4848     4848              
- Misses       3239     3261      +22     
  Partials      438      438
Impacted Files Coverage Δ
policy/policyerror.go 70.27% <0%> (-29.73%) ⬇️
...rcer/applicationproxy/servicecache/servicecache.go 91.72% <33.33%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 71c412f...e33befd. Read the comment docs.

@aporeto-dimitri

This comment has been minimized.

Copy link
Contributor

aporeto-dimitri commented Apr 4, 2019

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "engine-refactor",
    "component": "integrations-lib",
    "pr-id": "95",
    "commit-sha": "2ca15f70ded1f3477eb0f1da4b774bb5c25810dd"
  },
  {
    "project": "engine-refactor",
    "component": "trireme-lib",
    "pr-id": "765",
    "commit-sha": "e33befde874d0ede2895dac5c1a32fdba2ea030d"
  },
  {
    "project": "engine-refactor",
    "component": "enforcerd",
    "pr-id": "1094",
    "commit-sha": "b211631648f95c68f476566a00b09d2ef14d5a3c"
  },
  {
    "project": "engine-refactor",
    "component": "apotests",
    "pr-id": "1991",
    "commit-sha": "925e9ef469c65bf5b13add696830e92945922f7f"
  }
]
@aporeto-dimitri

This comment has been minimized.

Copy link
Contributor

aporeto-dimitri commented Apr 4, 2019

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "engine-refactor",
    "component": "apotests",
    "pr-id": "1991",
    "commit-sha": "925e9ef469c65bf5b13add696830e92945922f7f"
  },
  {
    "project": "engine-refactor",
    "component": "integrations-lib",
    "pr-id": "95",
    "commit-sha": "2ca15f70ded1f3477eb0f1da4b774bb5c25810dd"
  },
  {
    "project": "engine-refactor",
    "component": "trireme-lib",
    "pr-id": "765",
    "commit-sha": "e33befde874d0ede2895dac5c1a32fdba2ea030d"
  },
  {
    "project": "engine-refactor",
    "component": "enforcerd",
    "pr-id": "1094",
    "commit-sha": "2907a31c00dd69c996f14e98f39349aa0fa82799"
  }
]
@aporeto-dimitri

This comment has been minimized.

Copy link
Contributor

aporeto-dimitri commented Apr 4, 2019

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "engine-refactor",
    "component": "integrations-lib",
    "pr-id": "95",
    "commit-sha": "2ca15f70ded1f3477eb0f1da4b774bb5c25810dd"
  },
  {
    "project": "engine-refactor",
    "component": "trireme-lib",
    "pr-id": "765",
    "commit-sha": "e33befde874d0ede2895dac5c1a32fdba2ea030d"
  },
  {
    "project": "engine-refactor",
    "component": "enforcerd",
    "pr-id": "1094",
    "commit-sha": "2907a31c00dd69c996f14e98f39349aa0fa82799"
  },
  {
    "project": "engine-refactor",
    "component": "apotests",
    "pr-id": "1991",
    "commit-sha": "925e9ef469c65bf5b13add696830e92945922f7f"
  }
]
@aporeto-dimitri

This comment has been minimized.

Copy link
Contributor

aporeto-dimitri commented Apr 4, 2019

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "engine-refactor",
    "component": "trireme-lib",
    "pr-id": "765",
    "commit-sha": "e33befde874d0ede2895dac5c1a32fdba2ea030d"
  },
  {
    "project": "engine-refactor",
    "component": "enforcerd",
    "pr-id": "1094",
    "commit-sha": "2907a31c00dd69c996f14e98f39349aa0fa82799"
  },
  {
    "project": "engine-refactor",
    "component": "apotests",
    "pr-id": "1991",
    "commit-sha": "3ba9dba8ea9f6e84d679e806b6e9dbb1f5c540e5"
  },
  {
    "project": "engine-refactor",
    "component": "integrations-lib",
    "pr-id": "95",
    "commit-sha": "2ca15f70ded1f3477eb0f1da4b774bb5c25810dd"
  }
]
@primalmotion
Copy link
Member

primalmotion left a comment

error needs to give a bit more context

@@ -103,17 +103,17 @@ func (p *AppProxy) Enforce(ctx context.Context, puID string, puInfo *policy.PUIn

data, err := p.puFromID.Get(puID)
if err != nil || data == nil {
return fmt.Errorf("Undefined PU - Context not found: %s", puID)
return fmt.Errorf("undefined PU - Context not found: %s", puID)

This comment has been minimized.

Copy link
@primalmotion

This comment has been minimized.

Copy link
@primalmotion

primalmotion Apr 5, 2019

Member

lower case Context

@@ -123,7 +123,7 @@ func (p *AppProxy) Enforce(ctx context.Context, puID string, puInfo *policy.PUIn
if c, cerr := p.clients.Get(puID); cerr == nil {
_, perr := p.processCertificateUpdates(puInfo, c.(*clientData), caPool)
if perr != nil {
zap.L().Error("Failed to update certificates and services", zap.Error(perr))
zap.L().Error("unable to update certificates and services", zap.Error(perr))

This comment has been minimized.

Copy link
@primalmotion

primalmotion Apr 5, 2019

Member

zap log is Capitalized :)

@@ -94,19 +94,19 @@ func (e *enforcer) Enforce(contextID string, puInfo *policy.PUInfo) error {

if e.transport != nil {
if err := e.transport.Enforce(contextID, puInfo); err != nil {
return fmt.Errorf("Failed to enforce in nfq: %s", err)
return fmt.Errorf("unable to enforce in nfq: %s", err)

This comment has been minimized.

Copy link
@primalmotion

primalmotion Apr 5, 2019

Member

can you provide more info like the pu ID etc?

}
}

if e.proxy != nil {
if err := e.proxy.Enforce(context.Background(), contextID, puInfo); err != nil {
return fmt.Errorf("Failed to enforce in proxy: %s", err)
return fmt.Errorf("unable to enforce in proxy: %s", err)

This comment has been minimized.

Copy link
@primalmotion
@@ -68,9 +67,9 @@ func NewClient(ctx context.Context, v *TokenVerifier) (*TokenVerifier, error) {
// If it is not a compliant provider we should report and error here.
provider, err := oidc.NewProvider(ctx, v.ProviderURL)
if err != nil {
zap.L().Error("Failed to initialize OIDC provider", zap.Error(err), zap.String("Provider URL", v.ProviderURL))
return nil, fmt.Errorf("Failed to initialize provider: %s", err)

This comment has been minimized.

Copy link
@primalmotion

primalmotion Apr 5, 2019

Member

the url of the provider would help

@dstiliadis dstiliadis merged commit df28180 into master Apr 5, 2019

4 of 6 checks passed

codecov/patch 4% of diff hit (target 56.86%)
Details
codecov/project 56.72% (-0.15%) compared to 71c412f
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
functional-tests Submitter: reason: . functional-tests set to success
Details
functional-tests-trigger Submitter: reason: . functional-tests-trigger set to success
Details

@dstiliadis dstiliadis deleted the add-error-types branch Apr 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.