Skip to content

Commit

Permalink
Migrate to new harreader model API
Browse files Browse the repository at this point in the history
  • Loading branch information
uarlouski committed Nov 15, 2024
1 parent 71c168a commit adb9a5a
Show file tree
Hide file tree
Showing 47 changed files with 56 additions and 1,253 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
- `c.b.h.m.HarLog.findMostRecentEntry()` is replaced by `c.b.h.f.HarLogFilter.findMostRecentEntry(HarLog)`
- `c.b.h.m.HarLog.findMostRecentEntry(Pattern)` is replaced by `c.b.h.f.HarLogFilter.findMostRecentEntry(HarLog, Pattern)`
- `c.b.h.m.HarLog.findEntries(Pattern)` is replaced by `c.b.h.f.HarLogFilter.findEntries(HarLog, Pattern)`
- Migrate to new harreader model API
- `c.b.h.m.HarCache` is replaced by `d.s.h.m.HarCache`
- `c.b.h.m.HarContent` is replaced by `d.s.h.m.HarContent`
- `c.b.h.m.HarCookie` is replaced by `d.s.h.m.HarCookie`
- `c.b.h.m.HarCreatorBrowser` is replaced by `d.s.h.m.HarCreatorBrowser`
- `c.b.h.m.HarHeader` is replaced by `d.s.h.m.HarHeader`
- `c.b.h.m.HarPage` is replaced by `d.s.h.m.HarPage`
- `c.b.h.m.HarPageTiming` is replaced by `d.s.h.m.HarPageTiming`
- `c.b.h.m.HarPostData` is replaced by `d.s.h.m.HarPostData`
- `c.b.h.m.HarPostDataParam` is replaced by `d.s.h.m.HarPostDataParam`
- `c.b.h.m.HarQueryParam` is replaced by `d.s.h.m.HarQueryParam`
- `c.b.h.m.HttpMethod` is replaced by `d.s.h.m.HttpMethod`
- `c.b.h.m.HttpStatus` is replaced by `d.s.h.m.HttpStatus`

# [2.2.19]
## Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.browserup.bup.util.HttpStatusClass;
import com.browserup.harreader.model.Har;
import com.browserup.harreader.model.HarEntry;
import de.sstoehr.harreader.model.HarPageTiming;
import org.littleshoot.proxy.HttpFiltersSource;
import org.littleshoot.proxy.MitmManager;

Expand Down Expand Up @@ -210,7 +211,7 @@ default Har getHar() {
/**
* Starts a new HAR page using the default page naming convention. The default page naming convention is "Page #", where "#" resets to 1
* every time {@link #newHar()} or {@link #newHar(String)} is called, and increments on every subsequent call to {@link #newPage()} or
* {@link #newHar(String)}. Populates the {@link com.browserup.harreader.model.HarPageTiming#onLoad} value based on the amount of time
* {@link #newHar(String)}. Populates the {@link HarPageTiming#getOnLoad()} value based on the amount of time
* the current page has been captured.
*
* @return the HAR as it existed immediately after ending the current page
Expand All @@ -220,7 +221,7 @@ default Har getHar() {

/**
* Starts a new HAR page using the specified pageRef as the page name and the page title. Populates the
* {@link com.browserup.harreader.model.HarPageTiming#onLoad} value based on the amount of time the current page has been captured.
* {@link HarPageTiming#getOnLoad()} value based on the amount of time the current page has been captured.
*
* @param pageRef name of the new page
* @return the HAR as it existed immediately after ending the current page
Expand All @@ -230,7 +231,7 @@ default Har getHar() {

/**
* Starts a new HAR page using the specified pageRef as the page name and the pageTitle as the page title. Populates the
* {@link com.browserup.harreader.model.HarPageTiming#onLoad} value based on the amount of time the current page has been captured.
* {@link HarPageTiming#getOnLoad()} value based on the amount of time the current page has been captured.
*
* @param pageRef name of the new page
* @param pageTitle title of the new page
Expand All @@ -240,7 +241,7 @@ default Har getHar() {
Har newPage(String pageRef, String pageTitle);

/**
* Stops capturing traffic in the HAR. Populates the {@link com.browserup.harreader.model.HarPageTiming#onLoad} value for the current page
* Stops capturing traffic in the HAR. Populates the {@link HarPageTiming#getOnLoad()} value for the current page
* based on the amount of time it has been captured.
*
* @return the existing HAR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@
import com.browserup.bup.util.BrowserUpProxyUtil;
import com.browserup.bup.util.HttpStatusClass;
import com.browserup.harreader.model.Har;
import com.browserup.harreader.model.HarCreatorBrowser;
import com.browserup.harreader.model.HarEntry;
import com.browserup.harreader.model.HarLog;
import com.browserup.harreader.model.HarPage;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.MapMaker;
import de.sstoehr.harreader.model.HarCreatorBrowser;
import de.sstoehr.harreader.model.HarPage;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.handler.codec.http.HttpObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.browserup.bup.assertion.field.header;

import com.browserup.bup.assertion.field.HarEntryPredicate;
import com.browserup.harreader.model.HarHeader;
import de.sstoehr.harreader.model.HarHeader;

import java.util.List;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.browserup.bup.assertion.field.header;

import com.browserup.bup.assertion.field.HarEntryPredicate;
import com.browserup.harreader.model.HarHeader;
import de.sstoehr.harreader.model.HarHeader;

import java.util.List;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.browserup.bup.assertion.field.header;

import com.browserup.bup.assertion.field.HarEntryPredicate;
import com.browserup.harreader.model.HarHeader;
import de.sstoehr.harreader.model.HarHeader;

import java.util.List;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.browserup.bup.assertion.field.header;

import com.browserup.bup.assertion.field.HarEntryPredicate;
import com.browserup.harreader.model.HarHeader;
import de.sstoehr.harreader.model.HarHeader;

import java.util.List;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.browserup.bup.assertion.field.header;

import com.browserup.bup.assertion.field.HarEntryPredicate;
import com.browserup.harreader.model.HarHeader;
import de.sstoehr.harreader.model.HarHeader;

import java.util.List;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.browserup.bup.assertion.field.header;

import com.browserup.bup.assertion.field.HarEntryPredicate;
import com.browserup.harreader.model.HarHeader;
import de.sstoehr.harreader.model.HarHeader;

import java.util.List;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.browserup.bup.assertion.field.FieldPassesPredicateAssertion;
import com.browserup.bup.assertion.field.HarEntryAssertionFieldSupplier;
import com.browserup.harreader.model.HarHeader;
import de.sstoehr.harreader.model.HarHeader;

import java.util.List;
import java.util.function.Predicate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package com.browserup.bup.filters;

import com.google.common.collect.ImmutableList;
import com.browserup.harreader.model.HarHeader;
import com.browserup.harreader.model.HttpMethod;
import de.sstoehr.harreader.model.*;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpContent;
Expand All @@ -18,11 +17,7 @@
import io.netty.handler.codec.http.cookie.Cookie;
import io.netty.handler.codec.http.cookie.ServerCookieDecoder;
import com.browserup.harreader.model.Har;
import com.browserup.harreader.model.HarCookie;
import com.browserup.harreader.model.HarEntry;
import com.browserup.harreader.model.HarQueryParam;
import com.browserup.harreader.model.HarPostData;
import com.browserup.harreader.model.HarPostDataParam;
import com.browserup.harreader.model.HarRequest;
import com.browserup.harreader.model.HarResponse;
import com.browserup.bup.exception.UnsupportedCharsetException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.browserup.bup.filters;

import com.google.common.cache.CacheBuilder;
import com.browserup.harreader.model.HttpMethod;
import de.sstoehr.harreader.model.HttpMethod;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.HttpObject;
import io.netty.handler.codec.http.HttpRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import com.browserup.harreader.model.Har;
import com.browserup.harreader.model.HarEntry;
import com.browserup.harreader.model.HarLog;
import com.browserup.harreader.model.HarPage;
import com.browserup.bup.mitm.exception.UncheckedIOException;
import de.sstoehr.harreader.model.HarPage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down

This file was deleted.

Loading

0 comments on commit adb9a5a

Please sign in to comment.